From 7fdd7d7547da79fb99ff8fb6b2a2843d91fb8276 Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Fri, 12 Apr 2024 10:37:25 -0300 Subject: [PATCH] feat: deploy to base sepolia --- CHANGELOG.md | 6 + .../deployments/base_sepolia/.chainId | 1 + .../deployments/base_sepolia/Bitmask.json | 50 ++++ .../base_sepolia/CartesiMathV2.json | 219 ++++++++++++++ .../deployments/base_sepolia/MerkleV2.json | 223 ++++++++++++++ .../base_sepolia/UnrolledCordic.json | 60 ++++ .../contracts/export/abi/base_sepolia.json | 283 ++++++++++++++++++ packages/contracts/hardhat.config.ts | 2 + packages/contracts/package.json | 4 +- 9 files changed, 847 insertions(+), 1 deletion(-) create mode 100644 packages/contracts/deployments/base_sepolia/.chainId create mode 100644 packages/contracts/deployments/base_sepolia/Bitmask.json create mode 100644 packages/contracts/deployments/base_sepolia/CartesiMathV2.json create mode 100644 packages/contracts/deployments/base_sepolia/MerkleV2.json create mode 100644 packages/contracts/deployments/base_sepolia/UnrolledCordic.json create mode 100644 packages/contracts/export/abi/base_sepolia.json diff --git a/CHANGELOG.md b/CHANGELOG.md index e6121e3..ebc284f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.3.0] - 2024-04-12 + +### Added + +- Deployment to base sepolia + ## [6.2.0] - 2024-04-09 ### Changes diff --git a/packages/contracts/deployments/base_sepolia/.chainId b/packages/contracts/deployments/base_sepolia/.chainId new file mode 100644 index 0000000..667f99d --- /dev/null +++ b/packages/contracts/deployments/base_sepolia/.chainId @@ -0,0 +1 @@ +84532 \ No newline at end of file diff --git a/packages/contracts/deployments/base_sepolia/Bitmask.json b/packages/contracts/deployments/base_sepolia/Bitmask.json new file mode 100644 index 0000000..d2d857c --- /dev/null +++ b/packages/contracts/deployments/base_sepolia/Bitmask.json @@ -0,0 +1,50 @@ +{ + "address": "0xF5B2d8c81cDE4D6238bBf20D3D77DB37df13f735", + "abi": [], + "transactionHash": "0x8802387267e0bb54450fc709ed1644706f0bd61d9062b7db809e795e91234e94", + "receipt": { + "to": "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7", + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": null, + "transactionIndex": 1, + "gasUsed": "165207", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1594836d39f2454475eb0c095b908a96db1076e22424394d80e6bb5c9e73c89d", + "transactionHash": "0x8802387267e0bb54450fc709ed1644706f0bd61d9062b7db809e795e91234e94", + "logs": [], + "blockNumber": 8580250, + "cumulativeGasUsed": "209070", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "18c7b3fb984a9ee861b83d1058d152f0", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Stephen Chen\",\"kind\":\"dev\",\"methods\":{},\"title\":\"Bit Mask Library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getBit(mapping(uint256 => uint256) storage,uint256)\":{\"notice\":\"Get a bit in the bit mask\"},\"setBit(mapping(uint256 => uint256) storage,uint256,bool)\":{\"notice\":\"Set a bit in the bit mask\"}},\"notice\":\"Implements bit mask with dynamic array\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Bitmask.sol\":\"Bitmask\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Bitmask.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.0;\\n\\n/// @title Bit Mask Library\\n/// @author Stephen Chen\\n/// @notice Implements bit mask with dynamic array\\nlibrary Bitmask {\\n /// @notice Set a bit in the bit mask\\n function setBit(mapping(uint256 => uint256) storage bitmask, uint256 _bit, bool _value) public {\\n // calculate the number of bits has been store in bitmask now\\n uint256 positionOfMask = uint256(_bit / 256);\\n uint256 positionOfBit = _bit % 256;\\n\\n if (_value) {\\n bitmask[positionOfMask] = bitmask[positionOfMask] | (1 << positionOfBit);\\n } else {\\n bitmask[positionOfMask] = bitmask[positionOfMask] & ~(1 << positionOfBit);\\n }\\n }\\n\\n /// @notice Get a bit in the bit mask\\n function getBit(mapping(uint256 => uint256) storage bitmask, uint256 _bit) public view returns (bool) {\\n // calculate the number of bits has been store in bitmask now\\n uint256 positionOfMask = uint256(_bit / 256);\\n uint256 positionOfBit = _bit % 256;\\n\\n return ((bitmask[positionOfMask] & (1 << positionOfBit)) != 0);\\n }\\n}\\n\",\"keccak256\":\"0x606a3967f7444ce1dc07726e6c5cdcf48360000817c65b631e6ebd8fb96f6e1d\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x61020461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c806303fbaf73146100455780636449da101461006c575b600080fd5b610058610053366004610130565b61008e565b604051901515815260200160405180910390f35b81801561007857600080fd5b5061008c610087366004610152565b6100ce565b005b60008061009d610100846101a6565b905060006100ad610100856101ba565b6000928352602095909552506040902054600190931b909216151592915050565b60006100dc610100846101a6565b905060006100ec610100856101ba565b9050821561011057600082815260208690526040902080546001831b179055610129565b600082815260208690526040902080546001831b191690555b5050505050565b6000806040838503121561014357600080fd5b50508035926020909101359150565b60008060006060848603121561016757600080fd5b83359250602084013591506040840135801515811461018557600080fd5b809150509250925092565b634e487b7160e01b600052601260045260246000fd5b6000826101b5576101b5610190565b500490565b6000826101c9576101c9610190565b50069056fea26469706673582212205733658d60667e5a9dc993e1c9ccf5fec105a4cfb880312e0e59e783894e9f8664736f6c63430008140033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c806303fbaf73146100455780636449da101461006c575b600080fd5b610058610053366004610130565b61008e565b604051901515815260200160405180910390f35b81801561007857600080fd5b5061008c610087366004610152565b6100ce565b005b60008061009d610100846101a6565b905060006100ad610100856101ba565b6000928352602095909552506040902054600190931b909216151592915050565b60006100dc610100846101a6565b905060006100ec610100856101ba565b9050821561011057600082815260208690526040902080546001831b179055610129565b600082815260208690526040902080546001831b191690555b5050505050565b6000806040838503121561014357600080fd5b50508035926020909101359150565b60008060006060848603121561016757600080fd5b83359250602084013591506040840135801515811461018557600080fd5b809150509250925092565b634e487b7160e01b600052601260045260246000fd5b6000826101b5576101b5610190565b500490565b6000826101c9576101c9610190565b50069056fea26469706673582212205733658d60667e5a9dc993e1c9ccf5fec105a4cfb880312e0e59e783894e9f8664736f6c63430008140033", + "devdoc": { + "author": "Stephen Chen", + "kind": "dev", + "methods": {}, + "title": "Bit Mask Library", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "getBit(mapping(uint256 => uint256) storage,uint256)": { + "notice": "Get a bit in the bit mask" + }, + "setBit(mapping(uint256 => uint256) storage,uint256,bool)": { + "notice": "Set a bit in the bit mask" + } + }, + "notice": "Implements bit mask with dynamic array", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base_sepolia/CartesiMathV2.json b/packages/contracts/deployments/base_sepolia/CartesiMathV2.json new file mode 100644 index 0000000..4ab204f --- /dev/null +++ b/packages/contracts/deployments/base_sepolia/CartesiMathV2.json @@ -0,0 +1,219 @@ +{ + "address": "0xB634F716BEd5Dd5A2b9a91C92474C499e50Cb27D", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "clz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "ctz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2Floor", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2TableTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "isPowerOf2", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "log2ApproxTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0xdc16fa4364111a986cfc027a40814dd99216fc0477d39463a8fdedb5d40f0c63", + "receipt": { + "to": "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7", + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": null, + "transactionIndex": 10, + "gasUsed": "490151", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe5d32286e651e929dd702f49ef7c77050f6286dcb28803438c19c78b0758997f", + "transactionHash": "0xdc16fa4364111a986cfc027a40814dd99216fc0477d39463a8fdedb5d40f0c63", + "logs": [], + "blockNumber": 8580255, + "cumulativeGasUsed": "2041968", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "18c7b3fb984a9ee861b83d1058d152f0", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"clz\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"ctz\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"getLog2Floor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"getLog2TableTimes1M\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"isPowerOf2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_num\",\"type\":\"uint256\"}],\"name\":\"log2ApproxTimes1M\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"clz(uint256)\":{\"details\":\"this a binary search implementation\",\"params\":{\"_num\":\"number you want the clz of\"}},\"ctz(uint256)\":{\"details\":\"this a binary search implementation\",\"params\":{\"_num\":\"number you want the ctz of\"}},\"getLog2Floor(uint256)\":{\"params\":{\"_num\":\"number to take floor(log2) of\"},\"returns\":{\"_0\":\"floor(log2) of _num\"}},\"getLog2TableTimes1M(uint256)\":{\"params\":{\"_num\":\"number to take log2 of\"},\"returns\":{\"_0\":\"result after table look-up\"}},\"isPowerOf2(uint256)\":{\"params\":{\"_num\":\"number to check\"},\"returns\":{\"_0\":\"true if number is power of 2, false if not\"}},\"log2ApproxTimes1M(uint256)\":{\"params\":{\"_num\":\"number to take log2 * 1M of\"},\"returns\":{\"_0\":\"approximate log2 times 1M\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"clz(uint256)\":{\"notice\":\"count leading zeros\"},\"ctz(uint256)\":{\"notice\":\"count trailing zeros\"},\"getLog2Floor(uint256)\":{\"notice\":\"get floor of log2 of number\"},\"getLog2TableTimes1M(uint256)\":{\"notice\":\"navigates log2tableTimes1M\"},\"isPowerOf2(uint256)\":{\"notice\":\"checks if a number is Power of 2\"},\"log2ApproxTimes1M(uint256)\":{\"notice\":\"Approximates log2 * 1M\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CartesiMathV2.sol\":\"CartesiMathV2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/CartesiMathV2.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title CartesiMath\\n/// @author Felipe Argento\\npragma solidity ^0.8.0;\\n\\nlibrary CartesiMathV2 {\\n // mapping values are packed as bytes3 each\\n // see test/TestCartesiMath.ts for decimal values\\n bytes constant log2tableTimes1M =\\n hex\\\"0000000F4240182F421E8480236E082771822AD63A2DC6C0305E8532B04834C96736B3C23876D73A187A3B9D4A3D09003E5EA63FA0C540D17741F28843057D440BA745062945F60246DC1047B917488DC7495ABA4A207C4ADF8A4B98544C4B404CF8AA4DA0E64E44434EE3054F7D6D5013B750A61A5134C851BFF05247BD52CC58534DE753CC8D54486954C19C55384255AC75561E50568DE956FB575766B057D00758376F589CFA5900BA5962BC59C3135A21CA5A7EF15ADA945B34BF5B8D805BE4DF5C3AEA5C8FA95CE3265D356C5D86835DD6735E25455E73005EBFAD5F0B525F55F75F9FA25FE85A60302460770860BD0A61023061467F6189FD61CCAE620E98624FBF62902762CFD5630ECD634D12638AA963C7966403DC643F7F647A8264B4E864EEB56527EC6560906598A365D029660724663D9766738566A8F066DDDA6712476746386779AF67ACAF67DF3A6811526842FA68743268A4FC68D55C6905536934E169640A6992CF69C13169EF326A1CD46A4A186A76FF6AA38C6ACFC0\\\";\\n\\n /// @notice Approximates log2 * 1M\\n /// @param _num number to take log2 * 1M of\\n /// @return approximate log2 times 1M\\n function log2ApproxTimes1M(uint256 _num) public pure returns (uint256) {\\n require(_num > 0, \\\"Number cannot be zero\\\");\\n uint256 leading = 0;\\n\\n if (_num == 1) return 0;\\n\\n while (_num > 128) {\\n _num = _num >> 1;\\n leading += 1;\\n }\\n return (leading * uint256(1000000)) + (getLog2TableTimes1M(_num));\\n }\\n\\n /// @notice navigates log2tableTimes1M\\n /// @param _num number to take log2 of\\n /// @return result after table look-up\\n function getLog2TableTimes1M(uint256 _num) public pure returns (uint256) {\\n bytes3 result = 0;\\n for (uint8 i = 0; i < 3; i++) {\\n bytes3 tempResult = log2tableTimes1M[(_num - 1) * 3 + i];\\n result = result | (tempResult >> (i * 8));\\n }\\n\\n return uint256(uint24(result));\\n }\\n\\n /// @notice get floor of log2 of number\\n /// @param _num number to take floor(log2) of\\n /// @return floor(log2) of _num\\n function getLog2Floor(uint256 _num) public pure returns (uint8) {\\n require(_num != 0, \\\"log of zero is undefined\\\");\\n\\n return uint8(255 - clz(_num));\\n }\\n\\n /// @notice checks if a number is Power of 2\\n /// @param _num number to check\\n /// @return true if number is power of 2, false if not\\n function isPowerOf2(uint256 _num) public pure returns (bool) {\\n if (_num == 0) return false;\\n\\n return _num & (_num - 1) == 0;\\n }\\n\\n /// @notice count trailing zeros\\n /// @param _num number you want the ctz of\\n /// @dev this a binary search implementation\\n function ctz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) {\\n n = n + 128;\\n _num = _num >> 128;\\n }\\n if (_num & 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF == 0) {\\n n = n + 64;\\n _num = _num >> 64;\\n }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000FFFFFFFF == 0) {\\n n = n + 32;\\n _num = _num >> 32;\\n }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000FFFF == 0) {\\n n = n + 16;\\n _num = _num >> 16;\\n }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000000000FF == 0) {\\n n = n + 8;\\n _num = _num >> 8;\\n }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000000F == 0) {\\n n = n + 4;\\n _num = _num >> 4;\\n }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000003 == 0) {\\n n = n + 2;\\n _num = _num >> 2;\\n }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000001 == 0) {\\n n = n + 1;\\n }\\n\\n return n;\\n }\\n\\n /// @notice count leading zeros\\n /// @param _num number you want the clz of\\n /// @dev this a binary search implementation\\n function clz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 == 0) {\\n n = n + 128;\\n _num = _num << 128;\\n }\\n if (_num & 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 64;\\n _num = _num << 64;\\n }\\n if (_num & 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 32;\\n _num = _num << 32;\\n }\\n if (_num & 0xFFFF000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 16;\\n _num = _num << 16;\\n }\\n if (_num & 0xFF00000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 8;\\n _num = _num << 8;\\n }\\n if (_num & 0xF000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 4;\\n _num = _num << 4;\\n }\\n if (_num & 0xC000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 2;\\n _num = _num << 2;\\n }\\n if (_num & 0x8000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 1;\\n }\\n\\n return n;\\n }\\n}\\n\",\"keccak256\":\"0x98fb8d20c05b7c39c44171b6c524cf023da646749eb90157463538da8b2e13d3\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x6107e261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806306c8e54b14610071578063296e7af81461009b57806330244f7a146100bc57806332ef283b146100cf578063d82ae4b1146100e2578063e3581b6814610105575b600080fd5b61008461007f366004610568565b610118565b60405160ff90911681526020015b60405180910390f35b6100ae6100a9366004610568565b610189565b604051908152602001610092565b6100ae6100ca366004610568565b6102b5565b6100ae6100dd366004610568565b6103f5565b6100f56100f0366004610568565b6104a6565b6040519015158152602001610092565b6100ae610113366004610568565b6104cc565b60008160000361016f5760405162461bcd60e51b815260206004820152601860248201527f6c6f67206f66207a65726f20697320756e646566696e6564000000000000000060448201526064015b60405180910390fd5b610178826102b5565b6101839060ff610597565b92915050565b60008160000361019c5750610100919050565b6000826fffffffffffffffffffffffffffffffff166000036101cd576101c38160806105aa565b9050608083901c92505b8267ffffffffffffffff166000036101f4576101ea8160406105aa565b9050604083901c92505b8263ffffffff166000036102175761020d8160206105aa565b9050602083901c92505b8261ffff166000036102385761022e8160106105aa565b9050601083901c92505b8260ff166000036102585761024e8160086105aa565b9050600883901c92505b82600f166000036102785761026e8160046105aa565b9050600483901c92505b826003166000036102985761028e8160026105aa565b9050600283901c92505b82600116600003610183576102ae8160016105aa565b9392505050565b6000816000036102c85750610100919050565b6000826fffffffffffffffffffffffffffffffff19166000036102fa576102f08160806105aa565b9050608083901b92505b826001600160c01b031916600003610321576103178160406105aa565b9050604083901b92505b826001600160e01b0319166000036103485761033e8160206105aa565b9050602083901b92505b826001600160f01b03191660000361036f576103658160106105aa565b9050601083901b92505b826001600160f81b0319166000036103965761038c8160086105aa565b9050600883901b92505b82600f60fc1b166000036103b9576103af8160046105aa565b9050600483901b92505b82600360fe1b166000036103dc576103d28160026105aa565b9050600283901b92505b82600160ff1b16600003610183576102ae8160016105aa565b600080805b60038160ff16101561049c576000604051806101a00160405280610180815260200161062d610180913960ff8316610433600188610597565b61043e9060036105bd565b61044891906105aa565b81518110610458576104586105d4565b01602001516001600160f81b03191690506104748260086105ea565b60ff16816001600160e81b031916901c831792505080806104949061060d565b9150506103fa565b5060e81c92915050565b6000816000036104b857506000919050565b6104c3600183610597565b90911615919050565b60008082116105155760405162461bcd60e51b81526020600482015260156024820152744e756d6265722063616e6e6f74206265207a65726f60581b6044820152606401610166565b6000826001036105285750600092915050565b608083111561054857600192831c9261054190826105aa565b9050610528565b610551836103f5565b61055e620f4240836105bd565b6102ae91906105aa565b60006020828403121561057a57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561018357610183610581565b8082018082111561018357610183610581565b808202811582820484141761018357610183610581565b634e487b7160e01b600052603260045260246000fd5b60ff818116838216029081169081811461060657610606610581565b5092915050565b600060ff821660ff810361062357610623610581565b6001019291505056fe0000000f4240182f421e8480236e082771822ad63a2dc6c0305e8532b04834c96736b3c23876d73a187a3b9d4a3d09003e5ea63fa0c540d17741f28843057d440ba745062945f60246dc1047b917488dc7495aba4a207c4adf8a4b98544c4b404cf8aa4da0e64e44434ee3054f7d6d5013b750a61a5134c851bff05247bd52cc58534de753cc8d54486954c19c55384255ac75561e50568de956fb575766b057d00758376f589cfa5900ba5962bc59c3135a21ca5a7ef15ada945b34bf5b8d805be4df5c3aea5c8fa95ce3265d356c5d86835dd6735e25455e73005ebfad5f0b525f55f75f9fa25fe85a60302460770860bd0a61023061467f6189fd61ccae620e98624fbf62902762cfd5630ecd634d12638aa963c7966403dc643f7f647a8264b4e864eeb56527ec6560906598a365d029660724663d9766738566a8f066ddda6712476746386779af67acaf67df3a6811526842fa68743268a4fc68d55c6905536934e169640a6992cf69c13169ef326a1cd46a4a186a76ff6aa38c6acfc0a26469706673582212201ecec337bf7d70d1c6fbf67bfe6ec479ae3ee824b29f7aae05f18fc4ddc31cfd64736f6c63430008140033", + "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806306c8e54b14610071578063296e7af81461009b57806330244f7a146100bc57806332ef283b146100cf578063d82ae4b1146100e2578063e3581b6814610105575b600080fd5b61008461007f366004610568565b610118565b60405160ff90911681526020015b60405180910390f35b6100ae6100a9366004610568565b610189565b604051908152602001610092565b6100ae6100ca366004610568565b6102b5565b6100ae6100dd366004610568565b6103f5565b6100f56100f0366004610568565b6104a6565b6040519015158152602001610092565b6100ae610113366004610568565b6104cc565b60008160000361016f5760405162461bcd60e51b815260206004820152601860248201527f6c6f67206f66207a65726f20697320756e646566696e6564000000000000000060448201526064015b60405180910390fd5b610178826102b5565b6101839060ff610597565b92915050565b60008160000361019c5750610100919050565b6000826fffffffffffffffffffffffffffffffff166000036101cd576101c38160806105aa565b9050608083901c92505b8267ffffffffffffffff166000036101f4576101ea8160406105aa565b9050604083901c92505b8263ffffffff166000036102175761020d8160206105aa565b9050602083901c92505b8261ffff166000036102385761022e8160106105aa565b9050601083901c92505b8260ff166000036102585761024e8160086105aa565b9050600883901c92505b82600f166000036102785761026e8160046105aa565b9050600483901c92505b826003166000036102985761028e8160026105aa565b9050600283901c92505b82600116600003610183576102ae8160016105aa565b9392505050565b6000816000036102c85750610100919050565b6000826fffffffffffffffffffffffffffffffff19166000036102fa576102f08160806105aa565b9050608083901b92505b826001600160c01b031916600003610321576103178160406105aa565b9050604083901b92505b826001600160e01b0319166000036103485761033e8160206105aa565b9050602083901b92505b826001600160f01b03191660000361036f576103658160106105aa565b9050601083901b92505b826001600160f81b0319166000036103965761038c8160086105aa565b9050600883901b92505b82600f60fc1b166000036103b9576103af8160046105aa565b9050600483901b92505b82600360fe1b166000036103dc576103d28160026105aa565b9050600283901b92505b82600160ff1b16600003610183576102ae8160016105aa565b600080805b60038160ff16101561049c576000604051806101a00160405280610180815260200161062d610180913960ff8316610433600188610597565b61043e9060036105bd565b61044891906105aa565b81518110610458576104586105d4565b01602001516001600160f81b03191690506104748260086105ea565b60ff16816001600160e81b031916901c831792505080806104949061060d565b9150506103fa565b5060e81c92915050565b6000816000036104b857506000919050565b6104c3600183610597565b90911615919050565b60008082116105155760405162461bcd60e51b81526020600482015260156024820152744e756d6265722063616e6e6f74206265207a65726f60581b6044820152606401610166565b6000826001036105285750600092915050565b608083111561054857600192831c9261054190826105aa565b9050610528565b610551836103f5565b61055e620f4240836105bd565b6102ae91906105aa565b60006020828403121561057a57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561018357610183610581565b8082018082111561018357610183610581565b808202811582820484141761018357610183610581565b634e487b7160e01b600052603260045260246000fd5b60ff818116838216029081169081811461060657610606610581565b5092915050565b600060ff821660ff810361062357610623610581565b6001019291505056fe0000000f4240182f421e8480236e082771822ad63a2dc6c0305e8532b04834c96736b3c23876d73a187a3b9d4a3d09003e5ea63fa0c540d17741f28843057d440ba745062945f60246dc1047b917488dc7495aba4a207c4adf8a4b98544c4b404cf8aa4da0e64e44434ee3054f7d6d5013b750a61a5134c851bff05247bd52cc58534de753cc8d54486954c19c55384255ac75561e50568de956fb575766b057d00758376f589cfa5900ba5962bc59c3135a21ca5a7ef15ada945b34bf5b8d805be4df5c3aea5c8fa95ce3265d356c5d86835dd6735e25455e73005ebfad5f0b525f55f75f9fa25fe85a60302460770860bd0a61023061467f6189fd61ccae620e98624fbf62902762cfd5630ecd634d12638aa963c7966403dc643f7f647a8264b4e864eeb56527ec6560906598a365d029660724663d9766738566a8f066ddda6712476746386779af67acaf67df3a6811526842fa68743268a4fc68d55c6905536934e169640a6992cf69c13169ef326a1cd46a4a186a76ff6aa38c6acfc0a26469706673582212201ecec337bf7d70d1c6fbf67bfe6ec479ae3ee824b29f7aae05f18fc4ddc31cfd64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": { + "clz(uint256)": { + "details": "this a binary search implementation", + "params": { + "_num": "number you want the clz of" + } + }, + "ctz(uint256)": { + "details": "this a binary search implementation", + "params": { + "_num": "number you want the ctz of" + } + }, + "getLog2Floor(uint256)": { + "params": { + "_num": "number to take floor(log2) of" + }, + "returns": { + "_0": "floor(log2) of _num" + } + }, + "getLog2TableTimes1M(uint256)": { + "params": { + "_num": "number to take log2 of" + }, + "returns": { + "_0": "result after table look-up" + } + }, + "isPowerOf2(uint256)": { + "params": { + "_num": "number to check" + }, + "returns": { + "_0": "true if number is power of 2, false if not" + } + }, + "log2ApproxTimes1M(uint256)": { + "params": { + "_num": "number to take log2 * 1M of" + }, + "returns": { + "_0": "approximate log2 times 1M" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "clz(uint256)": { + "notice": "count leading zeros" + }, + "ctz(uint256)": { + "notice": "count trailing zeros" + }, + "getLog2Floor(uint256)": { + "notice": "get floor of log2 of number" + }, + "getLog2TableTimes1M(uint256)": { + "notice": "navigates log2tableTimes1M" + }, + "isPowerOf2(uint256)": { + "notice": "checks if a number is Power of 2" + }, + "log2ApproxTimes1M(uint256)": { + "notice": "Approximates log2 * 1M" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base_sepolia/MerkleV2.json b/packages/contracts/deployments/base_sepolia/MerkleV2.json new file mode 100644 index 0000000..1a5dd14 --- /dev/null +++ b/packages/contracts/deployments/base_sepolia/MerkleV2.json @@ -0,0 +1,223 @@ +{ + "address": "0x33436035441927Df1a73FE3AAC5906854632e53d", + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "hashes", + "type": "bytes32[]" + } + ], + "name": "calculateRootFromPowerOfTwo", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getEmptyTreeHashAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_wordIndex", + "type": "uint256" + } + ], + "name": "getHashOfWordAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_log2Size", + "type": "uint256" + } + ], + "name": "getMerkleRootFromBytes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_position", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_logSizeOfReplacement", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_logSizeOfFullDrive", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_replacement", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "siblings", + "type": "bytes32[]" + } + ], + "name": "getRootAfterReplacementInDrive", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0x7f5461041872cafd0793db7f79f5ea56cc7a816023083c841a6bcf8a2d5303f8", + "receipt": { + "to": "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7", + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": null, + "transactionIndex": 7, + "gasUsed": "1267230", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfe724dfcbd7b15e424495ca9437f4e8a94cc7661d8850b852915d69b7c7cdc8a", + "transactionHash": "0x7f5461041872cafd0793db7f79f5ea56cc7a816023083c841a6bcf8a2d5303f8", + "logs": [], + "blockNumber": 8580260, + "cumulativeGasUsed": "2339459", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "18c7b3fb984a9ee861b83d1058d152f0", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"hashes\",\"type\":\"bytes32[]\"}],\"name\":\"calculateRootFromPowerOfTwo\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"getEmptyTreeHashAtIndex\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_wordIndex\",\"type\":\"uint256\"}],\"name\":\"getHashOfWordAtIndex\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_log2Size\",\"type\":\"uint256\"}],\"name\":\"getMerkleRootFromBytes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_position\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_logSizeOfReplacement\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_logSizeOfFullDrive\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_replacement\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"name\":\"getRootAfterReplacementInDrive\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"calculateRootFromPowerOfTwo(bytes32[])\":{\"params\":{\"hashes\":\"The array containing power of 2 elements\"},\"returns\":{\"_0\":\"byte32 the root hash being calculated\"}},\"getEmptyTreeHashAtIndex(uint256)\":{\"details\":\"first index is keccak(0), second index is keccak(keccak(0), keccak(0))\",\"params\":{\"_index\":\"of hash wanted\"}},\"getHashOfWordAtIndex(bytes,uint256)\":{\"details\":\"if word is incomplete (< 8 bytes) it gets padded with zeroes\",\"params\":{\"_data\":\"array of bytes\",\"_wordIndex\":\"index of word inside the bytes to get the hash of\"}},\"getMerkleRootFromBytes(bytes,uint256)\":{\"details\":\"_data is padded with zeroes until is multiple of 8root is completed with zero tree until log2size is completehashes are taken word by word (8 bytes by 8 bytes)\",\"params\":{\"_data\":\"array of bytes to be merklelized\",\"_log2Size\":\"log2 of total size of the drive\"}},\"getRootAfterReplacementInDrive(uint256,uint256,uint256,bytes32,bytes32[])\":{\"params\":{\"_logSizeOfFullDrive\":\"log2 of size the full drive, which can be the entire machine\",\"_logSizeOfReplacement\":\"log2 of size the replacement\",\"_position\":\"position of _drive\",\"_replacement\":\"hash of the replacement\",\"siblings\":\"of replacement that merkle root can be calculated\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"calculateRootFromPowerOfTwo(bytes32[])\":{\"notice\":\"Calculate the root of Merkle tree from an array of power of 2 elements\"},\"getEmptyTreeHashAtIndex(uint256)\":{\"notice\":\"Gets precomputed hash of zero in empty tree hashes\"},\"getHashOfWordAtIndex(bytes,uint256)\":{\"notice\":\"Get the hash of a word in an array of bytes\"},\"getMerkleRootFromBytes(bytes,uint256)\":{\"notice\":\"get merkle root of generic array of bytes\"},\"getRootAfterReplacementInDrive(uint256,uint256,uint256,bytes32,bytes32[])\":{\"notice\":\"Gets merkle root hash of drive with a replacement\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/MerkleV2.sol\":\"MerkleV2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/CartesiMathV2.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title CartesiMath\\n/// @author Felipe Argento\\npragma solidity ^0.8.0;\\n\\nlibrary CartesiMathV2 {\\n // mapping values are packed as bytes3 each\\n // see test/TestCartesiMath.ts for decimal values\\n bytes constant log2tableTimes1M =\\n hex\\\"0000000F4240182F421E8480236E082771822AD63A2DC6C0305E8532B04834C96736B3C23876D73A187A3B9D4A3D09003E5EA63FA0C540D17741F28843057D440BA745062945F60246DC1047B917488DC7495ABA4A207C4ADF8A4B98544C4B404CF8AA4DA0E64E44434EE3054F7D6D5013B750A61A5134C851BFF05247BD52CC58534DE753CC8D54486954C19C55384255AC75561E50568DE956FB575766B057D00758376F589CFA5900BA5962BC59C3135A21CA5A7EF15ADA945B34BF5B8D805BE4DF5C3AEA5C8FA95CE3265D356C5D86835DD6735E25455E73005EBFAD5F0B525F55F75F9FA25FE85A60302460770860BD0A61023061467F6189FD61CCAE620E98624FBF62902762CFD5630ECD634D12638AA963C7966403DC643F7F647A8264B4E864EEB56527EC6560906598A365D029660724663D9766738566A8F066DDDA6712476746386779AF67ACAF67DF3A6811526842FA68743268A4FC68D55C6905536934E169640A6992CF69C13169EF326A1CD46A4A186A76FF6AA38C6ACFC0\\\";\\n\\n /// @notice Approximates log2 * 1M\\n /// @param _num number to take log2 * 1M of\\n /// @return approximate log2 times 1M\\n function log2ApproxTimes1M(uint256 _num) public pure returns (uint256) {\\n require(_num > 0, \\\"Number cannot be zero\\\");\\n uint256 leading = 0;\\n\\n if (_num == 1) return 0;\\n\\n while (_num > 128) {\\n _num = _num >> 1;\\n leading += 1;\\n }\\n return (leading * uint256(1000000)) + (getLog2TableTimes1M(_num));\\n }\\n\\n /// @notice navigates log2tableTimes1M\\n /// @param _num number to take log2 of\\n /// @return result after table look-up\\n function getLog2TableTimes1M(uint256 _num) public pure returns (uint256) {\\n bytes3 result = 0;\\n for (uint8 i = 0; i < 3; i++) {\\n bytes3 tempResult = log2tableTimes1M[(_num - 1) * 3 + i];\\n result = result | (tempResult >> (i * 8));\\n }\\n\\n return uint256(uint24(result));\\n }\\n\\n /// @notice get floor of log2 of number\\n /// @param _num number to take floor(log2) of\\n /// @return floor(log2) of _num\\n function getLog2Floor(uint256 _num) public pure returns (uint8) {\\n require(_num != 0, \\\"log of zero is undefined\\\");\\n\\n return uint8(255 - clz(_num));\\n }\\n\\n /// @notice checks if a number is Power of 2\\n /// @param _num number to check\\n /// @return true if number is power of 2, false if not\\n function isPowerOf2(uint256 _num) public pure returns (bool) {\\n if (_num == 0) return false;\\n\\n return _num & (_num - 1) == 0;\\n }\\n\\n /// @notice count trailing zeros\\n /// @param _num number you want the ctz of\\n /// @dev this a binary search implementation\\n function ctz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) {\\n n = n + 128;\\n _num = _num >> 128;\\n }\\n if (_num & 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF == 0) {\\n n = n + 64;\\n _num = _num >> 64;\\n }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000FFFFFFFF == 0) {\\n n = n + 32;\\n _num = _num >> 32;\\n }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000FFFF == 0) {\\n n = n + 16;\\n _num = _num >> 16;\\n }\\n if (_num & 0x00000000000000000000000000000000000000000000000000000000000000FF == 0) {\\n n = n + 8;\\n _num = _num >> 8;\\n }\\n if (_num & 0x000000000000000000000000000000000000000000000000000000000000000F == 0) {\\n n = n + 4;\\n _num = _num >> 4;\\n }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000003 == 0) {\\n n = n + 2;\\n _num = _num >> 2;\\n }\\n if (_num & 0x0000000000000000000000000000000000000000000000000000000000000001 == 0) {\\n n = n + 1;\\n }\\n\\n return n;\\n }\\n\\n /// @notice count leading zeros\\n /// @param _num number you want the clz of\\n /// @dev this a binary search implementation\\n function clz(uint256 _num) public pure returns (uint256) {\\n if (_num == 0) return 256;\\n\\n uint256 n = 0;\\n if (_num & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 == 0) {\\n n = n + 128;\\n _num = _num << 128;\\n }\\n if (_num & 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 64;\\n _num = _num << 64;\\n }\\n if (_num & 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 32;\\n _num = _num << 32;\\n }\\n if (_num & 0xFFFF000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 16;\\n _num = _num << 16;\\n }\\n if (_num & 0xFF00000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 8;\\n _num = _num << 8;\\n }\\n if (_num & 0xF000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 4;\\n _num = _num << 4;\\n }\\n if (_num & 0xC000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 2;\\n _num = _num << 2;\\n }\\n if (_num & 0x8000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 1;\\n }\\n\\n return n;\\n }\\n}\\n\",\"keccak256\":\"0x98fb8d20c05b7c39c44171b6c524cf023da646749eb90157463538da8b2e13d3\",\"license\":\"Apache-2.0\"},\"contracts/MerkleV2.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Library for Merkle proofs\\npragma solidity ^0.8.0;\\n\\nimport \\\"./CartesiMathV2.sol\\\";\\n\\nlibrary MerkleV2 {\\n using CartesiMathV2 for uint256;\\n\\n uint128 constant L_WORD_SIZE = 3; // word = 8 bytes, log = 3\\n // number of hashes in EMPTY_TREE_HASHES\\n uint128 constant EMPTY_TREE_SIZE = 1952; // 61*32=1952. 32 bytes per 61 indexes (64 words)\\n\\n // merkle root hashes of trees of zero concatenated\\n // 32 bytes for each root, first one is keccak(0), second one is\\n // keccak(keccack(0), keccak(0)) and so on\\n\\n bytes constant EMPTY_TREE_HASHES =\\n hex\\\"011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce4d9470a821fbe90117ec357e30bad9305732fb19ddf54a07dd3e29f440619254ae39ce8537aca75e2eff3e38c98011dfe934e700a0967732fc07b430dd656a233fc9a15f5b4869c872f81087bb6104b7d63e6f9ab47f2c43f3535eae7172aa7f17d2dd614cddaa4d879276b11e0672c9560033d3e8453a1d045339d34ba601b9c37b8b13ca95166fb7af16988a70fcc90f38bf9126fd833da710a47fb37a55e68e7a427fa943d9966b389f4f257173676090c6e95f43e2cb6d65f8758111e30930b0b9deb73e155c59740bacf14a6ff04b64bb8e201a506409c3fe381ca4ea90cd5deac729d0fdaccc441d09d7325f41586ba13c801b7eccae0f95d8f3933efed8b96e5b7f6f459e9cb6a2f41bf276c7b85c10cd4662c04cbbb365434726c0a0c9695393027fb106a8153109ac516288a88b28a93817899460d6310b71cf1e6163e8806fa0d4b197a259e8c3ac28864268159d0ac85f8581ca28fa7d2c0c03eb91e3eee5ca7a3da2b3053c9770db73599fb149f620e3facef95e947c0ee860b72122e31e4bbd2b7c783d79cc30f60c6238651da7f0726f767d22747264fdb046f7549f26cc70ed5e18baeb6c81bb0625cb95bb4019aeecd40774ee87ae29ec517a71f6ee264c5d761379b3d7d617ca83677374b49d10aec50505ac087408ca892b573c267a712a52e1d06421fe276a03efb1889f337201110fdc32a81f8e152499af665835aabfdc6740c7e2c3791a31c3cdc9f5ab962f681b12fc092816a62f27d86025599a41233848702f0cfc0437b445682df51147a632a0a083d2d38b5e13e466a8935afff58bb533b3ef5d27fba63ee6b0fd9e67ff20af9d50deee3f8bf065ec220c1fd4ba57e341261d55997f85d66d32152526736872693d2b437a233e2337b715f6ac9a6a272622fdc2d67fcfe1da3459f8dab4ed7e40a657a54c36766c5e8ac9a88b35b05c34747e6507f6b044ab66180dc76ac1a696de03189593fedc0d0dbbd855c8ead673544899b0960e4a5a7ca43b4ef90afe607de7698caefdc242788f654b57a4fb32a71b335ef6ff9a4cc118b282b53bdd6d6192b7a82c3c5126b9c7e33c8e5a5ac9738b8bd31247fb7402054f97b573e8abb9faad219f4fd085aceaa7f542d787ee4196d365f3cc566e7bbcfbfd451230c48d804c017d21e2d8fa914e2559bb72bf0ab78c8ab92f00ef0d0d576eccdd486b64138a4172674857e543d1d5b639058dd908186597e366ad5f3d9c7ceaff44d04d1550b8d33abc751df07437834ba5acb32328a396994aebb3c40f759c2d6d7a3cb5377e55d5d218ef5a296dda8ddc355f3f50c3d0b660a51dfa4d98a6a5a33564556cf83c1373a814641d6a1dcef97b883fee61bb84fe60a3409340217e629cc7e4dcc93b85d8820921ff5826148b60e6939acd7838e1d7f20562bff8ee4b5ec4a05ad997a57b9796fdcb2eda87883c2640b072b140b946bfdf6575cacc066fdae04f6951e63624cbd316a677cad529bbe4e97b9144e4bc06c4afd1de55dd3e1175f90423847a230d34dfb71ed56f2965a7f6c72e6aa33c24c303fd67745d632656c5ef90bec80f4f5d1daa251988826cef375c81c36bf457e09687056f924677cb0bccf98dff81e014ce25f2d132497923e267363963cdf4302c5049d63131dc03fd95f65d8b6aa5934f817252c028c90f56d413b9d5d10d89790707dae2fabb249f649929927c21dd71e3f656826de5451c5da375aadecbd59d5ebf3a31fae65ac1b316a1611f1b276b26530f58d7247df459ce1f86db1d734f6f811932f042cee45d0e455306d01081bc3384f82c5fb2aacaa19d89cdfa46cc916eac61121475ba2e6191b4feecbe1789717021a158ace5d06744b40f551076b67cd63af60007f8c99876e1424883a45ec49d497ddaf808a5521ca74a999ab0b3c7aa9c80f85e93977ec61ce68b20307a1a81f71ca645b568fcd319ccbb5f651e87b707d37c39e15f945ea69e2f7c7d2ccc85b7e654c07e96f0636ae4044fe0e38590b431795ad0f8647bdd613713ada493cc17efd313206380e6a685b8198475bbd021c6e9d94daab2214947127506073e44d5408ba166c512a0b86805d07f5a44d3c41706be2bc15e712e55805248b92e8677d90f6d284d1d6ffaff2c430657042a0e82624fa3717b06cc0a6fd12230ea586dae83019fb9e06034ed2803c98d554b93c9a52348cafff75c40174a91f9ae6b8647854a156029f0b88b83316663ce574a4978277bb6bb27a31085634b6ec78864b6d8201c7e93903d75815067e378289a3d072ae172dafa6a452470f8d645bebfad9779594fc0784bb764a22e3a8181d93db7bf97893c414217a618ccb14caa9e92e8c61673afc9583662e812adba1f87a9c68202d60e909efab43c42c0cb00695fc7f1ffe67c75ca894c3c51e1e5e731360199e600f6ced9a87b2a6a87e70bf251bb5075ab222138288164b2eda727515ea7de12e2496d4fe42ea8d1a120c03cf9c50622c2afe4acb0dad98fd62d07ab4e828a94495f6d1ab973982c7ccbe6c1fae02788e4422ae22282fa49cbdb04ba54a7a238c6fc41187451383460762c06d1c8a72b9cd718866ad4b689e10c9a8c38fe5ef045bd785b01e980fc82c7e3532ce81876b778dd9f1ceeba4478e86411fb6fdd790683916ca832592485093644e8760cd7b4c01dba1ccc82b661bf13f0e3f34acd6b88\\\";\\n\\n /// @notice Gets merkle root hash of drive with a replacement\\n /// @param _position position of _drive\\n /// @param _logSizeOfReplacement log2 of size the replacement\\n /// @param _logSizeOfFullDrive log2 of size the full drive, which can be the entire machine\\n /// @param _replacement hash of the replacement\\n /// @param siblings of replacement that merkle root can be calculated\\n function getRootAfterReplacementInDrive(\\n uint256 _position,\\n uint256 _logSizeOfReplacement,\\n uint256 _logSizeOfFullDrive,\\n bytes32 _replacement,\\n bytes32[] calldata siblings\\n ) public pure returns (bytes32) {\\n require(\\n _logSizeOfFullDrive >= _logSizeOfReplacement && _logSizeOfReplacement >= 3 && _logSizeOfFullDrive <= 64,\\n \\\"3 <= logSizeOfReplacement <= logSizeOfFullDrive <= 64\\\"\\n );\\n\\n uint256 size = 1 << _logSizeOfReplacement;\\n\\n require(((size - 1) & _position) == 0, \\\"Position is not aligned\\\");\\n require(siblings.length == _logSizeOfFullDrive - _logSizeOfReplacement, \\\"Proof length does not match\\\");\\n\\n for (uint256 i; i < siblings.length; i++) {\\n if ((_position & (size << i)) == 0) {\\n _replacement = keccak256(abi.encodePacked(_replacement, siblings[i]));\\n } else {\\n _replacement = keccak256(abi.encodePacked(siblings[i], _replacement));\\n }\\n }\\n\\n return _replacement;\\n }\\n\\n /// @notice Gets precomputed hash of zero in empty tree hashes\\n /// @param _index of hash wanted\\n /// @dev first index is keccak(0), second index is keccak(keccak(0), keccak(0))\\n function getEmptyTreeHashAtIndex(uint256 _index) public pure returns (bytes32) {\\n uint256 start = _index * 32;\\n require(EMPTY_TREE_SIZE >= start + 32, \\\"index out of bounds\\\");\\n bytes32 hashedZeros;\\n bytes memory zeroTree = EMPTY_TREE_HASHES;\\n\\n // first word is length, then skip index words\\n assembly {\\n hashedZeros := mload(add(add(zeroTree, 0x20), start))\\n }\\n return hashedZeros;\\n }\\n\\n /// @notice get merkle root of generic array of bytes\\n /// @param _data array of bytes to be merklelized\\n /// @param _log2Size log2 of total size of the drive\\n /// @dev _data is padded with zeroes until is multiple of 8\\n /// @dev root is completed with zero tree until log2size is complete\\n /// @dev hashes are taken word by word (8 bytes by 8 bytes)\\n function getMerkleRootFromBytes(bytes calldata _data, uint256 _log2Size) public pure returns (bytes32) {\\n require(_log2Size >= 3 && _log2Size <= 64, \\\"range of log2Size: [3,64]\\\");\\n\\n // if _data is empty return pristine drive of size log2size\\n if (_data.length == 0) return getEmptyTreeHashAtIndex(_log2Size - 3);\\n\\n // total size of the drive in words\\n uint256 size = 1 << (_log2Size - 3);\\n require(size << L_WORD_SIZE >= _data.length, \\\"data is bigger than drive\\\");\\n // the stack depth is log2(_data.length / 8) + 2\\n uint256 stack_depth = 2 + ((_data.length) >> L_WORD_SIZE).getLog2Floor();\\n bytes32[] memory stack = new bytes32[](stack_depth);\\n\\n uint256 numOfHashes; // total number of hashes on stack (counting levels)\\n uint256 stackLength; // total length of stack\\n uint256 numOfJoins; // number of hashes of the same level on stack\\n uint256 topStackLevel; // hash level of the top of the stack\\n\\n while (numOfHashes < size) {\\n if ((numOfHashes << L_WORD_SIZE) < _data.length) {\\n // we still have words to hash\\n stack[stackLength] = getHashOfWordAtIndex(_data, numOfHashes);\\n numOfHashes++;\\n\\n numOfJoins = numOfHashes;\\n } else {\\n // since padding happens in hashOfWordAtIndex function\\n // we only need to complete the stack with pre-computed\\n // hash(0), hash(hash(0),hash(0)) and so on\\n topStackLevel = numOfHashes.ctz();\\n\\n stack[stackLength] = getEmptyTreeHashAtIndex(topStackLevel);\\n\\n //Empty Tree Hash summarizes many hashes\\n numOfHashes = numOfHashes + (1 << topStackLevel);\\n numOfJoins = numOfHashes >> topStackLevel;\\n }\\n\\n stackLength++;\\n\\n // while there are joins, hash top of stack together\\n while (numOfJoins & 1 == 0) {\\n bytes32 h2 = stack[stackLength - 1];\\n bytes32 h1 = stack[stackLength - 2];\\n\\n stack[stackLength - 2] = keccak256(abi.encodePacked(h1, h2));\\n stackLength = stackLength - 1; // remove hashes from stack\\n\\n numOfJoins = numOfJoins >> 1;\\n }\\n }\\n require(stackLength == 1, \\\"stack error\\\");\\n\\n return stack[0];\\n }\\n\\n /// @notice Get the hash of a word in an array of bytes\\n /// @param _data array of bytes\\n /// @param _wordIndex index of word inside the bytes to get the hash of\\n /// @dev if word is incomplete (< 8 bytes) it gets padded with zeroes\\n function getHashOfWordAtIndex(bytes calldata _data, uint256 _wordIndex) public pure returns (bytes32) {\\n uint256 start = _wordIndex << L_WORD_SIZE;\\n uint256 end = start + (1 << L_WORD_SIZE);\\n\\n // TODO: in .lua this just returns zero, but this might be more consistent\\n require(start <= _data.length, \\\"word out of bounds\\\");\\n\\n if (end <= _data.length) {\\n return keccak256(abi.encodePacked(_data[start:end]));\\n }\\n\\n // word is incomplete\\n // fill paddedSlice with incomplete words - the rest is going to be bytes(0)\\n bytes memory paddedSlice = new bytes(8);\\n uint256 remaining = _data.length - start;\\n\\n for (uint256 i; i < remaining; i++) {\\n paddedSlice[i] = _data[start + i];\\n }\\n\\n return keccak256(paddedSlice);\\n }\\n\\n /// @notice Calculate the root of Merkle tree from an array of power of 2 elements\\n /// @param hashes The array containing power of 2 elements\\n /// @return byte32 the root hash being calculated\\n function calculateRootFromPowerOfTwo(bytes32[] memory hashes) public pure returns (bytes32) {\\n // revert when the input is not of power of 2\\n require((hashes.length).isPowerOf2(), \\\"array len not power of 2\\\");\\n\\n if (hashes.length == 1) {\\n return hashes[0];\\n } else {\\n bytes32[] memory newHashes = new bytes32[](hashes.length >> 1);\\n\\n for (uint256 i; i < hashes.length; i += 2) {\\n newHashes[i >> 1] = keccak256(abi.encodePacked(hashes[i], hashes[i + 1]));\\n }\\n\\n return calculateRootFromPowerOfTwo(newHashes);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x73d86cb2dfa2ca887987c6da8d193d523c6a65ea89e296d1f47f190ebda7fa9b\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x6115e861003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c806334bd712d14610066578063451a10551461008b57806379de46011461009e57806382b0eab8146100b1578063c84583a1146100c4575b600080fd5b610079610074366004610ad9565b6100d7565b60405190815260200160405180910390f35b610079610099366004610b51565b610229565b6100796100ac366004610b6a565b6102ba565b6100796100bf366004610c1b565b6104d0565b6100796100d2366004610ad9565b6106cb565b6000600382901b816100ea600883610cef565b9050848211156101365760405162461bcd60e51b8152602060048201526012602482015271776f7264206f7574206f6620626f756e647360701b60448201526064015b60405180910390fd5b8481116101795761014981838789610d08565b60405160200161015a929190610d32565b6040516020818303038152906040528051906020012092505050610222565b60408051600880825281830190925260009160208201818036833701905050905060006101a68488610d42565b905060005b818110156102135788886101bf8388610cef565b8181106101ce576101ce610d55565b9050013560f81c60f81b8382815181106101ea576101ea610d55565b60200101906001600160f81b031916908160001a9053508061020b81610d6b565b9150506101ab565b50508051602090910120925050505b9392505050565b600080610237836020610d84565b9050610244816020610cef565b6107a0101561028b5760405162461bcd60e51b8152602060048201526013602482015272696e646578206f7574206f6620626f756e647360681b604482015260640161012d565b600080604051806107c001604052806107a08152602001610e136107a091399290920160200151949350505050565b60008585101580156102cd575060038610155b80156102da575060408511155b6103445760405162461bcd60e51b815260206004820152603560248201527f33203c3d206c6f6753697a654f665265706c6163656d656e74203c3d206c6f6760448201527414da5e9953d9919d5b1b111c9a5d99480f0f480d8d605a1b606482015260840161012d565b600180871b9088906103569083610d42565b16156103a45760405162461bcd60e51b815260206004820152601760248201527f506f736974696f6e206973206e6f7420616c69676e6564000000000000000000604482015260640161012d565b6103ae8787610d42565b83146103fc5760405162461bcd60e51b815260206004820152601b60248201527f50726f6f66206c656e67746820646f6573206e6f74206d617463680000000000604482015260640161012d565b60005b838110156104c35781811b8916600003610464578585858381811061042657610426610d55565b90506020020135604051602001610447929190918252602082015260400190565b6040516020818303038152906040528051906020012095506104b1565b84848281811061047657610476610d55565b9050602002013586604051602001610498929190918252602082015260400190565b6040516020818303038152906040528051906020012095505b806104bb81610d6b565b9150506103ff565b5093979650505050505050565b805160405163d82ae4b160e01b815260009173B634F716BEd5Dd5A2b9a91C92474C499e50Cb27D9163d82ae4b19161050e9160040190815260200190565b602060405180830381865af415801561052b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054f9190610d9b565b61059b5760405162461bcd60e51b815260206004820152601860248201527f6172726179206c656e206e6f7420706f776572206f6620320000000000000000604482015260640161012d565b81516001036105c657816000815181106105b7576105b7610d55565b60200260200101519050919050565b600060018351901c67ffffffffffffffff8111156105e6576105e6610c05565b60405190808252806020026020018201604052801561060f578160200160208202803683370190505b50905060005b83518110156106c15783818151811061063057610630610d55565b6020026020010151848260016106469190610cef565b8151811061065657610656610d55565b6020026020010151604051602001610678929190918252602082015260400190565b6040516020818303038152906040528051906020012082600183901c815181106106a4576106a4610d55565b60209081029190910101526106ba600282610cef565b9050610615565b50610222816104d0565b6000600382101580156106df575060408211155b61072b5760405162461bcd60e51b815260206004820152601960248201527f72616e6765206f66206c6f673253697a653a205b332c36345d00000000000000604482015260640161012d565b600083900361074957610742610099600384610d42565b9050610222565b6000610756600384610d42565b6001901b9050600381901b8411156107b05760405162461bcd60e51b815260206004820152601960248201527f6461746120697320626967676572207468616e20647269766500000000000000604482015260640161012d565b6040516306c8e54b60e01b8152600385901c600482015260009073B634F716BEd5Dd5A2b9a91C92474C499e50Cb27D906306c8e54b90602401602060405180830381865af4158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a9190610dbd565b610835906002610de0565b60ff16905060008167ffffffffffffffff81111561085557610855610c05565b60405190808252806020026020018201604052801561087e578160200160208202803683370190505b5090506000806000805b86841015610a7057600384901b8a11156108d9576108a78b8b866100d7565b8584815181106108b9576108b9610d55565b6020908102919091010152836108ce81610d6b565b94505083915061098a565b60405163052dcf5f60e31b81526004810185905273B634F716BEd5Dd5A2b9a91C92474C499e50Cb27D9063296e7af890602401602060405180830381865af4158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190610df9565b905061095881610229565b85848151811061096a5761096a610d55565b60209081029190910101526109826001821b85610cef565b935083811c91505b8261099481610d6b565b9350505b81600116600003610a6b576000856109b1600186610d42565b815181106109c1576109c1610d55565b602002602001015190506000866002866109db9190610d42565b815181106109eb576109eb610d55565b602002602001015190508082604051602001610a11929190918252602082015260400190565b6040516020818303038152906040528051906020012087600287610a359190610d42565b81518110610a4557610a45610d55565b6020908102919091010152610a5b600186610d42565b9450600184901c93505050610998565b610888565b82600114610aae5760405162461bcd60e51b815260206004820152600b60248201526a39ba30b1b59032b93937b960a91b604482015260640161012d565b84600081518110610ac157610ac1610d55565b60200260200101519750505050505050509392505050565b600080600060408486031215610aee57600080fd5b833567ffffffffffffffff80821115610b0657600080fd5b818601915086601f830112610b1a57600080fd5b813581811115610b2957600080fd5b876020828501011115610b3b57600080fd5b6020928301989097509590910135949350505050565b600060208284031215610b6357600080fd5b5035919050565b60008060008060008060a08789031215610b8357600080fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff80821115610bb757600080fd5b818901915089601f830112610bcb57600080fd5b813581811115610bda57600080fd5b8a60208260051b8501011115610bef57600080fd5b6020830194508093505050509295509295509295565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610c2e57600080fd5b823567ffffffffffffffff80821115610c4657600080fd5b818501915085601f830112610c5a57600080fd5b813581811115610c6c57610c6c610c05565b8060051b604051601f19603f83011681018181108582111715610c9157610c91610c05565b604052918252848201925083810185019188831115610caf57600080fd5b938501935b82851015610ccd57843584529385019392850192610cb4565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610d0257610d02610cd9565b92915050565b60008085851115610d1857600080fd5b83861115610d2557600080fd5b5050820193919092039150565b8183823760009101908152919050565b81810381811115610d0257610d02610cd9565b634e487b7160e01b600052603260045260246000fd5b600060018201610d7d57610d7d610cd9565b5060010190565b8082028115828204841417610d0257610d02610cd9565b600060208284031215610dad57600080fd5b8151801515811461022257600080fd5b600060208284031215610dcf57600080fd5b815160ff8116811461022257600080fd5b60ff8181168382160190811115610d0257610d02610cd9565b600060208284031215610e0b57600080fd5b505191905056fe011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce4d9470a821fbe90117ec357e30bad9305732fb19ddf54a07dd3e29f440619254ae39ce8537aca75e2eff3e38c98011dfe934e700a0967732fc07b430dd656a233fc9a15f5b4869c872f81087bb6104b7d63e6f9ab47f2c43f3535eae7172aa7f17d2dd614cddaa4d879276b11e0672c9560033d3e8453a1d045339d34ba601b9c37b8b13ca95166fb7af16988a70fcc90f38bf9126fd833da710a47fb37a55e68e7a427fa943d9966b389f4f257173676090c6e95f43e2cb6d65f8758111e30930b0b9deb73e155c59740bacf14a6ff04b64bb8e201a506409c3fe381ca4ea90cd5deac729d0fdaccc441d09d7325f41586ba13c801b7eccae0f95d8f3933efed8b96e5b7f6f459e9cb6a2f41bf276c7b85c10cd4662c04cbbb365434726c0a0c9695393027fb106a8153109ac516288a88b28a93817899460d6310b71cf1e6163e8806fa0d4b197a259e8c3ac28864268159d0ac85f8581ca28fa7d2c0c03eb91e3eee5ca7a3da2b3053c9770db73599fb149f620e3facef95e947c0ee860b72122e31e4bbd2b7c783d79cc30f60c6238651da7f0726f767d22747264fdb046f7549f26cc70ed5e18baeb6c81bb0625cb95bb4019aeecd40774ee87ae29ec517a71f6ee264c5d761379b3d7d617ca83677374b49d10aec50505ac087408ca892b573c267a712a52e1d06421fe276a03efb1889f337201110fdc32a81f8e152499af665835aabfdc6740c7e2c3791a31c3cdc9f5ab962f681b12fc092816a62f27d86025599a41233848702f0cfc0437b445682df51147a632a0a083d2d38b5e13e466a8935afff58bb533b3ef5d27fba63ee6b0fd9e67ff20af9d50deee3f8bf065ec220c1fd4ba57e341261d55997f85d66d32152526736872693d2b437a233e2337b715f6ac9a6a272622fdc2d67fcfe1da3459f8dab4ed7e40a657a54c36766c5e8ac9a88b35b05c34747e6507f6b044ab66180dc76ac1a696de03189593fedc0d0dbbd855c8ead673544899b0960e4a5a7ca43b4ef90afe607de7698caefdc242788f654b57a4fb32a71b335ef6ff9a4cc118b282b53bdd6d6192b7a82c3c5126b9c7e33c8e5a5ac9738b8bd31247fb7402054f97b573e8abb9faad219f4fd085aceaa7f542d787ee4196d365f3cc566e7bbcfbfd451230c48d804c017d21e2d8fa914e2559bb72bf0ab78c8ab92f00ef0d0d576eccdd486b64138a4172674857e543d1d5b639058dd908186597e366ad5f3d9c7ceaff44d04d1550b8d33abc751df07437834ba5acb32328a396994aebb3c40f759c2d6d7a3cb5377e55d5d218ef5a296dda8ddc355f3f50c3d0b660a51dfa4d98a6a5a33564556cf83c1373a814641d6a1dcef97b883fee61bb84fe60a3409340217e629cc7e4dcc93b85d8820921ff5826148b60e6939acd7838e1d7f20562bff8ee4b5ec4a05ad997a57b9796fdcb2eda87883c2640b072b140b946bfdf6575cacc066fdae04f6951e63624cbd316a677cad529bbe4e97b9144e4bc06c4afd1de55dd3e1175f90423847a230d34dfb71ed56f2965a7f6c72e6aa33c24c303fd67745d632656c5ef90bec80f4f5d1daa251988826cef375c81c36bf457e09687056f924677cb0bccf98dff81e014ce25f2d132497923e267363963cdf4302c5049d63131dc03fd95f65d8b6aa5934f817252c028c90f56d413b9d5d10d89790707dae2fabb249f649929927c21dd71e3f656826de5451c5da375aadecbd59d5ebf3a31fae65ac1b316a1611f1b276b26530f58d7247df459ce1f86db1d734f6f811932f042cee45d0e455306d01081bc3384f82c5fb2aacaa19d89cdfa46cc916eac61121475ba2e6191b4feecbe1789717021a158ace5d06744b40f551076b67cd63af60007f8c99876e1424883a45ec49d497ddaf808a5521ca74a999ab0b3c7aa9c80f85e93977ec61ce68b20307a1a81f71ca645b568fcd319ccbb5f651e87b707d37c39e15f945ea69e2f7c7d2ccc85b7e654c07e96f0636ae4044fe0e38590b431795ad0f8647bdd613713ada493cc17efd313206380e6a685b8198475bbd021c6e9d94daab2214947127506073e44d5408ba166c512a0b86805d07f5a44d3c41706be2bc15e712e55805248b92e8677d90f6d284d1d6ffaff2c430657042a0e82624fa3717b06cc0a6fd12230ea586dae83019fb9e06034ed2803c98d554b93c9a52348cafff75c40174a91f9ae6b8647854a156029f0b88b83316663ce574a4978277bb6bb27a31085634b6ec78864b6d8201c7e93903d75815067e378289a3d072ae172dafa6a452470f8d645bebfad9779594fc0784bb764a22e3a8181d93db7bf97893c414217a618ccb14caa9e92e8c61673afc9583662e812adba1f87a9c68202d60e909efab43c42c0cb00695fc7f1ffe67c75ca894c3c51e1e5e731360199e600f6ced9a87b2a6a87e70bf251bb5075ab222138288164b2eda727515ea7de12e2496d4fe42ea8d1a120c03cf9c50622c2afe4acb0dad98fd62d07ab4e828a94495f6d1ab973982c7ccbe6c1fae02788e4422ae22282fa49cbdb04ba54a7a238c6fc41187451383460762c06d1c8a72b9cd718866ad4b689e10c9a8c38fe5ef045bd785b01e980fc82c7e3532ce81876b778dd9f1ceeba4478e86411fb6fdd790683916ca832592485093644e8760cd7b4c01dba1ccc82b661bf13f0e3f34acd6b88a2646970667358221220e20bef2e13cb0ad801148f5283a9b3a3e612170ed2d3e7e9ba5d171610f3d5e264736f6c63430008140033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c806334bd712d14610066578063451a10551461008b57806379de46011461009e57806382b0eab8146100b1578063c84583a1146100c4575b600080fd5b610079610074366004610ad9565b6100d7565b60405190815260200160405180910390f35b610079610099366004610b51565b610229565b6100796100ac366004610b6a565b6102ba565b6100796100bf366004610c1b565b6104d0565b6100796100d2366004610ad9565b6106cb565b6000600382901b816100ea600883610cef565b9050848211156101365760405162461bcd60e51b8152602060048201526012602482015271776f7264206f7574206f6620626f756e647360701b60448201526064015b60405180910390fd5b8481116101795761014981838789610d08565b60405160200161015a929190610d32565b6040516020818303038152906040528051906020012092505050610222565b60408051600880825281830190925260009160208201818036833701905050905060006101a68488610d42565b905060005b818110156102135788886101bf8388610cef565b8181106101ce576101ce610d55565b9050013560f81c60f81b8382815181106101ea576101ea610d55565b60200101906001600160f81b031916908160001a9053508061020b81610d6b565b9150506101ab565b50508051602090910120925050505b9392505050565b600080610237836020610d84565b9050610244816020610cef565b6107a0101561028b5760405162461bcd60e51b8152602060048201526013602482015272696e646578206f7574206f6620626f756e647360681b604482015260640161012d565b600080604051806107c001604052806107a08152602001610e136107a091399290920160200151949350505050565b60008585101580156102cd575060038610155b80156102da575060408511155b6103445760405162461bcd60e51b815260206004820152603560248201527f33203c3d206c6f6753697a654f665265706c6163656d656e74203c3d206c6f6760448201527414da5e9953d9919d5b1b111c9a5d99480f0f480d8d605a1b606482015260840161012d565b600180871b9088906103569083610d42565b16156103a45760405162461bcd60e51b815260206004820152601760248201527f506f736974696f6e206973206e6f7420616c69676e6564000000000000000000604482015260640161012d565b6103ae8787610d42565b83146103fc5760405162461bcd60e51b815260206004820152601b60248201527f50726f6f66206c656e67746820646f6573206e6f74206d617463680000000000604482015260640161012d565b60005b838110156104c35781811b8916600003610464578585858381811061042657610426610d55565b90506020020135604051602001610447929190918252602082015260400190565b6040516020818303038152906040528051906020012095506104b1565b84848281811061047657610476610d55565b9050602002013586604051602001610498929190918252602082015260400190565b6040516020818303038152906040528051906020012095505b806104bb81610d6b565b9150506103ff565b5093979650505050505050565b805160405163d82ae4b160e01b815260009173__$e74161300f6257ab2934e4b08c2b2efd56$__9163d82ae4b19161050e9160040190815260200190565b602060405180830381865af415801561052b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054f9190610d9b565b61059b5760405162461bcd60e51b815260206004820152601860248201527f6172726179206c656e206e6f7420706f776572206f6620320000000000000000604482015260640161012d565b81516001036105c657816000815181106105b7576105b7610d55565b60200260200101519050919050565b600060018351901c67ffffffffffffffff8111156105e6576105e6610c05565b60405190808252806020026020018201604052801561060f578160200160208202803683370190505b50905060005b83518110156106c15783818151811061063057610630610d55565b6020026020010151848260016106469190610cef565b8151811061065657610656610d55565b6020026020010151604051602001610678929190918252602082015260400190565b6040516020818303038152906040528051906020012082600183901c815181106106a4576106a4610d55565b60209081029190910101526106ba600282610cef565b9050610615565b50610222816104d0565b6000600382101580156106df575060408211155b61072b5760405162461bcd60e51b815260206004820152601960248201527f72616e6765206f66206c6f673253697a653a205b332c36345d00000000000000604482015260640161012d565b600083900361074957610742610099600384610d42565b9050610222565b6000610756600384610d42565b6001901b9050600381901b8411156107b05760405162461bcd60e51b815260206004820152601960248201527f6461746120697320626967676572207468616e20647269766500000000000000604482015260640161012d565b6040516306c8e54b60e01b8152600385901c600482015260009073__$e74161300f6257ab2934e4b08c2b2efd56$__906306c8e54b90602401602060405180830381865af4158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a9190610dbd565b610835906002610de0565b60ff16905060008167ffffffffffffffff81111561085557610855610c05565b60405190808252806020026020018201604052801561087e578160200160208202803683370190505b5090506000806000805b86841015610a7057600384901b8a11156108d9576108a78b8b866100d7565b8584815181106108b9576108b9610d55565b6020908102919091010152836108ce81610d6b565b94505083915061098a565b60405163052dcf5f60e31b81526004810185905273__$e74161300f6257ab2934e4b08c2b2efd56$__9063296e7af890602401602060405180830381865af4158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190610df9565b905061095881610229565b85848151811061096a5761096a610d55565b60209081029190910101526109826001821b85610cef565b935083811c91505b8261099481610d6b565b9350505b81600116600003610a6b576000856109b1600186610d42565b815181106109c1576109c1610d55565b602002602001015190506000866002866109db9190610d42565b815181106109eb576109eb610d55565b602002602001015190508082604051602001610a11929190918252602082015260400190565b6040516020818303038152906040528051906020012087600287610a359190610d42565b81518110610a4557610a45610d55565b6020908102919091010152610a5b600186610d42565b9450600184901c93505050610998565b610888565b82600114610aae5760405162461bcd60e51b815260206004820152600b60248201526a39ba30b1b59032b93937b960a91b604482015260640161012d565b84600081518110610ac157610ac1610d55565b60200260200101519750505050505050509392505050565b600080600060408486031215610aee57600080fd5b833567ffffffffffffffff80821115610b0657600080fd5b818601915086601f830112610b1a57600080fd5b813581811115610b2957600080fd5b876020828501011115610b3b57600080fd5b6020928301989097509590910135949350505050565b600060208284031215610b6357600080fd5b5035919050565b60008060008060008060a08789031215610b8357600080fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff80821115610bb757600080fd5b818901915089601f830112610bcb57600080fd5b813581811115610bda57600080fd5b8a60208260051b8501011115610bef57600080fd5b6020830194508093505050509295509295509295565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610c2e57600080fd5b823567ffffffffffffffff80821115610c4657600080fd5b818501915085601f830112610c5a57600080fd5b813581811115610c6c57610c6c610c05565b8060051b604051601f19603f83011681018181108582111715610c9157610c91610c05565b604052918252848201925083810185019188831115610caf57600080fd5b938501935b82851015610ccd57843584529385019392850192610cb4565b98975050505050505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610d0257610d02610cd9565b92915050565b60008085851115610d1857600080fd5b83861115610d2557600080fd5b5050820193919092039150565b8183823760009101908152919050565b81810381811115610d0257610d02610cd9565b634e487b7160e01b600052603260045260246000fd5b600060018201610d7d57610d7d610cd9565b5060010190565b8082028115828204841417610d0257610d02610cd9565b600060208284031215610dad57600080fd5b8151801515811461022257600080fd5b600060208284031215610dcf57600080fd5b815160ff8116811461022257600080fd5b60ff8181168382160190811115610d0257610d02610cd9565b600060208284031215610e0b57600080fd5b505191905056fe011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce4d9470a821fbe90117ec357e30bad9305732fb19ddf54a07dd3e29f440619254ae39ce8537aca75e2eff3e38c98011dfe934e700a0967732fc07b430dd656a233fc9a15f5b4869c872f81087bb6104b7d63e6f9ab47f2c43f3535eae7172aa7f17d2dd614cddaa4d879276b11e0672c9560033d3e8453a1d045339d34ba601b9c37b8b13ca95166fb7af16988a70fcc90f38bf9126fd833da710a47fb37a55e68e7a427fa943d9966b389f4f257173676090c6e95f43e2cb6d65f8758111e30930b0b9deb73e155c59740bacf14a6ff04b64bb8e201a506409c3fe381ca4ea90cd5deac729d0fdaccc441d09d7325f41586ba13c801b7eccae0f95d8f3933efed8b96e5b7f6f459e9cb6a2f41bf276c7b85c10cd4662c04cbbb365434726c0a0c9695393027fb106a8153109ac516288a88b28a93817899460d6310b71cf1e6163e8806fa0d4b197a259e8c3ac28864268159d0ac85f8581ca28fa7d2c0c03eb91e3eee5ca7a3da2b3053c9770db73599fb149f620e3facef95e947c0ee860b72122e31e4bbd2b7c783d79cc30f60c6238651da7f0726f767d22747264fdb046f7549f26cc70ed5e18baeb6c81bb0625cb95bb4019aeecd40774ee87ae29ec517a71f6ee264c5d761379b3d7d617ca83677374b49d10aec50505ac087408ca892b573c267a712a52e1d06421fe276a03efb1889f337201110fdc32a81f8e152499af665835aabfdc6740c7e2c3791a31c3cdc9f5ab962f681b12fc092816a62f27d86025599a41233848702f0cfc0437b445682df51147a632a0a083d2d38b5e13e466a8935afff58bb533b3ef5d27fba63ee6b0fd9e67ff20af9d50deee3f8bf065ec220c1fd4ba57e341261d55997f85d66d32152526736872693d2b437a233e2337b715f6ac9a6a272622fdc2d67fcfe1da3459f8dab4ed7e40a657a54c36766c5e8ac9a88b35b05c34747e6507f6b044ab66180dc76ac1a696de03189593fedc0d0dbbd855c8ead673544899b0960e4a5a7ca43b4ef90afe607de7698caefdc242788f654b57a4fb32a71b335ef6ff9a4cc118b282b53bdd6d6192b7a82c3c5126b9c7e33c8e5a5ac9738b8bd31247fb7402054f97b573e8abb9faad219f4fd085aceaa7f542d787ee4196d365f3cc566e7bbcfbfd451230c48d804c017d21e2d8fa914e2559bb72bf0ab78c8ab92f00ef0d0d576eccdd486b64138a4172674857e543d1d5b639058dd908186597e366ad5f3d9c7ceaff44d04d1550b8d33abc751df07437834ba5acb32328a396994aebb3c40f759c2d6d7a3cb5377e55d5d218ef5a296dda8ddc355f3f50c3d0b660a51dfa4d98a6a5a33564556cf83c1373a814641d6a1dcef97b883fee61bb84fe60a3409340217e629cc7e4dcc93b85d8820921ff5826148b60e6939acd7838e1d7f20562bff8ee4b5ec4a05ad997a57b9796fdcb2eda87883c2640b072b140b946bfdf6575cacc066fdae04f6951e63624cbd316a677cad529bbe4e97b9144e4bc06c4afd1de55dd3e1175f90423847a230d34dfb71ed56f2965a7f6c72e6aa33c24c303fd67745d632656c5ef90bec80f4f5d1daa251988826cef375c81c36bf457e09687056f924677cb0bccf98dff81e014ce25f2d132497923e267363963cdf4302c5049d63131dc03fd95f65d8b6aa5934f817252c028c90f56d413b9d5d10d89790707dae2fabb249f649929927c21dd71e3f656826de5451c5da375aadecbd59d5ebf3a31fae65ac1b316a1611f1b276b26530f58d7247df459ce1f86db1d734f6f811932f042cee45d0e455306d01081bc3384f82c5fb2aacaa19d89cdfa46cc916eac61121475ba2e6191b4feecbe1789717021a158ace5d06744b40f551076b67cd63af60007f8c99876e1424883a45ec49d497ddaf808a5521ca74a999ab0b3c7aa9c80f85e93977ec61ce68b20307a1a81f71ca645b568fcd319ccbb5f651e87b707d37c39e15f945ea69e2f7c7d2ccc85b7e654c07e96f0636ae4044fe0e38590b431795ad0f8647bdd613713ada493cc17efd313206380e6a685b8198475bbd021c6e9d94daab2214947127506073e44d5408ba166c512a0b86805d07f5a44d3c41706be2bc15e712e55805248b92e8677d90f6d284d1d6ffaff2c430657042a0e82624fa3717b06cc0a6fd12230ea586dae83019fb9e06034ed2803c98d554b93c9a52348cafff75c40174a91f9ae6b8647854a156029f0b88b83316663ce574a4978277bb6bb27a31085634b6ec78864b6d8201c7e93903d75815067e378289a3d072ae172dafa6a452470f8d645bebfad9779594fc0784bb764a22e3a8181d93db7bf97893c414217a618ccb14caa9e92e8c61673afc9583662e812adba1f87a9c68202d60e909efab43c42c0cb00695fc7f1ffe67c75ca894c3c51e1e5e731360199e600f6ced9a87b2a6a87e70bf251bb5075ab222138288164b2eda727515ea7de12e2496d4fe42ea8d1a120c03cf9c50622c2afe4acb0dad98fd62d07ab4e828a94495f6d1ab973982c7ccbe6c1fae02788e4422ae22282fa49cbdb04ba54a7a238c6fc41187451383460762c06d1c8a72b9cd718866ad4b689e10c9a8c38fe5ef045bd785b01e980fc82c7e3532ce81876b778dd9f1ceeba4478e86411fb6fdd790683916ca832592485093644e8760cd7b4c01dba1ccc82b661bf13f0e3f34acd6b88a2646970667358221220e20bef2e13cb0ad801148f5283a9b3a3e612170ed2d3e7e9ba5d171610f3d5e264736f6c63430008140033", + "libraries": { + "CartesiMathV2": "0xB634F716BEd5Dd5A2b9a91C92474C499e50Cb27D" + }, + "devdoc": { + "kind": "dev", + "methods": { + "calculateRootFromPowerOfTwo(bytes32[])": { + "params": { + "hashes": "The array containing power of 2 elements" + }, + "returns": { + "_0": "byte32 the root hash being calculated" + } + }, + "getEmptyTreeHashAtIndex(uint256)": { + "details": "first index is keccak(0), second index is keccak(keccak(0), keccak(0))", + "params": { + "_index": "of hash wanted" + } + }, + "getHashOfWordAtIndex(bytes,uint256)": { + "details": "if word is incomplete (< 8 bytes) it gets padded with zeroes", + "params": { + "_data": "array of bytes", + "_wordIndex": "index of word inside the bytes to get the hash of" + } + }, + "getMerkleRootFromBytes(bytes,uint256)": { + "details": "_data is padded with zeroes until is multiple of 8root is completed with zero tree until log2size is completehashes are taken word by word (8 bytes by 8 bytes)", + "params": { + "_data": "array of bytes to be merklelized", + "_log2Size": "log2 of total size of the drive" + } + }, + "getRootAfterReplacementInDrive(uint256,uint256,uint256,bytes32,bytes32[])": { + "params": { + "_logSizeOfFullDrive": "log2 of size the full drive, which can be the entire machine", + "_logSizeOfReplacement": "log2 of size the replacement", + "_position": "position of _drive", + "_replacement": "hash of the replacement", + "siblings": "of replacement that merkle root can be calculated" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "calculateRootFromPowerOfTwo(bytes32[])": { + "notice": "Calculate the root of Merkle tree from an array of power of 2 elements" + }, + "getEmptyTreeHashAtIndex(uint256)": { + "notice": "Gets precomputed hash of zero in empty tree hashes" + }, + "getHashOfWordAtIndex(bytes,uint256)": { + "notice": "Get the hash of a word in an array of bytes" + }, + "getMerkleRootFromBytes(bytes,uint256)": { + "notice": "get merkle root of generic array of bytes" + }, + "getRootAfterReplacementInDrive(uint256,uint256,uint256,bytes32,bytes32[])": { + "notice": "Gets merkle root hash of drive with a replacement" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base_sepolia/UnrolledCordic.json b/packages/contracts/deployments/base_sepolia/UnrolledCordic.json new file mode 100644 index 0000000..fa80093 --- /dev/null +++ b/packages/contracts/deployments/base_sepolia/UnrolledCordic.json @@ -0,0 +1,60 @@ +{ + "address": "0x3F8FdcD1B0F421D817BF58C96b7C91B98100B450", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log2Times1e18", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0xd8e9a4b91923d8afb204650685807b6d3d980de3fc770c94b3c1ae8e8f19289b", + "receipt": { + "to": "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7", + "from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0", + "contractAddress": null, + "transactionIndex": 6, + "gasUsed": "395654", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9c3154df8cecd33b0e248fa124db5f730e9a459110350a0b2c67528e5a804a28", + "transactionHash": "0xd8e9a4b91923d8afb204650685807b6d3d980de3fc770c94b3c1ae8e8f19289b", + "logs": [], + "blockNumber": 8580264, + "cumulativeGasUsed": "681637", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "18c7b3fb984a9ee861b83d1058d152f0", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"val\",\"type\":\"uint256\"}],\"name\":\"log2Times1e18\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/UnrolledCordic.sol\":\"UnrolledCordic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/UnrolledCordic.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n///@title UnrolledCordic.sol\\n///@author Gabriel Barros, Diego Nehab\\npragma solidity ^0.8.0;\\n\\nlibrary UnrolledCordic {\\n uint256 constant one = 0x8000000000000000000000000000000000000000000000000000000000000000;\\n uint256 constant log2_e = 0xb8aa3b295c17f0bbbe87fed0691d3e88eb577aa8dd695a588b25166cd1a13248;\\n\\n uint64 constant N = 64;\\n uint256 constant log2_ks0 = 0xb31fb7d64898b3e15c01a39fbd687a02934f0979a3715fd4ae00d1cfdeb43d0;\\n uint256 constant log2_ks1 = 0xb84e236bd563ba016fe50b6ef0851802dcf2d0b85a453105aeb4dd63bf61cc;\\n uint256 constant log2_ks2 = 0xb8a476150dfe4001713d62f7957c3002e24ca6e87e8a8005c3e0ffc29d593;\\n uint256 constant log2_ks3 = 0xb8a9ded47c110001715305002e4b0002e2a32762fa6c0005c53ac47e94d9;\\n uint256 constant log2_ks4 = 0xb8aa35640a80000171545f3d72b00002e2a8905062300005c55067f6e59;\\n uint256 constant log2_ks5 = 0xb8aa3acd07000001715474e164000002e2a8e6e01f000005c551c2359a;\\n\\n function log2m64(uint256 x) internal pure returns (uint256) {\\n uint256 y = 0;\\n uint256 t;\\n\\n unchecked {\\n // round(log_2(1+1/2^i)*2^64) for i = 1..4 packed into 64bits each\\n t = x + (x >> 1);\\n if (t < one) {\\n x = t;\\n y += log2_ks0 << 192;\\n }\\n t = x + (x >> 2);\\n if (t < one) {\\n x = t;\\n y += (log2_ks0 >> 64) << 192;\\n }\\n t = x + (x >> 3);\\n if (t < one) {\\n x = t;\\n y += (log2_ks0 >> 128) << 192;\\n }\\n t = x + (x >> 4);\\n if (t < one) {\\n x = t;\\n y += (log2_ks0 >> 192) << 192;\\n }\\n // round(log_2(1+1/2^i)*2^64) for i = 5..8 packed into 64bits each\\n t = x + (x >> 5);\\n if (t < one) {\\n x = t;\\n y += log2_ks1 << 192;\\n }\\n t = x + (x >> 6);\\n if (t < one) {\\n x = t;\\n y += (log2_ks1 >> 64) << 192;\\n }\\n t = x + (x >> 7);\\n if (t < one) {\\n x = t;\\n y += (log2_ks1 >> 128) << 192;\\n }\\n t = x + (x >> 8);\\n if (t < one) {\\n x = t;\\n y += (log2_ks1 >> 192) << 192;\\n }\\n // round(log_2(1+1/2^i)*2^64) for i = 9..12 packed into 64bits each\\n t = x + (x >> 9);\\n if (t < one) {\\n x = t;\\n y += log2_ks2 << 192;\\n }\\n t = x + (x >> 10);\\n if (t < one) {\\n x = t;\\n y += (log2_ks2 >> 64) << 192;\\n }\\n t = x + (x >> 11);\\n if (t < one) {\\n x = t;\\n y += (log2_ks2 >> 128) << 192;\\n }\\n t = x + (x >> 12);\\n if (t < one) {\\n x = t;\\n y += (log2_ks2 >> 192) << 192;\\n }\\n // round(log_2(1+1/2^i)*2^64) for i = 13..16 packed into 64bits each\\n t = x + (x >> 13);\\n if (t < one) {\\n x = t;\\n y += log2_ks3 << 192;\\n }\\n t = x + (x >> 14);\\n if (t < one) {\\n x = t;\\n y += (log2_ks3 >> 64) << 192;\\n }\\n t = x + (x >> 15);\\n if (t < one) {\\n x = t;\\n y += (log2_ks3 >> 128) << 192;\\n }\\n t = x + (x >> 16);\\n if (t < one) {\\n x = t;\\n y += (log2_ks3 >> 192) << 192;\\n }\\n // round(log_2(1+1/2^i)*2^64) for i = 17..20 packed into 64bits each\\n t = x + (x >> 17);\\n if (t < one) {\\n x = t;\\n y += log2_ks4 << 192;\\n }\\n t = x + (x >> 18);\\n if (t < one) {\\n x = t;\\n y += (log2_ks4 >> 64) << 192;\\n }\\n t = x + (x >> 19);\\n if (t < one) {\\n x = t;\\n y += (log2_ks4 >> 128) << 192;\\n }\\n t = x + (x >> 20);\\n if (t < one) {\\n x = t;\\n y += (log2_ks4 >> 192) << 192;\\n }\\n // round(log_2(1+1/2^i)*2^64) for i = 21..24 packed into 64bits each\\n t = x + (x >> 21);\\n if (t < one) {\\n x = t;\\n y += log2_ks5 << 192;\\n }\\n t = x + (x >> 22);\\n if (t < one) {\\n x = t;\\n y += (log2_ks5 >> 64) << 192;\\n }\\n t = x + (x >> 23);\\n if (t < one) {\\n x = t;\\n y += (log2_ks5 >> 128) << 192;\\n }\\n t = x + (x >> 24);\\n if (t < one) {\\n x = t;\\n y += (log2_ks5 >> 192) << 192;\\n }\\n\\n uint256 r = one - x;\\n y += mulhi128(log2_e, mulhi128(r, one + (r >> 1)) << 1) << 1;\\n return y >> (255 - 64);\\n }\\n }\\n\\n function log2Times1e18(uint256 val) external pure returns (uint256) {\\n int256 il = ilog2(val);\\n uint256 skewedRes;\\n unchecked {\\n if (il + 1 <= 255) {\\n skewedRes = (uint256(il + 1) << N) - log2m64(val << (255 - uint256(il + 1)));\\n } else {\\n skewedRes = (uint256(il + 1) << N) - log2m64(val >> uint256((il + 1) - 255));\\n }\\n return (skewedRes * 1e18) >> N;\\n }\\n }\\n\\n function mulhi128(uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n return (a >> 128) * (b >> 128);\\n }\\n }\\n\\n function ilog2(uint256 val) internal pure returns (int256) {\\n require(val > 0, \\\"must be greater than zero\\\");\\n unchecked {\\n return 255 - int256(clz(val));\\n }\\n }\\n\\n /// @notice count leading zeros\\n /// @param _num number you want the clz of\\n /// @dev this a binary search implementation\\n function clz(uint256 _num) internal pure returns (uint256) {\\n if (_num == 0) return 256;\\n unchecked {\\n uint256 n = 0;\\n if (_num & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 == 0) {\\n n = n + 128;\\n _num = _num << 128;\\n }\\n if (_num & 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 64;\\n _num = _num << 64;\\n }\\n if (_num & 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 32;\\n _num = _num << 32;\\n }\\n if (_num & 0xFFFF000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 16;\\n _num = _num << 16;\\n }\\n if (_num & 0xFF00000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 8;\\n _num = _num << 8;\\n }\\n if (_num & 0xF000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 4;\\n _num = _num << 4;\\n }\\n if (_num & 0xC000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 2;\\n _num = _num << 2;\\n }\\n if (_num & 0x8000000000000000000000000000000000000000000000000000000000000000 == 0) {\\n n = n + 1;\\n }\\n\\n return n;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2b492b6b11ab8bb42017a1c35fd6215e0ecea5305c070bb189a4426fc56821b3\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x61062c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063c370ed091461003a575b600080fd5b61004d6100483660046105dd565b61005f565b60405190815260200160405180910390f35b60008061006b836100ca565b9050600060ff826001011361009b5761008c8260010160ff0385901b610131565b6001830160401b0390506100b6565b6100ab60fd19830185901c610131565b6001830160401b0390505b670de0b6b3a76400000260401c9392505050565b600080821161011f5760405162461bcd60e51b815260206004820152601960248201527f6d7573742062652067726561746572207468616e207a65726f00000000000000604482015260640160405180910390fd5b610128826104f9565b60ff0392915050565b600080600183901c8301600160ff1b8110156101585792506704ae00d1cfdeb43d60c41b01825b50600283901c8301600160ff1b81101561017d579250672934f0979a3715fd60c01b01825b50600383901c8301600160ff1b8110156101a157925066ae00d1cfdeb43d60c51b01825b50600483901c8301600160ff1b8110156101c6579250670598fdbeb244c59f60c11b01825b50600583901c8301600160ff1b8110156101eb57925067016bad3758efd87360c21b01825b50600683901c8301600160ff1b8110156102105792506702dcf2d0b85a453160c01b01825b50600783901c8301600160ff1b811015610234579250662dfca16dde10a360c31b01825b50600883901c8301600160ff1b811015610258579250665c2711b5eab1dd60c11b01825b50600983901c8301600160ff1b81101561027c579250665c3e0ffc29d59360c01b01825b50600a83901c8301600160ff1b8110156102a05792506605c4994dd0fd1560c31b01825b50600b83901c8301600160ff1b8110156102c4579250661713d62f7957c360c01b01825b50600c83901c8301600160ff1b8110156102e85792506602e291d85437f960c21b01825b50600d83901c8301600160ff1b81101561030c5792506605c53ac47e94d960c01b01825b50600e83901c8301600160ff1b81101561032f57925065b8a8c9d8be9b60c21b01825b50600f83901c8301600160ff1b8110156103535792506601715305002e4b60c01b01825b50601083901c8301600160ff1b81101561037657925065b8a9ded47c1160c01b01825b50601183901c8301600160ff1b811015610399579250655c55067f6e5960c01b01825b50601283901c8301600160ff1b8110156103bc579250652e2a8905062360c01b01825b50601383901c8301600160ff1b8110156103df57925065171545f3d72b60c01b01825b50601483901c8301600160ff1b811015610402579250650171546ac81560c31b01825b50601583901c8301600160ff1b8110156104255792506502e2a8e11acd60c11b01825b50601683901c8301600160ff1b8110156104485792506502e2a8e6e01f60c01b01825b50601783901c8301600160ff1b81101561046a579250645c551d385960c21b01825b50601883901c8301600160ff1b81101561048c57925064b8aa3acd0760c01b01825b600084600160ff1b03905060016104e87fb8aa3b295c17f0bbbe87fed0691d3e88eb577aa8dd695a588b25166cd1a1324860016104da85600187901c600160ff1b01608090811c91901c0290565b901b608090811c91901c0290565b901b9290920160bf1c949350505050565b60008160000361050c5750610100919050565b6000826fffffffffffffffffffffffffffffffff191660000361053157608092831b92015b826001600160c01b03191660000361054b57604092831b92015b826001600160e01b03191660000361056557602092831b92015b826001600160f01b03191660000361057f57601092831b92015b826001600160f81b03191660000361059957600892831b92015b82600f60fc1b166000036105af57600492831b92015b82600360fe1b166000036105c557600292831b92015b82600160ff1b166000036105d7576001015b92915050565b6000602082840312156105ef57600080fd5b503591905056fea2646970667358221220bdca551f20b7016a01ee86891c71e6ad830c04ffad3399a2087b9faacd91288064736f6c63430008140033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063c370ed091461003a575b600080fd5b61004d6100483660046105dd565b61005f565b60405190815260200160405180910390f35b60008061006b836100ca565b9050600060ff826001011361009b5761008c8260010160ff0385901b610131565b6001830160401b0390506100b6565b6100ab60fd19830185901c610131565b6001830160401b0390505b670de0b6b3a76400000260401c9392505050565b600080821161011f5760405162461bcd60e51b815260206004820152601960248201527f6d7573742062652067726561746572207468616e207a65726f00000000000000604482015260640160405180910390fd5b610128826104f9565b60ff0392915050565b600080600183901c8301600160ff1b8110156101585792506704ae00d1cfdeb43d60c41b01825b50600283901c8301600160ff1b81101561017d579250672934f0979a3715fd60c01b01825b50600383901c8301600160ff1b8110156101a157925066ae00d1cfdeb43d60c51b01825b50600483901c8301600160ff1b8110156101c6579250670598fdbeb244c59f60c11b01825b50600583901c8301600160ff1b8110156101eb57925067016bad3758efd87360c21b01825b50600683901c8301600160ff1b8110156102105792506702dcf2d0b85a453160c01b01825b50600783901c8301600160ff1b811015610234579250662dfca16dde10a360c31b01825b50600883901c8301600160ff1b811015610258579250665c2711b5eab1dd60c11b01825b50600983901c8301600160ff1b81101561027c579250665c3e0ffc29d59360c01b01825b50600a83901c8301600160ff1b8110156102a05792506605c4994dd0fd1560c31b01825b50600b83901c8301600160ff1b8110156102c4579250661713d62f7957c360c01b01825b50600c83901c8301600160ff1b8110156102e85792506602e291d85437f960c21b01825b50600d83901c8301600160ff1b81101561030c5792506605c53ac47e94d960c01b01825b50600e83901c8301600160ff1b81101561032f57925065b8a8c9d8be9b60c21b01825b50600f83901c8301600160ff1b8110156103535792506601715305002e4b60c01b01825b50601083901c8301600160ff1b81101561037657925065b8a9ded47c1160c01b01825b50601183901c8301600160ff1b811015610399579250655c55067f6e5960c01b01825b50601283901c8301600160ff1b8110156103bc579250652e2a8905062360c01b01825b50601383901c8301600160ff1b8110156103df57925065171545f3d72b60c01b01825b50601483901c8301600160ff1b811015610402579250650171546ac81560c31b01825b50601583901c8301600160ff1b8110156104255792506502e2a8e11acd60c11b01825b50601683901c8301600160ff1b8110156104485792506502e2a8e6e01f60c01b01825b50601783901c8301600160ff1b81101561046a579250645c551d385960c21b01825b50601883901c8301600160ff1b81101561048c57925064b8aa3acd0760c01b01825b600084600160ff1b03905060016104e87fb8aa3b295c17f0bbbe87fed0691d3e88eb577aa8dd695a588b25166cd1a1324860016104da85600187901c600160ff1b01608090811c91901c0290565b901b608090811c91901c0290565b901b9290920160bf1c949350505050565b60008160000361050c5750610100919050565b6000826fffffffffffffffffffffffffffffffff191660000361053157608092831b92015b826001600160c01b03191660000361054b57604092831b92015b826001600160e01b03191660000361056557602092831b92015b826001600160f01b03191660000361057f57601092831b92015b826001600160f81b03191660000361059957600892831b92015b82600f60fc1b166000036105af57600492831b92015b82600360fe1b166000036105c557600292831b92015b82600160ff1b166000036105d7576001015b92915050565b6000602082840312156105ef57600080fd5b503591905056fea2646970667358221220bdca551f20b7016a01ee86891c71e6ad830c04ffad3399a2087b9faacd91288064736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/export/abi/base_sepolia.json b/packages/contracts/export/abi/base_sepolia.json new file mode 100644 index 0000000..5d3aef7 --- /dev/null +++ b/packages/contracts/export/abi/base_sepolia.json @@ -0,0 +1,283 @@ +{ + "name": "base_sepolia", + "chainId": "84532", + "contracts": { + "Bitmask": { + "address": "0xF5B2d8c81cDE4D6238bBf20D3D77DB37df13f735", + "abi": [] + }, + "CartesiMathV2": { + "address": "0xB634F716BEd5Dd5A2b9a91C92474C499e50Cb27D", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "clz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "ctz", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2Floor", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "getLog2TableTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "isPowerOf2", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_num", + "type": "uint256" + } + ], + "name": "log2ApproxTimes1M", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] + }, + "MerkleV2": { + "address": "0x33436035441927Df1a73FE3AAC5906854632e53d", + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "hashes", + "type": "bytes32[]" + } + ], + "name": "calculateRootFromPowerOfTwo", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getEmptyTreeHashAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_wordIndex", + "type": "uint256" + } + ], + "name": "getHashOfWordAtIndex", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_log2Size", + "type": "uint256" + } + ], + "name": "getMerkleRootFromBytes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_position", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_logSizeOfReplacement", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_logSizeOfFullDrive", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_replacement", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "siblings", + "type": "bytes32[]" + } + ], + "name": "getRootAfterReplacementInDrive", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] + }, + "UnrolledCordic": { + "address": "0x3F8FdcD1B0F421D817BF58C96b7C91B98100B450", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "val", + "type": "uint256" + } + ], + "name": "log2Times1e18", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index 1c6e9b9..ba408d0 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -20,6 +20,7 @@ import { avalanche, avalancheFuji, base, + baseSepolia, bsc, bscTestnet, celo, @@ -82,6 +83,7 @@ const config: HardhatUserConfig = { avalanche: networkConfig(avalanche), avalanche_fuji: networkConfig(avalancheFuji), base: networkConfig(base), + base_sepolia: networkConfig(baseSepolia), bsc: networkConfig(bsc), bsc_testnet: networkConfig(bscTestnet), celo: networkConfig(celo), diff --git a/packages/contracts/package.json b/packages/contracts/package.json index ac41fda..fe4b8a3 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,6 +1,6 @@ { "name": "@cartesi/util", - "version": "6.2.0", + "version": "6.3.0", "description": "Solidity Util Contracts", "scripts": { "build": "run-s compile export", @@ -16,6 +16,7 @@ "deploy:avalanche": "hardhat deploy --network avalanche --export export/abi/avalanche.json", "deploy:avalanche_fuji": "hardhat deploy --network avalanche_fuji --export export/abi/avalanche_fuji.json", "deploy:base": "hardhat deploy --network base --export export/abi/base.json", + "deploy:base_sepolia": "hardhat deploy --network base_sepolia --export export/abi/base_sepolia.json", "deploy:bsc": "hardhat deploy --network bsc --export export/abi/bsc.json", "deploy:bsc_testnet": "hardhat deploy --network bsc_testnet --export export/abi/bsc_testnet.json", "deploy:celo": "hardhat deploy --network celo --export export/abi/celo.json", @@ -60,6 +61,7 @@ "deploy:avalanche": "Deploy contracts to avalanche. Requires environment variable MNEMONIC.", "deploy:avalanche_fuji": "Deploy contracts to avalanche_fuji. Requires environment variable MNEMONIC.", "deploy:base": "Deploy contracts to base. Requires environment variable MNEMONIC.", + "deploy:base_sepolia": "Deploy contracts to base_sepolia. Requires environment variable MNEMONIC.", "deploy:bsc": "Deploy contracts to bsc. Requires environment variable MNEMONIC.", "deploy:bsc_testnet": "Deploy contracts to bsc_testnet. Requires environment variable MNEMONIC.", "deploy:chiado": "Deploy contracts to chiado. Requires environment variable MNEMONIC.",