From 3ba274317112382cc735cc2d6f33c911898415e9 Mon Sep 17 00:00:00 2001 From: petscheit Date: Fri, 26 Jul 2024 16:00:27 +0200 Subject: [PATCH 1/4] feat: add local deploy script --- pnpm-lock.yaml | 340 ++++++++++++++++++++++---------------- script/HdpLocal.s.sol | 31 ++++ src/FactsRegistry.sol | 10 ++ src/HdpExecutionStore.sol | 2 +- 4 files changed, 236 insertions(+), 147 deletions(-) create mode 100644 script/HdpLocal.s.sol create mode 100644 src/FactsRegistry.sol diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 595592d..a2de5c4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,25 +1,167 @@ -lockfileVersion: '6.0' +lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false -dependencies: - '@openzeppelin/merkle-tree': - specifier: ^1.0.6 - version: 1.0.6 - ethers: - specifier: ^6.12.0 - version: 6.12.0 +importers: + + .: + dependencies: + '@openzeppelin/merkle-tree': + specifier: ^1.0.6 + version: 1.0.6 + ethers: + specifier: ^6.12.0 + version: 6.12.0 packages: - /@adraffy/ens-normalize@1.10.1: + '@adraffy/ens-normalize@1.10.1': resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} - dev: false - /@ethersproject/abi@5.7.0: + '@ethersproject/abi@5.7.0': resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} + + '@ethersproject/abstract-provider@5.7.0': + resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} + + '@ethersproject/abstract-signer@5.7.0': + resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} + + '@ethersproject/address@5.7.0': + resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} + + '@ethersproject/base64@5.7.0': + resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} + + '@ethersproject/bignumber@5.7.0': + resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} + + '@ethersproject/bytes@5.7.0': + resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + + '@ethersproject/constants@5.7.0': + resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} + + '@ethersproject/hash@5.7.0': + resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} + + '@ethersproject/keccak256@5.7.0': + resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} + + '@ethersproject/logger@5.7.0': + resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} + + '@ethersproject/networks@5.7.1': + resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} + + '@ethersproject/properties@5.7.0': + resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} + + '@ethersproject/rlp@5.7.0': + resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} + + '@ethersproject/signing-key@5.7.0': + resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} + + '@ethersproject/strings@5.7.0': + resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} + + '@ethersproject/transactions@5.7.0': + resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} + + '@ethersproject/web@5.7.1': + resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} + + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + + '@noble/hashes@1.2.0': + resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + + '@noble/secp256k1@1.7.1': + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + + '@openzeppelin/merkle-tree@1.0.6': + resolution: {integrity: sha512-cGWOb2WBWbJhqvupzxjnKAwGLxxAEYPg51sk76yZ5nVe5D03mw7Vx5yo8llaIEqYhP5O39M8QlrNWclgLfKVrA==} + + '@scure/base@1.1.6': + resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} + + '@scure/bip32@1.1.5': + resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + + '@scure/bip39@1.1.1': + resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + + '@types/node@18.15.13': + resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + + aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + + bn.js@4.12.0: + resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} + + bn.js@5.2.1: + resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} + + brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + + elliptic@6.5.4: + resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} + + ethereum-cryptography@1.2.0: + resolution: {integrity: sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==} + + ethers@6.12.0: + resolution: {integrity: sha512-zL5NlOTjML239gIvtVJuaSk0N9GQLi1Hom3ZWUszE5lDTQE/IVB62mrPkQ2W1bGcZwVGSLaetQbWNQSvI4rGDQ==} + engines: {node: '>=14.0.0'} + + hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + + hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + js-sha3@0.8.0: + resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} + + minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + + minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + + tslib@2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + + ws@8.5.0: + resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + +snapshots: + + '@adraffy/ens-normalize@1.10.1': {} + + '@ethersproject/abi@5.7.0': dependencies: '@ethersproject/address': 5.7.0 '@ethersproject/bignumber': 5.7.0 @@ -30,10 +172,8 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: false - /@ethersproject/abstract-provider@5.7.0: - resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} + '@ethersproject/abstract-provider@5.7.0': dependencies: '@ethersproject/bignumber': 5.7.0 '@ethersproject/bytes': 5.7.0 @@ -42,56 +182,42 @@ packages: '@ethersproject/properties': 5.7.0 '@ethersproject/transactions': 5.7.0 '@ethersproject/web': 5.7.1 - dev: false - /@ethersproject/abstract-signer@5.7.0: - resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} + '@ethersproject/abstract-signer@5.7.0': dependencies: '@ethersproject/abstract-provider': 5.7.0 '@ethersproject/bignumber': 5.7.0 '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 - dev: false - /@ethersproject/address@5.7.0: - resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} + '@ethersproject/address@5.7.0': dependencies: '@ethersproject/bignumber': 5.7.0 '@ethersproject/bytes': 5.7.0 '@ethersproject/keccak256': 5.7.0 '@ethersproject/logger': 5.7.0 '@ethersproject/rlp': 5.7.0 - dev: false - /@ethersproject/base64@5.7.0: - resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} + '@ethersproject/base64@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 - dev: false - /@ethersproject/bignumber@5.7.0: - resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} + '@ethersproject/bignumber@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 bn.js: 5.2.1 - dev: false - /@ethersproject/bytes@5.7.0: - resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + '@ethersproject/bytes@5.7.0': dependencies: '@ethersproject/logger': 5.7.0 - dev: false - /@ethersproject/constants@5.7.0: - resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} + '@ethersproject/constants@5.7.0': dependencies: '@ethersproject/bignumber': 5.7.0 - dev: false - /@ethersproject/hash@5.7.0: - resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} + '@ethersproject/hash@5.7.0': dependencies: '@ethersproject/abstract-signer': 5.7.0 '@ethersproject/address': 5.7.0 @@ -102,40 +228,28 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: false - /@ethersproject/keccak256@5.7.0: - resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} + '@ethersproject/keccak256@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 js-sha3: 0.8.0 - dev: false - /@ethersproject/logger@5.7.0: - resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} - dev: false + '@ethersproject/logger@5.7.0': {} - /@ethersproject/networks@5.7.1: - resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} + '@ethersproject/networks@5.7.1': dependencies: '@ethersproject/logger': 5.7.0 - dev: false - /@ethersproject/properties@5.7.0: - resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} + '@ethersproject/properties@5.7.0': dependencies: '@ethersproject/logger': 5.7.0 - dev: false - /@ethersproject/rlp@5.7.0: - resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} + '@ethersproject/rlp@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 - dev: false - /@ethersproject/signing-key@5.7.0: - resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} + '@ethersproject/signing-key@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 @@ -143,18 +257,14 @@ packages: bn.js: 5.2.1 elliptic: 6.5.4 hash.js: 1.1.7 - dev: false - /@ethersproject/strings@5.7.0: - resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} + '@ethersproject/strings@5.7.0': dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/constants': 5.7.0 '@ethersproject/logger': 5.7.0 - dev: false - /@ethersproject/transactions@5.7.0: - resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} + '@ethersproject/transactions@5.7.0': dependencies: '@ethersproject/address': 5.7.0 '@ethersproject/bignumber': 5.7.0 @@ -165,85 +275,54 @@ packages: '@ethersproject/properties': 5.7.0 '@ethersproject/rlp': 5.7.0 '@ethersproject/signing-key': 5.7.0 - dev: false - /@ethersproject/web@5.7.1: - resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} + '@ethersproject/web@5.7.1': dependencies: '@ethersproject/base64': 5.7.0 '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: false - /@noble/curves@1.2.0: - resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 - dev: false - /@noble/hashes@1.2.0: - resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} - dev: false + '@noble/hashes@1.2.0': {} - /@noble/hashes@1.3.2: - resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} - engines: {node: '>= 16'} - dev: false + '@noble/hashes@1.3.2': {} - /@noble/secp256k1@1.7.1: - resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} - dev: false + '@noble/secp256k1@1.7.1': {} - /@openzeppelin/merkle-tree@1.0.6: - resolution: {integrity: sha512-cGWOb2WBWbJhqvupzxjnKAwGLxxAEYPg51sk76yZ5nVe5D03mw7Vx5yo8llaIEqYhP5O39M8QlrNWclgLfKVrA==} + '@openzeppelin/merkle-tree@1.0.6': dependencies: '@ethersproject/abi': 5.7.0 ethereum-cryptography: 1.2.0 - dev: false - /@scure/base@1.1.6: - resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} - dev: false + '@scure/base@1.1.6': {} - /@scure/bip32@1.1.5: - resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + '@scure/bip32@1.1.5': dependencies: '@noble/hashes': 1.2.0 '@noble/secp256k1': 1.7.1 '@scure/base': 1.1.6 - dev: false - /@scure/bip39@1.1.1: - resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + '@scure/bip39@1.1.1': dependencies: '@noble/hashes': 1.2.0 '@scure/base': 1.1.6 - dev: false - /@types/node@18.15.13: - resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} - dev: false + '@types/node@18.15.13': {} - /aes-js@4.0.0-beta.5: - resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} - dev: false + aes-js@4.0.0-beta.5: {} - /bn.js@4.12.0: - resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} - dev: false + bn.js@4.12.0: {} - /bn.js@5.2.1: - resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} - dev: false + bn.js@5.2.1: {} - /brorand@1.1.0: - resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - dev: false + brorand@1.1.0: {} - /elliptic@6.5.4: - resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} + elliptic@6.5.4: dependencies: bn.js: 4.12.0 brorand: 1.1.0 @@ -252,20 +331,15 @@ packages: inherits: 2.0.4 minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - dev: false - /ethereum-cryptography@1.2.0: - resolution: {integrity: sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==} + ethereum-cryptography@1.2.0: dependencies: '@noble/hashes': 1.2.0 '@noble/secp256k1': 1.7.1 '@scure/bip32': 1.1.5 '@scure/bip39': 1.1.1 - dev: false - /ethers@6.12.0: - resolution: {integrity: sha512-zL5NlOTjML239gIvtVJuaSk0N9GQLi1Hom3ZWUszE5lDTQE/IVB62mrPkQ2W1bGcZwVGSLaetQbWNQSvI4rGDQ==} - engines: {node: '>=14.0.0'} + ethers@6.12.0: dependencies: '@adraffy/ens-normalize': 1.10.1 '@noble/curves': 1.2.0 @@ -277,52 +351,26 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - dev: false - /hash.js@1.1.7: - resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + hash.js@1.1.7: dependencies: inherits: 2.0.4 minimalistic-assert: 1.0.1 - dev: false - /hmac-drbg@1.0.1: - resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + hmac-drbg@1.0.1: dependencies: hash.js: 1.1.7 minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - dev: false - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: false + inherits@2.0.4: {} - /js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: false + js-sha3@0.8.0: {} - /minimalistic-assert@1.0.1: - resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} - dev: false + minimalistic-assert@1.0.1: {} - /minimalistic-crypto-utils@1.0.1: - resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} - dev: false + minimalistic-crypto-utils@1.0.1: {} - /tslib@2.4.0: - resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} - dev: false + tslib@2.4.0: {} - /ws@8.5.0: - resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false + ws@8.5.0: {} diff --git a/script/HdpLocal.s.sol b/script/HdpLocal.s.sol new file mode 100644 index 0000000..088a8e7 --- /dev/null +++ b/script/HdpLocal.s.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {Script} from "forge-std/Script.sol"; +import {console2} from "forge-std/console2.sol"; +import {IFactsRegistry} from "../src/interfaces/IFactsRegistry.sol"; +import {IAggregatorsFactory} from "../src/interfaces/IAggregatorsFactory.sol"; +import {MockedSharpFactsRegistry} from "../src/FactsRegistry.sol"; +import {HdpExecutionStore} from "../src/HdpExecutionStore.sol"; + +contract HdpLocalDeployer is Script { + function run() external { + uint256 deployerPrivateKey = vm.envUint("PRIV_KEY"); + vm.startBroadcast(deployerPrivateKey); + bytes32 salt = "1337"; + + // Deploy the FactRegistry to the local network + MockedSharpFactsRegistry factsRegistry = new MockedSharpFactsRegistry{salt: salt}(); + address factsRegistryAddress = address(factsRegistry); + + IFactsRegistry iFactsRegistry = IFactsRegistry(address(factsRegistry)); + + IAggregatorsFactory aggregatorsFactory = IAggregatorsFactory(vm.envAddress("SHARP_AGGREGATORS_FACTORY")); + + // Deploy the HdpExecutionStore + HdpExecutionStore hdpExecutionStore = new HdpExecutionStore{salt: salt}(iFactsRegistry, aggregatorsFactory, vm.envBytes32("HDP_PROGRAM_HASH")); + console2.log("MockedSharpFactsRegistry: ", factsRegistryAddress); + console2.log("HdpExecutionStore: ", address(hdpExecutionStore)); + vm.stopBroadcast(); + } +} diff --git a/src/FactsRegistry.sol b/src/FactsRegistry.sol new file mode 100644 index 0000000..134ba36 --- /dev/null +++ b/src/FactsRegistry.sol @@ -0,0 +1,10 @@ +pragma solidity 0.8.20; + +contract MockedSharpFactsRegistry { + mapping(bytes32 => bool) public isValid; + + function setValid(bytes32 fact) external { + isValid[fact] = true; + } + +} \ No newline at end of file diff --git a/src/HdpExecutionStore.sol b/src/HdpExecutionStore.sol index f3e754c..d6d3158 100644 --- a/src/HdpExecutionStore.sol +++ b/src/HdpExecutionStore.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.4; +pragma solidity ^0.8.20; import {AccessControl} from "openzeppelin-contracts/contracts/access/AccessControl.sol"; import {MerkleProof} from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol"; From 37f5d1922f96414379759fe9cf88ebdea738c7cd Mon Sep 17 00:00:00 2001 From: petscheit Date: Mon, 29 Jul 2024 15:11:57 +0200 Subject: [PATCH 2/4] temp --- HdpExecutionStore.abi.json | 888 +++++++++++++++++++++++++++++++++++++ src/HdpExecutionStore.sol | 2 +- 2 files changed, 889 insertions(+), 1 deletion(-) create mode 100644 HdpExecutionStore.abi.json diff --git a/HdpExecutionStore.abi.json b/HdpExecutionStore.abi.json new file mode 100644 index 0000000..23c8141 --- /dev/null +++ b/HdpExecutionStore.abi.json @@ -0,0 +1,888 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "factsRegistry", + "type": "address", + "internalType": "contract IFactsRegistry" + }, + { + "name": "aggregatorsFactory", + "type": "address", + "internalType": "contract IAggregatorsFactory" + }, + { + "name": "programHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "AGGREGATORS_FACTORY", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IAggregatorsFactory" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "CHAIN_ID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "DEFAULT_ADMIN_ROLE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "OPERATOR_ROLE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "PROGRAM_HASH", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "SHARP_FACTS_REGISTRY", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IFactsRegistry" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "authenticateTaskExecution", + "inputs": [ + { + "name": "mmrIds", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "mmrSizes", + "type": "uint256[]", + "internalType": "uint256[]" + }, + { + "name": "taskMerkleRootLow", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "taskMerkleRootHigh", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "resultMerkleRootLow", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "resultMerkleRootHigh", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "tasksInclusionProofs", + "type": "bytes32[][]", + "internalType": "bytes32[][]" + }, + { + "name": "resultsInclusionProofs", + "type": "bytes32[][]", + "internalType": "bytes32[][]" + }, + { + "name": "taskCommitments", + "type": "bytes32[]", + "internalType": "bytes32[]" + }, + { + "name": "taskResults", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "cacheMmrRoot", + "inputs": [ + { + "name": "mmrId", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "cachedMMRsRoots", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "cachedTasksResult", + "inputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "status", + "type": "uint8", + "internalType": "enum HdpExecutionStore.TaskStatus" + }, + { + "name": "result", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getFinalizedTaskResult", + "inputs": [ + { + "name": "taskCommitment", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRoleAdmin", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTaskStatus", + "inputs": [ + { + "name": "taskCommitment", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "enum HdpExecutionStore.TaskStatus" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "grantRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "hasRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "loadMmrRoot", + "inputs": [ + { + "name": "mmrId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "mmrSize", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "renounceRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "callerConfirmation", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "requestExecutionOfModuleTask", + "inputs": [ + { + "name": "moduleTask", + "type": "tuple", + "internalType": "struct ModuleTask", + "components": [ + { + "name": "programHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "inputs", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "requestExecutionOfTaskWithBlockSampledDatalake", + "inputs": [ + { + "name": "blockSampledDatalake", + "type": "tuple", + "internalType": "struct BlockSampledDatalake", + "components": [ + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockRangeStart", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockRangeEnd", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "increment", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sampledProperty", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "computationalTask", + "type": "tuple", + "internalType": "struct ComputationalTask", + "components": [ + { + "name": "aggregateFnId", + "type": "uint8", + "internalType": "enum AggregateFn" + }, + { + "name": "operatorId", + "type": "uint8", + "internalType": "enum Operator" + }, + { + "name": "valueToCompare", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "requestExecutionOfTaskWithTransactionsInBlockDatalake", + "inputs": [ + { + "name": "transactionsInBlockDatalake", + "type": "tuple", + "internalType": "struct TransactionsInBlockDatalake", + "components": [ + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "targetBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "startIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "endIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "increment", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "includedTypes", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sampledProperty", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "computationalTask", + "type": "tuple", + "internalType": "struct ComputationalTask", + "components": [ + { + "name": "aggregateFnId", + "type": "uint8", + "internalType": "enum AggregateFn" + }, + { + "name": "operatorId", + "type": "uint8", + "internalType": "enum Operator" + }, + { + "name": "valueToCompare", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "revokeRole", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "standardLeafHash", + "inputs": [ + { + "name": "value", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "supportsInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "MmrRootCached", + "inputs": [ + { + "name": "mmrId", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "mmrSize", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "mmrRoot", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ModuleTaskScheduled", + "inputs": [ + { + "name": "moduleTask", + "type": "tuple", + "indexed": false, + "internalType": "struct ModuleTask", + "components": [ + { + "name": "programHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "inputs", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleAdminChanged", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "previousAdminRole", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "newAdminRole", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleGranted", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RoleRevoked", + "inputs": [ + { + "name": "role", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "account", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sender", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TaskWithBlockSampledDatalakeScheduled", + "inputs": [ + { + "name": "datalake", + "type": "tuple", + "indexed": false, + "internalType": "struct BlockSampledDatalake", + "components": [ + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockRangeStart", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockRangeEnd", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "increment", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sampledProperty", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "task", + "type": "tuple", + "indexed": false, + "internalType": "struct ComputationalTask", + "components": [ + { + "name": "aggregateFnId", + "type": "uint8", + "internalType": "enum AggregateFn" + }, + { + "name": "operatorId", + "type": "uint8", + "internalType": "enum Operator" + }, + { + "name": "valueToCompare", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TaskWithTransactionsInBlockDatalakeScheduled", + "inputs": [ + { + "name": "datalake", + "type": "tuple", + "indexed": false, + "internalType": "struct TransactionsInBlockDatalake", + "components": [ + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "targetBlock", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "startIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "endIndex", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "increment", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "includedTypes", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sampledProperty", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "task", + "type": "tuple", + "indexed": false, + "internalType": "struct ComputationalTask", + "components": [ + { + "name": "aggregateFnId", + "type": "uint8", + "internalType": "enum AggregateFn" + }, + { + "name": "operatorId", + "type": "uint8", + "internalType": "enum Operator" + }, + { + "name": "valueToCompare", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AccessControlBadConfirmation", + "inputs": [] + }, + { + "type": "error", + "name": "AccessControlUnauthorizedAccount", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + }, + { + "name": "neededRole", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "DoubleRegistration", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidFact", + "inputs": [] + }, + { + "type": "error", + "name": "NotFinalized", + "inputs": [] + }, + { + "type": "error", + "name": "NotInBatch", + "inputs": [] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [] + } +] diff --git a/src/HdpExecutionStore.sol b/src/HdpExecutionStore.sol index d6d3158..6beac58 100644 --- a/src/HdpExecutionStore.sol +++ b/src/HdpExecutionStore.sol @@ -95,7 +95,7 @@ contract HdpExecutionStore is AccessControl { SHARP_FACTS_REGISTRY = factsRegistry; AGGREGATORS_FACTORY = aggregatorsFactory; PROGRAM_HASH = programHash; - CHAIN_ID = block.chainid; + CHAIN_ID = 11155111; _setRoleAdmin(OPERATOR_ROLE, OPERATOR_ROLE); _grantRole(OPERATOR_ROLE, _msgSender()); From a96825b91bd77d32e0f35960921cee020c2dee74 Mon Sep 17 00:00:00 2001 From: Pia Date: Mon, 29 Jul 2024 11:20:41 -0400 Subject: [PATCH 3/4] fix: back chain id --- src/FactsRegistry.sol | 3 ++- src/HdpExecutionStore.sol | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FactsRegistry.sol b/src/FactsRegistry.sol index 134ba36..7c0407c 100644 --- a/src/FactsRegistry.sol +++ b/src/FactsRegistry.sol @@ -1,4 +1,5 @@ -pragma solidity 0.8.20; +// SPDX-License-Identifier: GPL-3.0 +pragma solidity ^0.8.4; contract MockedSharpFactsRegistry { mapping(bytes32 => bool) public isValid; diff --git a/src/HdpExecutionStore.sol b/src/HdpExecutionStore.sol index 6beac58..f3e754c 100644 --- a/src/HdpExecutionStore.sol +++ b/src/HdpExecutionStore.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.4; import {AccessControl} from "openzeppelin-contracts/contracts/access/AccessControl.sol"; import {MerkleProof} from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol"; @@ -95,7 +95,7 @@ contract HdpExecutionStore is AccessControl { SHARP_FACTS_REGISTRY = factsRegistry; AGGREGATORS_FACTORY = aggregatorsFactory; PROGRAM_HASH = programHash; - CHAIN_ID = 11155111; + CHAIN_ID = block.chainid; _setRoleAdmin(OPERATOR_ROLE, OPERATOR_ROLE); _grantRole(OPERATOR_ROLE, _msgSender()); From 257ab5712e4d0579343b8a9ccb9adecb9567efa2 Mon Sep 17 00:00:00 2001 From: Pia Date: Mon, 29 Jul 2024 11:26:38 -0400 Subject: [PATCH 4/4] rm abi --- HdpExecutionStore.abi.json | 888 ------------------------------------- 1 file changed, 888 deletions(-) delete mode 100644 HdpExecutionStore.abi.json diff --git a/HdpExecutionStore.abi.json b/HdpExecutionStore.abi.json deleted file mode 100644 index 23c8141..0000000 --- a/HdpExecutionStore.abi.json +++ /dev/null @@ -1,888 +0,0 @@ -[ - { - "type": "constructor", - "inputs": [ - { - "name": "factsRegistry", - "type": "address", - "internalType": "contract IFactsRegistry" - }, - { - "name": "aggregatorsFactory", - "type": "address", - "internalType": "contract IAggregatorsFactory" - }, - { - "name": "programHash", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "AGGREGATORS_FACTORY", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IAggregatorsFactory" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "CHAIN_ID", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "OPERATOR_ROLE", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "PROGRAM_HASH", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "SHARP_FACTS_REGISTRY", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IFactsRegistry" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "authenticateTaskExecution", - "inputs": [ - { - "name": "mmrIds", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "mmrSizes", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "taskMerkleRootLow", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "taskMerkleRootHigh", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "resultMerkleRootLow", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "resultMerkleRootHigh", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tasksInclusionProofs", - "type": "bytes32[][]", - "internalType": "bytes32[][]" - }, - { - "name": "resultsInclusionProofs", - "type": "bytes32[][]", - "internalType": "bytes32[][]" - }, - { - "name": "taskCommitments", - "type": "bytes32[]", - "internalType": "bytes32[]" - }, - { - "name": "taskResults", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "cacheMmrRoot", - "inputs": [ - { - "name": "mmrId", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "cachedMMRsRoots", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "cachedTasksResult", - "inputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "status", - "type": "uint8", - "internalType": "enum HdpExecutionStore.TaskStatus" - }, - { - "name": "result", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getFinalizedTaskResult", - "inputs": [ - { - "name": "taskCommitment", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getRoleAdmin", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getTaskStatus", - "inputs": [ - { - "name": "taskCommitment", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "uint8", - "internalType": "enum HdpExecutionStore.TaskStatus" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "grantRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "hasRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "loadMmrRoot", - "inputs": [ - { - "name": "mmrId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "mmrSize", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "renounceRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "callerConfirmation", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "requestExecutionOfModuleTask", - "inputs": [ - { - "name": "moduleTask", - "type": "tuple", - "internalType": "struct ModuleTask", - "components": [ - { - "name": "programHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "inputs", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "requestExecutionOfTaskWithBlockSampledDatalake", - "inputs": [ - { - "name": "blockSampledDatalake", - "type": "tuple", - "internalType": "struct BlockSampledDatalake", - "components": [ - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "blockRangeStart", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "blockRangeEnd", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "increment", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "sampledProperty", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "computationalTask", - "type": "tuple", - "internalType": "struct ComputationalTask", - "components": [ - { - "name": "aggregateFnId", - "type": "uint8", - "internalType": "enum AggregateFn" - }, - { - "name": "operatorId", - "type": "uint8", - "internalType": "enum Operator" - }, - { - "name": "valueToCompare", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "requestExecutionOfTaskWithTransactionsInBlockDatalake", - "inputs": [ - { - "name": "transactionsInBlockDatalake", - "type": "tuple", - "internalType": "struct TransactionsInBlockDatalake", - "components": [ - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targetBlock", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "startIndex", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "endIndex", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "increment", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "includedTypes", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "sampledProperty", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "computationalTask", - "type": "tuple", - "internalType": "struct ComputationalTask", - "components": [ - { - "name": "aggregateFnId", - "type": "uint8", - "internalType": "enum AggregateFn" - }, - { - "name": "operatorId", - "type": "uint8", - "internalType": "enum Operator" - }, - { - "name": "valueToCompare", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "revokeRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "standardLeafHash", - "inputs": [ - { - "name": "value", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "supportsInterface", - "inputs": [ - { - "name": "interfaceId", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "event", - "name": "MmrRootCached", - "inputs": [ - { - "name": "mmrId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "mmrSize", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "mmrRoot", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ModuleTaskScheduled", - "inputs": [ - { - "name": "moduleTask", - "type": "tuple", - "indexed": false, - "internalType": "struct ModuleTask", - "components": [ - { - "name": "programHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "inputs", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ] - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RoleAdminChanged", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "previousAdminRole", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "newAdminRole", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RoleGranted", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RoleRevoked", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "TaskWithBlockSampledDatalakeScheduled", - "inputs": [ - { - "name": "datalake", - "type": "tuple", - "indexed": false, - "internalType": "struct BlockSampledDatalake", - "components": [ - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "blockRangeStart", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "blockRangeEnd", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "increment", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "sampledProperty", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "task", - "type": "tuple", - "indexed": false, - "internalType": "struct ComputationalTask", - "components": [ - { - "name": "aggregateFnId", - "type": "uint8", - "internalType": "enum AggregateFn" - }, - { - "name": "operatorId", - "type": "uint8", - "internalType": "enum Operator" - }, - { - "name": "valueToCompare", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "TaskWithTransactionsInBlockDatalakeScheduled", - "inputs": [ - { - "name": "datalake", - "type": "tuple", - "indexed": false, - "internalType": "struct TransactionsInBlockDatalake", - "components": [ - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "targetBlock", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "startIndex", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "endIndex", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "increment", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "includedTypes", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "sampledProperty", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "task", - "type": "tuple", - "indexed": false, - "internalType": "struct ComputationalTask", - "components": [ - { - "name": "aggregateFnId", - "type": "uint8", - "internalType": "enum AggregateFn" - }, - { - "name": "operatorId", - "type": "uint8", - "internalType": "enum Operator" - }, - { - "name": "valueToCompare", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "AccessControlBadConfirmation", - "inputs": [] - }, - { - "type": "error", - "name": "AccessControlUnauthorizedAccount", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - }, - { - "name": "neededRole", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "DoubleRegistration", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidFact", - "inputs": [] - }, - { - "type": "error", - "name": "NotFinalized", - "inputs": [] - }, - { - "type": "error", - "name": "NotInBatch", - "inputs": [] - }, - { - "type": "error", - "name": "Unauthorized", - "inputs": [] - } -]