From 93edc66d9987df68109f6f6ef50cc10595327ad6 Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Thu, 7 Dec 2023 13:38:20 +0200 Subject: [PATCH] build: install deps via NPM expect for v2-core feat: add BaseScript chore: update remappings chore: update imports --- .gitmodules | 17 -- lib/forge-std | 1 - lib/openzeppelin-contracts | 1 - lib/prb-test | 1 - lib/solady | 1 - lib/v2-core | 2 +- package.json | 6 +- pnpm-lock.yaml | 276 +++++++++++++++++- remappings.txt | 10 +- script/Base.s.sol | 41 +++ script/CreateMerkleStreamerLL.s.sol | 2 +- script/DeployBatch.t.sol | 2 +- script/DeployDeterministicBatch.s.sol | 2 +- script/DeployDeterministicPeriphery.s.sol | 2 +- script/DeployMerkleStreamerFactory.s.sol | 2 +- script/DeployPeriphery.s.sol | 2 +- script/DeployProtocol.s.sol | 2 +- src/SablierV2MerkleStreamerLL.sol | 2 +- src/abstracts/SablierV2MerkleStreamer.sol | 2 +- .../merkle-streamer/ll/claim/claim.t.sol | 2 +- .../ll/clawback/clawback.t.sol | 2 +- test/utils/Defaults.sol | 3 +- test/utils/DeployOptimized.sol | 2 +- test/utils/MerkleBuilder.sol | 2 +- test/utils/MerkleBuilder.t.sol | 4 +- test/utils/Precompiles.t.sol | 2 +- 26 files changed, 337 insertions(+), 54 deletions(-) delete mode 160000 lib/forge-std delete mode 160000 lib/openzeppelin-contracts delete mode 160000 lib/prb-test delete mode 160000 lib/solady create mode 100644 script/Base.s.sol diff --git a/.gitmodules b/.gitmodules index dc5d6b80..06a8b026 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,20 +1,3 @@ -[submodule "lib/forge-std"] - branch = "v1" - path = "lib/forge-std" - url = "https://github.com/foundry-rs/forge-std" -[submodule "lib/openzeppelin-contracts"] - branch = "release-v4.9" - path = "lib/openzeppelin-contracts" - url = "https://github.com/OpenZeppelin/openzeppelin-contracts" -[submodule "lib/prb-test"] - branch = "release-v0" - path = "lib/prb-test" - url = "https://github.com/PaulRBerg/prb-test" -[submodule "lib/solady"] - branch = "main" - path = "lib/solady" - url = "https://github.com/Vectorized/solady" [submodule "lib/v2-core"] - branch = "main" path = "lib/v2-core" url = "https://github.com/sablier-labs/v2-core" diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index e8a047e3..00000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e8a047e3f40f13fa37af6fe14e6e06283d9a060e diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index e50c24f5..00000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e50c24f5839db17f46991478384bfda14acfb830 diff --git a/lib/prb-test b/lib/prb-test deleted file mode 160000 index 1e9ead2f..00000000 --- a/lib/prb-test +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1e9ead2f7bfaedda3038081c16484b0d7d0b2712 diff --git a/lib/solady b/lib/solady deleted file mode 160000 index c863813a..00000000 --- a/lib/solady +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c863813a6fa2068e1ec834ebc037ededb99a6f97 diff --git a/lib/v2-core b/lib/v2-core index edf3609d..366c3331 160000 --- a/lib/v2-core +++ b/lib/v2-core @@ -1 +1 @@ -Subproject commit edf3609dd27b17f69da603624746aae282627b05 +Subproject commit 366c3331de7692c80bf952ce2391fdb80795b615 diff --git a/package.json b/package.json index 50d1bbbb..af7a5b5b 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,15 @@ }, "dependencies": { "@openzeppelin/contracts": "4.9.2", + "@prb/math": "4.0.2", "@sablier/v2-core": "1.0.2" }, "devDependencies": { + "@prb/test": "0.6.4", + "forge-std": "github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e", "prettier": "^2.8.8", - "solhint": "^3.6.2" + "solady": "0.0.129", + "solhint": "^4.0.0" }, "files": [ "artifacts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8080b5fc..b591d8af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,17 +8,29 @@ dependencies: '@openzeppelin/contracts': specifier: 4.9.2 version: 4.9.2 + '@prb/math': + specifier: 4.0.2 + version: 4.0.2 '@sablier/v2-core': specifier: 1.0.2 - version: 1.0.2(@openzeppelin/contracts@4.9.2)(@prb/math@4.0.1) + version: 1.0.2(@openzeppelin/contracts@4.9.2)(@prb/math@4.0.2) devDependencies: + '@prb/test': + specifier: 0.6.4 + version: 0.6.4 + forge-std: + specifier: github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e + version: github.com/foundry-rs/forge-std/e8a047e3f40f13fa37af6fe14e6e06283d9a060e prettier: specifier: ^2.8.8 version: 2.8.8 + solady: + specifier: 0.0.129 + version: 0.0.129 solhint: - specifier: ^3.6.2 - version: 3.6.2 + specifier: ^4.0.0 + version: 4.0.0 packages: @@ -47,26 +59,67 @@ packages: resolution: {integrity: sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg==} dev: false - /@prb/math@4.0.1: - resolution: {integrity: sha512-ANTz2KMV+dMdZ57mWgDTR6jZo5uQzUczQEHCxd7CvJZZ9yafnfPhUUILHvvigIOZ85fZbTPVkC8YoRG1z5Qf7g==} + /@pnpm/config.env-replace@1.1.0: + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + dev: true + + /@pnpm/network.ca-file@1.0.2: + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + dependencies: + graceful-fs: 4.2.10 + dev: true + + /@pnpm/npm-conf@2.2.2: + resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==} + engines: {node: '>=12'} + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + dev: true + + /@prb/math@4.0.2: + resolution: {integrity: sha512-kJgqvXR6iyU7+N959RzggSFhBdnRuSDnc/bs8u6MzdWw7aYIUaAr+uMVdpP6Dheypjerd7sfJgFOs19FRFhscg==} dev: false - /@sablier/v2-core@1.0.2(@openzeppelin/contracts@4.9.2)(@prb/math@4.0.1): + /@prb/test@0.6.4: + resolution: {integrity: sha512-P0tTMsB6XQ0Wp61EYdXJYFhsOVGyZvcOFub2y9yk0sF+GYDusctR7DzEI+vOP0SILm3knFkEJASjewHEBppdRQ==} + dev: true + + /@sablier/v2-core@1.0.2(@openzeppelin/contracts@4.9.2)(@prb/math@4.0.2): resolution: {integrity: sha512-BjobBTRLuh38fQsHtFGVsQI1XN9JXatldxbS+aFxlhYaU77fQimCejYrBqP7W1wQZnBAvdXRdKNPUskdUpM5nw==} peerDependencies: '@openzeppelin/contracts': 4.9.2 '@prb/math': 4.0.1 dependencies: '@openzeppelin/contracts': 4.9.2 - '@prb/math': 4.0.1 + '@prb/math': 4.0.2 dev: false + /@sindresorhus/is@5.6.0: + resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} + engines: {node: '>=14.16'} + dev: true + /@solidity-parser/parser@0.16.0: resolution: {integrity: sha512-ESipEcHyRHg4Np4SqBCfcXwyxxna1DgFVz69bgpLV8vzl/NP1DtcKsJ4dJZXWQhY/Z4J2LeKBiOkOVZn9ct33Q==} dependencies: antlr4ts: 0.5.0-alpha.4 dev: true + /@szmarczak/http-timer@5.0.1: + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + dependencies: + defer-to-connect: 2.0.1 + dev: true + + /@types/http-cache-semantics@4.0.4: + resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + dev: true + /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -136,6 +189,24 @@ packages: balanced-match: 1.0.2 dev: true + /cacheable-lookup@7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} + dev: true + + /cacheable-request@10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} + engines: {node: '>=14.16'} + dependencies: + '@types/http-cache-semantics': 4.0.4 + get-stream: 6.0.1 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + mimic-response: 4.0.0 + normalize-url: 8.0.0 + responselike: 3.0.0 + dev: true + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -184,6 +255,13 @@ packages: engines: {node: '>=14'} dev: true + /config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + dev: true + /cosmiconfig@8.2.0: resolution: {integrity: sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==} engines: {node: '>=14'} @@ -194,6 +272,23 @@ packages: path-type: 4.0.0 dev: true + /decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + dependencies: + mimic-response: 3.1.0 + dev: true + + /deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + dev: true + + /defer-to-connect@2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} + dev: true + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true @@ -221,10 +316,20 @@ packages: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true + /form-data-encoder@2.1.4: + resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} + engines: {node: '>= 14.17'} + dev: true + /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} @@ -236,6 +341,27 @@ packages: once: 1.4.0 dev: true + /got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 5.6.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + dev: true + + /graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true + /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -246,6 +372,18 @@ packages: engines: {node: '>=8'} dev: true + /http-cache-semantics@4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + dev: true + + /http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: true + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -270,6 +408,10 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true + /ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true + /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true @@ -290,6 +432,10 @@ packages: argparse: 2.0.1 dev: true + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true @@ -302,6 +448,19 @@ packages: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: true + /keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true + + /latest-version@7.0.0: + resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} + engines: {node: '>=14.16'} + dependencies: + package-json: 8.1.1 + dev: true + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true @@ -314,6 +473,11 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true + /lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -321,6 +485,16 @@ packages: yallist: 4.0.0 dev: true + /mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + dev: true + + /mimic-response@4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -328,12 +502,36 @@ packages: brace-expansion: 2.0.1 dev: true + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /normalize-url@8.0.0: + resolution: {integrity: sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==} + engines: {node: '>=14.16'} + dev: true + /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 dev: true + /p-cancelable@3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} + dev: true + + /package-json@8.1.1: + resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} + engines: {node: '>=14.16'} + dependencies: + got: 12.6.1 + registry-auth-token: 5.0.2 + registry-url: 6.0.1 + semver: 7.5.4 + dev: true + /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -367,21 +565,65 @@ packages: hasBin: true dev: true + /proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + dev: true + /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} dev: true + /quick-lru@5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + dev: true + + /rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + dev: true + + /registry-auth-token@5.0.2: + resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} + engines: {node: '>=14'} + dependencies: + '@pnpm/npm-conf': 2.2.2 + dev: true + + /registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + dependencies: + rc: 1.2.8 + dev: true + /require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} dev: true + /resolve-alpn@1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + dev: true + /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} dev: true + /responselike@3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} + dependencies: + lowercase-keys: 3.0.0 + dev: true + /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} @@ -399,8 +641,12 @@ packages: is-fullwidth-code-point: 3.0.0 dev: true - /solhint@3.6.2: - resolution: {integrity: sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==} + /solady@0.0.129: + resolution: {integrity: sha512-2i+8lsLLT7nAED+A9C+ZLi8YmpSnUNKGKozkesN2Qm3P3iMvorXAsD5LyT1MAC3eyVfhY3PuvBkvgd31nUzkoQ==} + dev: true + + /solhint@4.0.0: + resolution: {integrity: sha512-bFViMcFvhqVd/HK3Roo7xZXX5nbujS7Bxeg5vnZc9QvH0yCWCrQ38Yrn1pbAY9tlKROc6wFr+rK1mxYgYrjZgA==} hasBin: true dependencies: '@solidity-parser/parser': 0.16.0 @@ -414,6 +660,7 @@ packages: glob: 8.1.0 ignore: 5.2.4 js-yaml: 4.1.0 + latest-version: 7.0.0 lodash: 4.17.21 pluralize: 8.0.0 semver: 7.5.4 @@ -440,6 +687,11 @@ packages: ansi-regex: 5.0.1 dev: true + /strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + dev: true + /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -482,3 +734,9 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + + github.com/foundry-rs/forge-std/e8a047e3f40f13fa37af6fe14e6e06283d9a060e: + resolution: {tarball: https://codeload.github.com/foundry-rs/forge-std/tar.gz/e8a047e3f40f13fa37af6fe14e6e06283d9a060e} + name: forge-std + version: 1.5.6 + dev: true diff --git a/remappings.txt b/remappings.txt index 95c5a1d9..ae446556 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,7 +1,7 @@ -@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ -@prb/test/=lib/prb-test/src/ +@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ +@prb/math/=node_modules/@prb/math/ +@prb/test/=node_modules/@prb/test/ @sablier/v2-core/=lib/v2-core/ -@sablier/v2-core-script/=lib/v2-core/script/ @sablier/v2-core-test/=lib/v2-core/test/ -forge-std/=lib/forge-std/src/ -solady/=lib/solady/src/ +forge-std/=node_modules/forge-std/ +solady/=node_modules/solady/ \ No newline at end of file diff --git a/script/Base.s.sol b/script/Base.s.sol new file mode 100644 index 00000000..e9f18740 --- /dev/null +++ b/script/Base.s.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity >=0.8.19 <0.9.0; + +import { Script } from "forge-std/src/Script.sol"; + +abstract contract BaseScript is Script { + /// @dev Included to enable compilation of the script without a $MNEMONIC environment variable. + string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk"; + + /// @dev Needed for the deterministic deployments. + bytes32 internal constant ZERO_SALT = bytes32(0); + + /// @dev The address of the transaction broadcaster. + address internal broadcaster; + + /// @dev Used to derive the broadcaster's address if $ETH_FROM is not defined. + string internal mnemonic; + + /// @dev Initializes the transaction broadcaster like this: + /// + /// - If $ETH_FROM is defined, use it. + /// - Otherwise, derive the broadcaster address from $MNEMONIC. + /// - If $MNEMONIC is not defined, default to a test mnemonic. + /// + /// The use case for $ETH_FROM is to specify the broadcaster key and its address via the command line. + constructor() { + address from = vm.envOr({ name: "ETH_FROM", defaultValue: address(0) }); + if (from != address(0)) { + broadcaster = from; + } else { + mnemonic = vm.envOr({ name: "MNEMONIC", defaultValue: TEST_MNEMONIC }); + (broadcaster,) = deriveRememberKey({ mnemonic: mnemonic, index: 0 }); + } + } + + modifier broadcast() { + vm.startBroadcast(broadcaster); + _; + vm.stopBroadcast(); + } +} diff --git a/script/CreateMerkleStreamerLL.s.sol b/script/CreateMerkleStreamerLL.s.sol index 4e2ccb11..860807b4 100644 --- a/script/CreateMerkleStreamerLL.s.sol +++ b/script/CreateMerkleStreamerLL.s.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.19 <0.9.0; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { ISablierV2LockupLinear } from "@sablier/v2-core/src/interfaces/ISablierV2LockupLinear.sol"; import { LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { ISablierV2MerkleStreamerFactory } from "../src/interfaces/ISablierV2MerkleStreamerFactory.sol"; import { ISablierV2MerkleStreamerLL } from "../src/interfaces/ISablierV2MerkleStreamerLL.sol"; diff --git a/script/DeployBatch.t.sol b/script/DeployBatch.t.sol index 0072e80f..12d1c07f 100644 --- a/script/DeployBatch.t.sol +++ b/script/DeployBatch.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.19 <0.9.0; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; diff --git a/script/DeployDeterministicBatch.s.sol b/script/DeployDeterministicBatch.s.sol index 19bb37b0..df6a9362 100644 --- a/script/DeployDeterministicBatch.s.sol +++ b/script/DeployDeterministicBatch.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.19 <0.9.0; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; diff --git a/script/DeployDeterministicPeriphery.s.sol b/script/DeployDeterministicPeriphery.s.sol index 425ac3e3..01fdb7d3 100644 --- a/script/DeployDeterministicPeriphery.s.sol +++ b/script/DeployDeterministicPeriphery.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.19 <0.9.0; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; diff --git a/script/DeployMerkleStreamerFactory.s.sol b/script/DeployMerkleStreamerFactory.s.sol index ee328f9b..7fa01b27 100644 --- a/script/DeployMerkleStreamerFactory.s.sol +++ b/script/DeployMerkleStreamerFactory.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.19 <0.9.0; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; diff --git a/script/DeployPeriphery.s.sol b/script/DeployPeriphery.s.sol index 09033d52..40390bc9 100644 --- a/script/DeployPeriphery.s.sol +++ b/script/DeployPeriphery.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.19 <0.9.0; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; diff --git a/script/DeployProtocol.s.sol b/script/DeployProtocol.s.sol index 7833bd70..c1c0ced4 100644 --- a/script/DeployProtocol.s.sol +++ b/script/DeployProtocol.s.sol @@ -5,7 +5,7 @@ import { SablierV2Comptroller } from "@sablier/v2-core/src/SablierV2Comptroller. import { SablierV2LockupDynamic } from "@sablier/v2-core/src/SablierV2LockupDynamic.sol"; import { SablierV2LockupLinear } from "@sablier/v2-core/src/SablierV2LockupLinear.sol"; import { SablierV2NFTDescriptor } from "@sablier/v2-core/src/SablierV2NFTDescriptor.sol"; -import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; +import { BaseScript } from "./Base.s.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; diff --git a/src/SablierV2MerkleStreamerLL.sol b/src/SablierV2MerkleStreamerLL.sol index 3e3f5664..d747bd20 100644 --- a/src/SablierV2MerkleStreamerLL.sol +++ b/src/SablierV2MerkleStreamerLL.sol @@ -6,7 +6,7 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { ISablierV2LockupLinear } from "@sablier/v2-core/src/interfaces/ISablierV2LockupLinear.sol"; import { Broker, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; -import { ud } from "@sablier/v2-core/src/types/Math.sol"; +import { ud } from "@prb/math/src/UD60x18.sol"; import { SablierV2MerkleStreamer } from "./abstracts/SablierV2MerkleStreamer.sol"; import { ISablierV2MerkleStreamerLL } from "./interfaces/ISablierV2MerkleStreamerLL.sol"; diff --git a/src/abstracts/SablierV2MerkleStreamer.sol b/src/abstracts/SablierV2MerkleStreamer.sol index c8d1cdd8..9591a6af 100644 --- a/src/abstracts/SablierV2MerkleStreamer.sol +++ b/src/abstracts/SablierV2MerkleStreamer.sol @@ -7,7 +7,7 @@ import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerklePr import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import { Adminable } from "@sablier/v2-core/src/abstracts/Adminable.sol"; import { ISablierV2Lockup } from "@sablier/v2-core/src/interfaces/ISablierV2Lockup.sol"; -import { UD60x18, ud } from "@sablier/v2-core/src/types/Math.sol"; +import { UD60x18, ud } from "@prb/math/src/UD60x18.sol"; import { ISablierV2MerkleStreamer } from "../interfaces/ISablierV2MerkleStreamer.sol"; import { Errors } from "../libraries/Errors.sol"; diff --git a/test/integration/merkle-streamer/ll/claim/claim.t.sol b/test/integration/merkle-streamer/ll/claim/claim.t.sol index fcba315a..a4742934 100644 --- a/test/integration/merkle-streamer/ll/claim/claim.t.sol +++ b/test/integration/merkle-streamer/ll/claim/claim.t.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <0.9.0; import { Lockup, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; -import { ud } from "@sablier/v2-core/src/types/Math.sol"; +import { ud } from "@prb/math/src/UD60x18.sol"; import { Errors } from "src/libraries/Errors.sol"; diff --git a/test/integration/merkle-streamer/ll/clawback/clawback.t.sol b/test/integration/merkle-streamer/ll/clawback/clawback.t.sol index 3094925e..69b28afb 100644 --- a/test/integration/merkle-streamer/ll/clawback/clawback.t.sol +++ b/test/integration/merkle-streamer/ll/clawback/clawback.t.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <0.9.0; import { Errors as V2CoreErrors } from "@sablier/v2-core/src/libraries/Errors.sol"; -import { ud } from "@sablier/v2-core/src/types/Math.sol"; +import { ud } from "@prb/math/src/UD60x18.sol"; import { Errors } from "src/libraries/Errors.sol"; diff --git a/test/utils/Defaults.sol b/test/utils/Defaults.sol index eff612d9..b468c84e 100644 --- a/test/utils/Defaults.sol +++ b/test/utils/Defaults.sol @@ -3,7 +3,8 @@ pragma solidity >=0.8.19 <0.9.0; import { Arrays } from "@openzeppelin/contracts/utils/Arrays.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { ud2x18, UD60x18 } from "@sablier/v2-core/src/types/Math.sol"; +import { ud2x18 } from "@prb/math/src/UD2x18.sol"; +import { UD60x18 } from "@prb/math/src/UD60x18.sol"; import { Broker, LockupDynamic, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; import { Batch } from "src/types/DataTypes.sol"; diff --git a/test/utils/DeployOptimized.sol b/test/utils/DeployOptimized.sol index 24e5bffb..f49840f8 100644 --- a/test/utils/DeployOptimized.sol +++ b/test/utils/DeployOptimized.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.19 <0.9.0; -import { StdCheats } from "forge-std/StdCheats.sol"; +import { StdCheats } from "forge-std/src/StdCheats.sol"; import { ISablierV2Batch } from "../../src/interfaces/ISablierV2Batch.sol"; import { ISablierV2MerkleStreamerFactory } from "../../src/interfaces/ISablierV2MerkleStreamerFactory.sol"; diff --git a/test/utils/MerkleBuilder.sol b/test/utils/MerkleBuilder.sol index 986019a1..e0a454bd 100644 --- a/test/utils/MerkleBuilder.sol +++ b/test/utils/MerkleBuilder.sol @@ -2,7 +2,7 @@ // solhint-disable reason-string pragma solidity >=0.8.19; -import { LibSort } from "solady/utils/LibSort.sol"; +import { LibSort } from "solady/src/utils/LibSort.sol"; /// @dev A helper library for building Merkle leaves, roots, and proofs. library MerkleBuilder { diff --git a/test/utils/MerkleBuilder.t.sol b/test/utils/MerkleBuilder.t.sol index 1bfd67ca..38963573 100644 --- a/test/utils/MerkleBuilder.t.sol +++ b/test/utils/MerkleBuilder.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.19; -import { PRBTest } from "@prb/test/PRBTest.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; +import { PRBTest } from "@prb/test/src/PRBTest.sol"; +import { StdUtils } from "forge-std/src/StdUtils.sol"; import { MerkleBuilder } from "./MerkleBuilder.sol"; diff --git a/test/utils/Precompiles.t.sol b/test/utils/Precompiles.t.sol index 4d61f24a..ed23578e 100644 --- a/test/utils/Precompiles.t.sol +++ b/test/utils/Precompiles.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.19 <0.9.0; -import { LibString } from "solady/utils/LibString.sol"; +import { LibString } from "solady/src/utils/LibString.sol"; import { ISablierV2Batch } from "../../src/interfaces/ISablierV2Batch.sol"; import { ISablierV2MerkleStreamerFactory } from "../../src/interfaces/ISablierV2MerkleStreamerFactory.sol";