From 377b194efab3febc1ef41c645e6ea4f185d19beb Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Wed, 18 Oct 2023 14:38:00 +0300 Subject: [PATCH 1/5] feat: remove proxy plugin and archive refactor: update scripts accordingly test: update tests accordingly ci: update ci workflows accordingly --- .github/workflows/deploy-archive.yml | 54 ---------- .github/workflows/deploy-periphery.yml | 7 +- .github/workflows/deploy-proxy-plugin.yml | 53 --------- .github/workflows/list-in-archive.yml | 55 ---------- SECURITY.md | 3 - foundry.toml | 2 - script/DeployArchive.s.sol | 12 --- script/DeployDeterministicArchive.s.sol | 24 ----- script/DeployDeterministicPeriphery.s.sol | 20 +--- script/DeployDeterministicProxyPlugin.s.sol | 25 ----- script/DeployPeriphery.s.sol | 23 ++-- script/DeployProtocol.s.sol | 13 +-- script/DeployProxyPlugin.s.sol | 13 --- script/ListInArchive.s.sol | 12 --- shell/prepare-artifacts.sh | 4 - shell/update-precompiles.sh | 4 - src/SablierV2Archive.sol | 62 ----------- src/SablierV2ProxyPlugin.sol | 101 ------------------ src/interfaces/ISablierV2Archive.sol | 53 --------- src/interfaces/ISablierV2ProxyPlugin.sol | 20 ---- src/libraries/Errors.sol | 7 -- src/types/Proxy.sol | 1 - test/Base.t.sol | 15 +-- test/fork/assets/USDC.t.sol | 3 - test/fork/assets/USDT.t.sol | 3 - test/fork/plugin/onStreamCanceled.t.sol | 74 ------------- test/integration/archive/list/list.t.sol | 38 ------- test/integration/archive/list/list.tree | 9 -- test/integration/archive/unlist/unlist.t.sol | 38 ------- test/integration/archive/unlist/unlist.tree | 9 -- .../plugin/get-methods/getMethods.t.sol | 15 --- .../on-stream-canceled/onStreamCanceled.t.sol | 90 ---------------- .../on-stream-canceled/onStreamCanceled.tree | 8 -- test/utils/DeployOptimized.sol | 38 ++----- test/utils/Events.sol | 2 - test/utils/Precompiles.sol | 47 ++------ test/utils/Precompiles.t.sol | 39 +------ 37 files changed, 29 insertions(+), 967 deletions(-) delete mode 100644 .github/workflows/deploy-archive.yml delete mode 100644 .github/workflows/deploy-proxy-plugin.yml delete mode 100644 .github/workflows/list-in-archive.yml delete mode 100644 script/DeployArchive.s.sol delete mode 100644 script/DeployDeterministicArchive.s.sol delete mode 100644 script/DeployDeterministicProxyPlugin.s.sol delete mode 100644 script/DeployProxyPlugin.s.sol delete mode 100644 script/ListInArchive.s.sol delete mode 100644 src/SablierV2Archive.sol delete mode 100644 src/SablierV2ProxyPlugin.sol delete mode 100644 src/interfaces/ISablierV2Archive.sol delete mode 100644 src/interfaces/ISablierV2ProxyPlugin.sol delete mode 100644 test/fork/plugin/onStreamCanceled.t.sol delete mode 100644 test/integration/archive/list/list.t.sol delete mode 100644 test/integration/archive/list/list.tree delete mode 100644 test/integration/archive/unlist/unlist.t.sol delete mode 100644 test/integration/archive/unlist/unlist.tree delete mode 100644 test/integration/plugin/get-methods/getMethods.t.sol delete mode 100644 test/integration/plugin/on-stream-canceled/onStreamCanceled.t.sol delete mode 100644 test/integration/plugin/on-stream-canceled/onStreamCanceled.tree diff --git a/.github/workflows/deploy-archive.yml b/.github/workflows/deploy-archive.yml deleted file mode 100644 index 60d58455..00000000 --- a/.github/workflows/deploy-archive.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "Deploy Archive" - -env: - API_KEY_ARBISCAN: ${{ secrets.API_KEY_ARBISCAN }} - API_KEY_BSCSCAN: ${{ secrets.API_KEY_BSCSCAN }} - API_KEY_ETHERSCAN: ${{ secrets.API_KEY_ETHERSCAN }} - API_KEY_GNOSISSCAN: ${{ secrets.API_KEY_GNOSISSCAN }} - API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }} - API_KEY_OPTIMISTIC_ETHERSCAN: ${{ secrets.API_KEY_OPTIMISTIC_ETHERSCAN }} - API_KEY_POLYGONSCAN: ${{ secrets.API_KEY_POLYGONSCAN }} - API_KEY_SNOWTRACE: ${{ secrets.API_KEY_SNOWTRACE }} - FOUNDRY_PROFILE: "optimized" - MNEMONIC: ${{ secrets.MNEMONIC }} - RPC_URL_GOERLI: ${{ secrets.RPC_URL_GOERLI }} - RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }} - -on: - workflow_dispatch: - inputs: - admin: - default: "0xF3663da48030b6c88535413Fd643aB0B5F3496ff" - description: "Initial contract admin." - required: false - chain: - default: "goerli" - description: "Chain name as defined in the Foundry config." - required: false - -jobs: - deploy-archive: - runs-on: "ubuntu-latest" - steps: - - name: "Check out the repo" - uses: "actions/checkout@v3" - with: - submodules: "recursive" - - - name: "Install Foundry" - uses: "foundry-rs/foundry-toolchain@v1" - - - name: "Deploy the SablierV2Archive contract" - run: >- - forge script script/DeployArchive.s.sol - --broadcast - --rpc-url "${{ inputs.chain }}" - --sig "run(address)" - --verify - -vvvv - "${{ inputs.admin }}" - - - name: "Add workflow summary" - run: | - echo "## Result" >> $GITHUB_STEP_SUMMARY - echo "✅ Done" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/deploy-periphery.yml b/.github/workflows/deploy-periphery.yml index fc9d9139..57ef2671 100644 --- a/.github/workflows/deploy-periphery.yml +++ b/.github/workflows/deploy-periphery.yml @@ -17,10 +17,6 @@ env: on: workflow_dispatch: inputs: - admin: - default: "0xF3663da48030b6c88535413Fd643aB0B5F3496ff" - description: "Initial protocol admin." - required: false chain: default: "goerli" description: "Chain name as defined in the Foundry config." @@ -48,10 +44,9 @@ jobs: forge script script/DeployPeriphery.s.sol --broadcast --rpc-url "${{ inputs.chain }}" - --sig "run(address,address)" + --sig "run(address)" --verify -vvvv - "${{ inputs.admin }}" "${{ inputs.permit2 }}" - name: "Add workflow summary" diff --git a/.github/workflows/deploy-proxy-plugin.yml b/.github/workflows/deploy-proxy-plugin.yml deleted file mode 100644 index ea7bf262..00000000 --- a/.github/workflows/deploy-proxy-plugin.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: "Deploy ProxyPlugin" - -env: - API_KEY_ARBISCAN: ${{ secrets.API_KEY_ARBISCAN }} - API_KEY_BSCSCAN: ${{ secrets.API_KEY_BSCSCAN }} - API_KEY_ETHERSCAN: ${{ secrets.API_KEY_ETHERSCAN }} - API_KEY_GNOSISSCAN: ${{ secrets.API_KEY_GNOSISSCAN }} - API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }} - API_KEY_OPTIMISTIC_ETHERSCAN: ${{ secrets.API_KEY_OPTIMISTIC_ETHERSCAN }} - API_KEY_POLYGONSCAN: ${{ secrets.API_KEY_POLYGONSCAN }} - API_KEY_SNOWTRACE: ${{ secrets.API_KEY_SNOWTRACE }} - FOUNDRY_PROFILE: "optimized" - MNEMONIC: ${{ secrets.MNEMONIC }} - RPC_URL_GOERLI: ${{ secrets.RPC_URL_GOERLI }} - RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }} - -on: - workflow_dispatch: - inputs: - archive: - description: "Archive contract address." - required: true - chain: - default: "goerli" - description: "Chain name as defined in the Foundry config." - required: false - -jobs: - deploy-proxy-plugin: - runs-on: "ubuntu-latest" - steps: - - name: "Check out the repo" - uses: "actions/checkout@v3" - with: - submodules: "recursive" - - - name: "Install Foundry" - uses: "foundry-rs/foundry-toolchain@v1" - - - name: "Deploy the SablierV2ProxyPlugin contract" - run: >- - forge script script/DeployProxyPlugin.s.sol - --broadcast - --rpc-url "${{ inputs.chain }}" - --sig "run(address)" - --verify - -vvvv - "${{ inputs.archive }}" - - - name: "Add workflow summary" - run: | - echo "## Result" >> $GITHUB_STEP_SUMMARY - echo "✅ Done" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/list-in-archive.yml b/.github/workflows/list-in-archive.yml deleted file mode 100644 index 22259c58..00000000 --- a/.github/workflows/list-in-archive.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: "List in Archive" - -env: - API_KEY_ARBISCAN: ${{ secrets.API_KEY_ARBISCAN }} - API_KEY_BSCSCAN: ${{ secrets.API_KEY_BSCSCAN }} - API_KEY_ETHERSCAN: ${{ secrets.API_KEY_ETHERSCAN }} - API_KEY_GNOSISSCAN: ${{ secrets.API_KEY_GNOSISSCAN }} - API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }} - API_KEY_OPTIMISTIC_ETHERSCAN: ${{ secrets.API_KEY_OPTIMISTIC_ETHERSCAN }} - API_KEY_POLYGONSCAN: ${{ secrets.API_KEY_POLYGONSCAN }} - API_KEY_SNOWTRACE: ${{ secrets.API_KEY_SNOWTRACE }} - MNEMONIC: ${{ secrets.MNEMONIC }} - RPC_URL_GOERLI: ${{ secrets.RPC_URL_GOERLI }} - RPC_URL_MAINNET: ${{ secrets.RPC_URL_MAINNET }} - -on: - workflow_dispatch: - inputs: - address: - description: "Contract to list in the archive." - required: true - archive: - description: "Address of the archive contract." - required: true - chain: - default: "goerli" - description: "Chain name as defined in the Foundry config." - required: false - -jobs: - list-in-archive: - runs-on: "ubuntu-latest" - steps: - - name: "Check out the repo" - uses: "actions/checkout@v3" - with: - submodules: "recursive" - - - name: "Install Foundry" - uses: "foundry-rs/foundry-toolchain@v1" - - - name: "List the provided address in the archive" - run: >- - forge script script/ListInArchive.s.sol - --broadcast - --rpc-url "${{ inputs.chain }}" - --sig "run(address,address)" - -vvvv - "${{ inputs.archive }}" - "${{ inputs.address }}" - - - name: "Add workflow summary" - run: | - echo "## Result" >> $GITHUB_STEP_SUMMARY - echo "✅ Done" >> $GITHUB_STEP_SUMMARY diff --git a/SECURITY.md b/SECURITY.md index be27b3e8..70f68b5f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -45,9 +45,6 @@ Vulnerabilities contingent upon the occurrence of any of the following also are Sablier V2 Periphery has been developed with a number of technical assumptions in mind. For a disclosure to qualify as a vulnerability, it must adhere to these assumptions as well: -- Every user creating streams via `SablierV2ProxyTarget` has a `SablierV2ProxyPlugin` contract installed for the - `onStreamCanceled` method. -- All relevant Sablier contracts are listed in the `SablierV2Archive` contract. - [All assumptions](https://github.com/sablier-labs/v2-core/blob/main/SECURITY.md) in Sablier V2 Core apply to Sablier V2 Periphery as well. diff --git a/foundry.toml b/foundry.toml index 015eb70b..1f424036 100644 --- a/foundry.toml +++ b/foundry.toml @@ -5,10 +5,8 @@ evm_version = "paris" fs_permissions = [{ access = "read", path = "out-optimized" }] gas_reports = [ - "SablierV2Archive", "SablierV2MerkleStreamerFactory", "SablierV2MerkleStreamerLL", - "SablierV2ProxyPlugin", "SablierV2ProxyTarget", ] libs = ["lib"] diff --git a/script/DeployArchive.s.sol b/script/DeployArchive.s.sol deleted file mode 100644 index 009b6423..00000000 --- a/script/DeployArchive.s.sol +++ /dev/null @@ -1,12 +0,0 @@ -// 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 { SablierV2Archive } from "../src/SablierV2Archive.sol"; - -contract DeployArchive is BaseScript { - function run(address initialAdmin) public broadcast returns (SablierV2Archive archive) { - archive = new SablierV2Archive(initialAdmin); - } -} diff --git a/script/DeployDeterministicArchive.s.sol b/script/DeployDeterministicArchive.s.sol deleted file mode 100644 index 725ed707..00000000 --- a/script/DeployDeterministicArchive.s.sol +++ /dev/null @@ -1,24 +0,0 @@ -// 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 { SablierV2Archive } from "../src/SablierV2Archive.sol"; - -/// @notice Deploys {SablierV2Archive} at a deterministic address across chains. -/// @dev Reverts if the contract has already been deployed. -contract DeployDeterministicArchive is BaseScript { - /// @dev The presence of the salt instructs Forge to deploy contracts via this deterministic CREATE2 factory: - /// https://github.com/Arachnid/deterministic-deployment-proxy - function run( - string memory create2Salt, - address initialAdmin - ) - public - virtual - broadcast - returns (SablierV2Archive archive) - { - archive = new SablierV2Archive{ salt: bytes32(abi.encodePacked(create2Salt)) }(initialAdmin); - } -} diff --git a/script/DeployDeterministicPeriphery.s.sol b/script/DeployDeterministicPeriphery.s.sol index 41c931cf..1e310991 100644 --- a/script/DeployDeterministicPeriphery.s.sol +++ b/script/DeployDeterministicPeriphery.s.sol @@ -4,31 +4,25 @@ pragma solidity >=0.8.19 <0.9.0; import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransfer.sol"; -import { SablierV2Archive } from "../src/SablierV2Archive.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; -import { SablierV2ProxyPlugin } from "../src/SablierV2ProxyPlugin.sol"; import { SablierV2ProxyTargetApprove } from "../src/SablierV2ProxyTargetApprove.sol"; import { SablierV2ProxyTargetPermit2 } from "../src/SablierV2ProxyTargetPermit2.sol"; import { SablierV2ProxyTargetPush } from "../src/SablierV2ProxyTargetPush.sol"; /// @notice Deploys all V2 Periphery contracts at deterministic addresses across chains, in the following order: /// -/// 1. {SablierV2Archive} -/// 2. {SablierV2Batch} -/// 3. {SablierV2MerkleStreamerFactory} -/// 4. {SablierV2ProxyPlugin} -/// 5. {SablierV2ProxyTargetApprove} -/// 6. {SablierV2ProxyTargetPermit2} -/// 7. {SablierV2ProxyTargetPush} +/// 1. {SablierV2Batch} +/// 2. {SablierV2MerkleStreamerFactory} +/// 3. {SablierV2ProxyTargetApprove} +/// 4. {SablierV2ProxyTargetPermit2} +/// 5. {SablierV2ProxyTargetPush} /// /// @dev Reverts if any contract has already been deployed. contract DeployDeterministicPeriphery is BaseScript { struct DeployedContracts { - SablierV2Archive archive; SablierV2Batch batch; SablierV2MerkleStreamerFactory merkleStreamerFactory; - SablierV2ProxyPlugin plugin; SablierV2ProxyTargetApprove targetApprove; SablierV2ProxyTargetPermit2 targetPermit2; SablierV2ProxyTargetPush targetPush; @@ -38,7 +32,6 @@ contract DeployDeterministicPeriphery is BaseScript { /// https://github.com/Arachnid/deterministic-deployment-proxy function run( string memory create2Salt, - address initialAdmin, IAllowanceTransfer permit2 ) public @@ -46,12 +39,9 @@ contract DeployDeterministicPeriphery is BaseScript { broadcast returns (DeployedContracts memory deployedContracts) { - deployedContracts.archive = new SablierV2Archive{ salt: bytes32(abi.encodePacked(create2Salt)) }(initialAdmin); deployedContracts.batch = new SablierV2Batch{ salt: bytes32(abi.encodePacked(create2Salt)) }(); deployedContracts.merkleStreamerFactory = new SablierV2MerkleStreamerFactory{ salt: bytes32(abi.encodePacked(create2Salt)) }(); - deployedContracts.plugin = - new SablierV2ProxyPlugin{ salt: bytes32(abi.encodePacked(create2Salt)) }(deployedContracts.archive); deployedContracts.targetApprove = new SablierV2ProxyTargetApprove{ salt: bytes32(abi.encodePacked(create2Salt)) }(); deployedContracts.targetPermit2 = diff --git a/script/DeployDeterministicProxyPlugin.s.sol b/script/DeployDeterministicProxyPlugin.s.sol deleted file mode 100644 index 0dfc48e7..00000000 --- a/script/DeployDeterministicProxyPlugin.s.sol +++ /dev/null @@ -1,25 +0,0 @@ -// 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 { ISablierV2Archive } from "../src/interfaces/ISablierV2Archive.sol"; -import { SablierV2ProxyPlugin } from "../src/SablierV2ProxyPlugin.sol"; - -/// @notice Deploys {SablierV2ProxyPlugin} at a deterministic address across chains. -/// @dev Reverts if the contract has already been deployed. -contract DeployDeterministicProxyPlugin is BaseScript { - /// @dev The presence of the salt instructs Forge to deploy contracts via this deterministic CREATE2 factory: - /// https://github.com/Arachnid/deterministic-deployment-proxy - function run( - string memory create2Salt, - ISablierV2Archive archive - ) - public - virtual - broadcast - returns (SablierV2ProxyPlugin plugin) - { - plugin = new SablierV2ProxyPlugin{ salt: bytes32(abi.encodePacked(create2Salt)) }(archive); - } -} diff --git a/script/DeployPeriphery.s.sol b/script/DeployPeriphery.s.sol index 15831380..9d6fd811 100644 --- a/script/DeployPeriphery.s.sol +++ b/script/DeployPeriphery.s.sol @@ -5,43 +5,32 @@ import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransfer.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; -import { SablierV2Archive } from "../src/SablierV2Archive.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; -import { SablierV2ProxyPlugin } from "../src/SablierV2ProxyPlugin.sol"; import { SablierV2ProxyTargetApprove } from "../src/SablierV2ProxyTargetApprove.sol"; import { SablierV2ProxyTargetPermit2 } from "../src/SablierV2ProxyTargetPermit2.sol"; import { SablierV2ProxyTargetPush } from "../src/SablierV2ProxyTargetPush.sol"; /// @notice Deploys all V2 Periphery contract in the following order: /// -/// 1. {SablierV2Archive} -/// 2. {SablierV2Batch} -/// 3. {SablierV2MerkleStreamerFactory} -/// 4. {SablierV2ProxyPlugin} -/// 5. {SablierV2ProxyTargetApprove} -/// 6. {SablierV2ProxyTargetPermit2} -/// 7. {SablierV2ProxyTargetPush} +/// 1. {SablierV2Batch} +/// 2. {SablierV2MerkleStreamerFactory} +/// 3. {SablierV2ProxyTargetApprove} +/// 4. {SablierV2ProxyTargetPermit2} +/// 5. {SablierV2ProxyTargetPush} contract DeployPeriphery is BaseScript { - function run( - address initialAdmin, - IAllowanceTransfer permit2 - ) + function run(IAllowanceTransfer permit2) public broadcast returns ( - SablierV2Archive archive, SablierV2Batch batch, SablierV2MerkleStreamerFactory merkleStreamerFactory, - SablierV2ProxyPlugin plugin, SablierV2ProxyTargetApprove targetApprove, SablierV2ProxyTargetPermit2 targetPermit2, SablierV2ProxyTargetPush targetPush ) { - archive = new SablierV2Archive(initialAdmin); batch = new SablierV2Batch(); merkleStreamerFactory = new SablierV2MerkleStreamerFactory(); - plugin = new SablierV2ProxyPlugin(archive); targetApprove = new SablierV2ProxyTargetApprove(); targetPermit2 = new SablierV2ProxyTargetPermit2(permit2); targetPush = new SablierV2ProxyTargetPush(); diff --git a/script/DeployProtocol.s.sol b/script/DeployProtocol.s.sol index d0e73fa1..79004978 100644 --- a/script/DeployProtocol.s.sol +++ b/script/DeployProtocol.s.sol @@ -9,14 +9,12 @@ import { BaseScript } from "@sablier/v2-core-script/Base.s.sol"; import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransfer.sol"; import { SablierV2MerkleStreamerFactory } from "../src/SablierV2MerkleStreamerFactory.sol"; -import { SablierV2Archive } from "../src/SablierV2Archive.sol"; import { SablierV2Batch } from "../src/SablierV2Batch.sol"; -import { SablierV2ProxyPlugin } from "../src/SablierV2ProxyPlugin.sol"; import { SablierV2ProxyTargetApprove } from "../src/SablierV2ProxyTargetApprove.sol"; import { SablierV2ProxyTargetPermit2 } from "../src/SablierV2ProxyTargetPermit2.sol"; import { SablierV2ProxyTargetPush } from "../src/SablierV2ProxyTargetPush.sol"; -/// @notice Deploys the Sablier V2 Protocol and lists the streaming contracts in the archive. +/// @notice Deploys the Sablier V2 Protocol. contract DeployProtocol is BaseScript { function run( address initialAdmin, @@ -31,10 +29,8 @@ contract DeployProtocol is BaseScript { SablierV2LockupDynamic lockupDynamic, SablierV2LockupLinear lockupLinear, SablierV2NFTDescriptor nftDescriptor, - SablierV2Archive archive, SablierV2Batch batch, SablierV2MerkleStreamerFactory merkleStreamerFactory, - SablierV2ProxyPlugin plugin, SablierV2ProxyTargetApprove targetApprove, SablierV2ProxyTargetPermit2 targetPermit2, SablierV2ProxyTargetPush targetPush @@ -46,15 +42,8 @@ contract DeployProtocol is BaseScript { lockupDynamic = new SablierV2LockupDynamic(initialAdmin, comptroller, nftDescriptor, maxSegmentCount); lockupLinear = new SablierV2LockupLinear(initialAdmin, comptroller, nftDescriptor); - // Deploy V2 Periphery. The Archive needs its own context block to prevent Stack Too Deep. - { - archive = new SablierV2Archive(initialAdmin); - archive.list(address(lockupDynamic)); - archive.list(address(lockupLinear)); - } batch = new SablierV2Batch(); merkleStreamerFactory = new SablierV2MerkleStreamerFactory(); - plugin = new SablierV2ProxyPlugin(archive); targetApprove = new SablierV2ProxyTargetApprove(); targetPermit2 = new SablierV2ProxyTargetPermit2(permit2); targetPush = new SablierV2ProxyTargetPush(); diff --git a/script/DeployProxyPlugin.s.sol b/script/DeployProxyPlugin.s.sol deleted file mode 100644 index c2f15a83..00000000 --- a/script/DeployProxyPlugin.s.sol +++ /dev/null @@ -1,13 +0,0 @@ -// 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 { ISablierV2Archive } from "../src/interfaces/ISablierV2Archive.sol"; -import { SablierV2ProxyPlugin } from "../src/SablierV2ProxyPlugin.sol"; - -contract DeployProxyPlugin is BaseScript { - function run(ISablierV2Archive archive) public broadcast returns (SablierV2ProxyPlugin plugin) { - plugin = new SablierV2ProxyPlugin(archive); - } -} diff --git a/script/ListInArchive.s.sol b/script/ListInArchive.s.sol deleted file mode 100644 index 6510c2ee..00000000 --- a/script/ListInArchive.s.sol +++ /dev/null @@ -1,12 +0,0 @@ -// 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 { ISablierV2Archive } from "../src/interfaces/ISablierV2Archive.sol"; - -contract ListInArchive is BaseScript { - function run(ISablierV2Archive archive, address addr) public broadcast { - archive.list(addr); - } -} diff --git a/shell/prepare-artifacts.sh b/shell/prepare-artifacts.sh index 507b4ac1..50c239b1 100755 --- a/shell/prepare-artifacts.sh +++ b/shell/prepare-artifacts.sh @@ -25,21 +25,17 @@ mkdir $artifacts \ FOUNDRY_PROFILE=optimized forge build # Copy the production artifacts -cp out-optimized/SablierV2Archive.sol/SablierV2Archive.json $artifacts cp out-optimized/SablierV2Batch.sol/SablierV2Batch.json $artifacts cp out-optimized/SablierV2MerkleStreamerFactory.sol/SablierV2MerkleStreamerFactory.json $artifacts cp out-optimized/SablierV2MerkleStreamerLL.sol/SablierV2MerkleStreamerLL.json $artifacts -cp out-optimized/SablierV2ProxyPlugin.sol/SablierV2ProxyPlugin.json $artifacts cp out-optimized/SablierV2ProxyTargetApprove.sol/SablierV2ProxyTargetApprove.json $artifacts cp out-optimized/SablierV2ProxyTargetPermit2.sol/SablierV2ProxyTargetPermit2.json $artifacts cp out-optimized/SablierV2ProxyTargetPush.sol/SablierV2ProxyTargetPush.json $artifacts interfaces=./artifacts/interfaces -cp out-optimized/ISablierV2Archive.sol/ISablierV2Archive.json $interfaces cp out-optimized/ISablierV2Batch.sol/ISablierV2Batch.json $interfaces cp out-optimized/ISablierV2MerkleStreamerFactory.sol/ISablierV2MerkleStreamerFactory.json $interfaces cp out-optimized/ISablierV2MerkleStreamerLL.sol/ISablierV2MerkleStreamerLL.json $interfaces -cp out-optimized/ISablierV2ProxyPlugin.sol/ISablierV2ProxyPlugin.json $interfaces cp out-optimized/ISablierV2ProxyTarget.sol/ISablierV2ProxyTarget.json $interfaces erc20=./artifacts/interfaces/erc20 diff --git a/shell/update-precompiles.sh b/shell/update-precompiles.sh index 2605dd89..f57fa41c 100755 --- a/shell/update-precompiles.sh +++ b/shell/update-precompiles.sh @@ -12,10 +12,8 @@ set -euo pipefail FOUNDRY_PROFILE=optimized forge build # Retrieve the raw bytecodes, removing the "0x" prefix -archive=$(cat out-optimized/SablierV2Archive.sol/SablierV2Archive.json | jq -r '.bytecode.object' | cut -c 3-) batch=$(cat out-optimized/SablierV2Batch.sol/SablierV2Batch.json | jq -r '.bytecode.object' | cut -c 3-) merkle_streamer_factory=$(cat out-optimized/SablierV2MerkleStreamerFactory.sol/SablierV2MerkleStreamerFactory.json | jq -r '.bytecode.object' | cut -c 3-) -proxy_plugin=$(cat out-optimized/SablierV2ProxyPlugin.sol/SablierV2ProxyPlugin.json | jq -r '.bytecode.object' | cut -c 3-) proxy_target_approve=$(cat out-optimized/SablierV2ProxyTargetApprove.sol/SablierV2ProxyTargetApprove.json | jq -r '.bytecode.object' | cut -c 3-) proxy_target_permit2=$(cat out-optimized/SablierV2ProxyTargetPermit2.sol/SablierV2ProxyTargetPermit2.json | jq -r '.bytecode.object' | cut -c 3-) proxy_target_push=$(cat out-optimized/SablierV2ProxyTargetPush.sol/SablierV2ProxyTargetPush.json | jq -r '.bytecode.object' | cut -c 3-) @@ -27,10 +25,8 @@ if [ ! -f $precompiles_path ]; then fi # Replace the current bytecodes -sd "(BYTECODE_ARCHIVE =)[^;]+;" "\$1 hex\"$archive\";" $precompiles_path sd "(BYTECODE_BATCH =)[^;]+;" "\$1 hex\"$batch\";" $precompiles_path sd "(BYTECODE_MERKLE_STREAMER_FACTORY =)[^;]+;" "\$1 hex\"$merkle_streamer_factory\";" $precompiles_path -sd "(BYTECODE_PROXY_PLUGIN =)[^;]+;" "\$1 hex\"$proxy_plugin\";" $precompiles_path sd "(BYTECODE_PROXY_TARGET_APPROVE =)[^;]+;" "\$1 hex\"$proxy_target_approve\";" $precompiles_path sd "(BYTECODE_PROXY_TARGET_PERMIT2 =)[^;]+;" "\$1 hex\"$proxy_target_permit2\";" $precompiles_path sd "(BYTECODE_PROXY_TARGET_PUSH =)[^;]+;" "\$1 hex\"$proxy_target_push\";" $precompiles_path diff --git a/src/SablierV2Archive.sol b/src/SablierV2Archive.sol deleted file mode 100644 index 85a5ddfd..00000000 --- a/src/SablierV2Archive.sol +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.19; - -import { Adminable } from "@sablier/v2-core/src/abstracts/Adminable.sol"; - -import { ISablierV2Archive } from "./interfaces/ISablierV2Archive.sol"; - -/* - -███████╗ █████╗ ██████╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗██████╗ -██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗ ██║ ██║╚════██╗ -███████╗███████║██████╔╝██║ ██║█████╗ ██████╔╝ ██║ ██║ █████╔╝ -╚════██║██╔══██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗ ╚██╗ ██╔╝██╔═══╝ -███████║██║ ██║██████╔╝███████╗██║███████╗██║ ██║ ╚████╔╝ ███████╗ -╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝ - - █████╗ ██████╗ ██████╗██╗ ██╗██╗██╗ ██╗███████╗ -██╔══██╗██╔══██╗██╔════╝██║ ██║██║██║ ██║██╔════╝ -███████║██████╔╝██║ ███████║██║██║ ██║█████╗ -██╔══██║██╔══██╗██║ ██╔══██║██║╚██╗ ██╔╝██╔══╝ -██║ ██║██║ ██║╚██████╗██║ ██║██║ ╚████╔╝ ███████╗ -╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚══════╝ - -*/ - -/// @title SablierV2Archive -/// @dev See the documentation in {ISablierV2Archive}. -contract SablierV2Archive is - ISablierV2Archive, // 1 inherited component - Adminable // 1 inherited component -{ - /*////////////////////////////////////////////////////////////////////////// - USER-FACING STORAGE - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc ISablierV2Archive - mapping(address addr => bool listed) public override isListed; - - /*////////////////////////////////////////////////////////////////////////// - CONSTRUCTOR - //////////////////////////////////////////////////////////////////////////*/ - - constructor(address initialAdmin) { - admin = initialAdmin; - } - - /*////////////////////////////////////////////////////////////////////////// - USER-FACING NON-CONSTANT FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc ISablierV2Archive - function list(address addr) external onlyAdmin { - isListed[addr] = true; - emit List({ admin: msg.sender, addr: addr }); - } - - /// @inheritdoc ISablierV2Archive - function unlist(address addr) external onlyAdmin { - isListed[addr] = false; - emit Unlist({ admin: msg.sender, addr: addr }); - } -} diff --git a/src/SablierV2ProxyPlugin.sol b/src/SablierV2ProxyPlugin.sol deleted file mode 100644 index c4baa34d..00000000 --- a/src/SablierV2ProxyPlugin.sol +++ /dev/null @@ -1,101 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.19; - -import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import { IPRBProxy } from "@prb/proxy/src/interfaces/IPRBProxy.sol"; -import { IPRBProxyPlugin } from "@prb/proxy/src/interfaces/IPRBProxyPlugin.sol"; -import { ISablierV2Lockup } from "@sablier/v2-core/src/interfaces/ISablierV2Lockup.sol"; -import { ISablierV2LockupSender } from "@sablier/v2-core/src/interfaces/hooks/ISablierV2LockupSender.sol"; - -import { OnlyDelegateCall } from "./abstracts/OnlyDelegateCall.sol"; -import { ISablierV2Archive } from "./interfaces/ISablierV2Archive.sol"; -import { ISablierV2ProxyPlugin } from "./interfaces/ISablierV2ProxyPlugin.sol"; -import { Errors } from "./libraries/Errors.sol"; - -/* - -███████╗ █████╗ ██████╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗██████╗ -██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗ ██║ ██║╚════██╗ -███████╗███████║██████╔╝██║ ██║█████╗ ██████╔╝ ██║ ██║ █████╔╝ -╚════██║██╔══██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗ ╚██╗ ██╔╝██╔═══╝ -███████║██║ ██║██████╔╝███████╗██║███████╗██║ ██║ ╚████╔╝ ███████╗ -╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝ - -██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██████╗ ██╗███╗ ██╗ -██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ ██╔══██╗██║ ██║ ██║██╔════╝ ██║████╗ ██║ -██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ ██████╔╝██║ ██║ ██║██║ ███╗██║██╔██╗ ██║ -██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ ██╔═══╝ ██║ ██║ ██║██║ ██║██║██║╚██╗██║ -██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ ██║ ███████╗╚██████╔╝╚██████╔╝██║██║ ╚████║ -╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝╚═╝ ╚═══╝ - -*/ - -/// @title SablierV2ProxyPlugin -/// @notice See the documentation in {ISablierV2ProxyPlugin}. -contract SablierV2ProxyPlugin is - OnlyDelegateCall, // 0 inherited components - ISablierV2ProxyPlugin // 2 inherited components -{ - using SafeERC20 for IERC20; - - /*////////////////////////////////////////////////////////////////////////// - CONSTANTS - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc ISablierV2ProxyPlugin - ISablierV2Archive public immutable override ARCHIVE; - - /*////////////////////////////////////////////////////////////////////////// - CONSTRUCTOR - //////////////////////////////////////////////////////////////////////////*/ - - constructor(ISablierV2Archive archive) { - ARCHIVE = archive; - } - - /*////////////////////////////////////////////////////////////////////////// - CONSTANT FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc IPRBProxyPlugin - function getMethods() external pure returns (bytes4[] memory methods) { - methods = new bytes4[](1); - methods[0] = this.onStreamCanceled.selector; - } - - /*////////////////////////////////////////////////////////////////////////// - NON-CONSTANT FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - /// @inheritdoc ISablierV2LockupSender - /// @notice Forwards the refunded assets to the proxy owner when the recipient cancels a stream whose sender is the - /// proxy contract. - /// @dev Requirements: - /// - Must be delegate called. - /// - The caller must be an address listed in the archive. - function onStreamCanceled( - uint256 streamId, - address, /* recipient */ - uint128 senderAmount, - uint128 /* recipientAmount */ - ) - external - onlyDelegateCall - { - // Checks: the caller is an address listed in the archive. - if (!ARCHIVE.isListed(msg.sender)) { - revert Errors.SablierV2ProxyPlugin_UnknownCaller(msg.sender); - } - - // This invariant should always hold but it's better to be safe than sorry. - ISablierV2Lockup lockup = ISablierV2Lockup(msg.sender); - address streamSender = lockup.getSender(streamId); - assert(streamSender == address(this)); - - // Effects: forward the refunded assets to the proxy owner. - IERC20 asset = lockup.getAsset(streamId); - address owner = IPRBProxy(address(this)).owner(); - asset.safeTransfer({ to: owner, value: senderAmount }); - } -} diff --git a/src/interfaces/ISablierV2Archive.sol b/src/interfaces/ISablierV2Archive.sol deleted file mode 100644 index a45ed5e8..00000000 --- a/src/interfaces/ISablierV2Archive.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.19; - -import { IAdminable } from "@sablier/v2-core/src/interfaces/IAdminable.sol"; - -/// @title ISablierV2Archive -/// @notice An on-chain contract registry that keeps a record of all Sablier V2 contracts, including old deployments. -interface ISablierV2Archive is IAdminable { - /*////////////////////////////////////////////////////////////////////////// - EVENTS - //////////////////////////////////////////////////////////////////////////*/ - - /// @notice Emitted when an address is listed in the archive. - event List(address indexed admin, address indexed addr); - - /// @notice Emitted when an address is unlisted from the archive. - event Unlist(address indexed admin, address indexed addr); - - /*////////////////////////////////////////////////////////////////////////// - CONSTANT FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - /// @notice A boolean flag that indicates whether the provided address is part of the archive. - function isListed(address addr) external returns (bool result); - - /*////////////////////////////////////////////////////////////////////////// - NON-CONSTANT FUNCTIONS - //////////////////////////////////////////////////////////////////////////*/ - - /// @notice Lists an address in the archive. - /// @dev Emits a {List} event. - /// - /// Notes: - /// - It is not an error to list an address that is already listed. - /// - /// Requirements: - /// - The caller must be the admin. - /// - /// @param addr The address to list in the archive, which should be a contract. - function list(address addr) external; - - /// @notice Unlists an address from the archive. - /// @dev Emits an {Unlist} event. - /// - /// Notes: - /// - It is not an error to unlist an address that is not already listed. - /// - /// Requirements: - /// - The caller must be the admin. - /// - /// @param addr The address to unlist from the archive, which is usually a contract address. - function unlist(address addr) external; -} diff --git a/src/interfaces/ISablierV2ProxyPlugin.sol b/src/interfaces/ISablierV2ProxyPlugin.sol deleted file mode 100644 index f4ccf804..00000000 --- a/src/interfaces/ISablierV2ProxyPlugin.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.19; - -import { IPRBProxyPlugin } from "@prb/proxy/src/interfaces/IPRBProxyPlugin.sol"; -import { ISablierV2LockupSender } from "@sablier/v2-core/src/interfaces/hooks/ISablierV2LockupSender.sol"; - -import { ISablierV2Archive } from "./ISablierV2Archive.sol"; - -/// @title ISablierV2ProxyPlugin -/// @notice Proxy plugin that forwards the refunded assets to the proxy owner when the recipient cancels a stream -/// whose sender is the proxy contract. -/// -/// The plugin works by implementing the hook interface defined in V2 Core. -interface ISablierV2ProxyPlugin is - ISablierV2LockupSender, // 0 inherited components - IPRBProxyPlugin // 0 inherited components -{ - /// @notice Retrieves the address of the archive contract. - function ARCHIVE() external view returns (ISablierV2Archive); -} diff --git a/src/libraries/Errors.sol b/src/libraries/Errors.sol index 4e411caf..f4e9af48 100644 --- a/src/libraries/Errors.sol +++ b/src/libraries/Errors.sol @@ -33,13 +33,6 @@ library Errors { /// @notice Thrown when trying to claim with an invalid Merkle proof. error SablierV2MerkleStreamer_InvalidProof(); - /*////////////////////////////////////////////////////////////////////////// - SABLIER-V2-PROXY-PLUGIN - //////////////////////////////////////////////////////////////////////////*/ - - /// @notice Thrown when the caller is an unknown address, which is not listed in the archive. - error SablierV2ProxyPlugin_UnknownCaller(address caller); - /*////////////////////////////////////////////////////////////////////////// SABLIER-V2-PROXY-TARGET //////////////////////////////////////////////////////////////////////////*/ diff --git a/src/types/Proxy.sol b/src/types/Proxy.sol index 71cef70f..cea59fcb 100644 --- a/src/types/Proxy.sol +++ b/src/types/Proxy.sol @@ -8,5 +8,4 @@ pragma solidity >=0.8.19; // that users don't have to install PRBProxy separately. import { IPRBProxy } from "@prb/proxy/src/interfaces/IPRBProxy.sol"; -import { IPRBProxyPlugin } from "@prb/proxy/src/interfaces/IPRBProxyPlugin.sol"; import { IPRBProxyRegistry } from "@prb/proxy/src/interfaces/IPRBProxyRegistry.sol"; diff --git a/test/Base.t.sol b/test/Base.t.sol index cfb5262f..db34a8f4 100644 --- a/test/Base.t.sol +++ b/test/Base.t.sol @@ -15,18 +15,14 @@ import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransf import { Utils as V2CoreUtils } from "@sablier/v2-core-test/utils/Utils.sol"; -import { ISablierV2Archive } from "src/interfaces/ISablierV2Archive.sol"; import { ISablierV2Batch } from "src/interfaces/ISablierV2Batch.sol"; import { ISablierV2MerkleStreamerFactory } from "src/interfaces/ISablierV2MerkleStreamerFactory.sol"; import { ISablierV2MerkleStreamerLL } from "src/interfaces/ISablierV2MerkleStreamerLL.sol"; -import { ISablierV2ProxyPlugin } from "src/interfaces/ISablierV2ProxyPlugin.sol"; import { ISablierV2ProxyTarget } from "src/interfaces/ISablierV2ProxyTarget.sol"; import { IWrappedNativeAsset } from "src/interfaces/IWrappedNativeAsset.sol"; -import { SablierV2Archive } from "src/SablierV2Archive.sol"; import { SablierV2Batch } from "src/SablierV2Batch.sol"; import { SablierV2MerkleStreamerFactory } from "src/SablierV2MerkleStreamerFactory.sol"; import { SablierV2MerkleStreamerLL } from "src/SablierV2MerkleStreamerLL.sol"; -import { SablierV2ProxyPlugin } from "src/SablierV2ProxyPlugin.sol"; import { SablierV2ProxyTargetApprove } from "src/SablierV2ProxyTargetApprove.sol"; import { SablierV2ProxyTargetPermit2 } from "src/SablierV2ProxyTargetPermit2.sol"; import { SablierV2ProxyTargetPush } from "src/SablierV2ProxyTargetPush.sol"; @@ -51,7 +47,6 @@ abstract contract Base_Test is Assertions, DeployOptimized, Events, Merkle, V2Co TEST CONTRACTS //////////////////////////////////////////////////////////////////////////*/ - ISablierV2Archive internal archive; IPRBProxy internal aliceProxy; IERC20 internal asset; ISablierV2Batch internal batch; @@ -61,7 +56,6 @@ abstract contract Base_Test is Assertions, DeployOptimized, Events, Merkle, V2Co ISablierV2MerkleStreamerFactory internal merkleStreamerFactory; ISablierV2MerkleStreamerLL internal merkleStreamerLL; IAllowanceTransfer internal permit2; - ISablierV2ProxyPlugin internal plugin; IPRBProxyRegistry internal proxyRegistry; ISablierV2ProxyTarget internal target; SablierV2ProxyTargetApprove internal targetApprove; @@ -114,19 +108,16 @@ abstract contract Base_Test is Assertions, DeployOptimized, Events, Merkle, V2Co deal({ token: address(asset), to: user.addr, give: 1_000_000e18 }); } - /// @dev Conditionally deploy V2 Periphery normally or from a source precompiled with `--via-ir`. + /// @dev Conditionally deploy V2 Periphery normally or from a optimized source compiled with `--via-ir`. function deployPeripheryConditionally() internal { if (!isTestOptimizedProfile()) { - archive = new SablierV2Archive(users.admin.addr); batch = new SablierV2Batch(); merkleStreamerFactory = new SablierV2MerkleStreamerFactory(); - plugin = new SablierV2ProxyPlugin(archive); targetApprove = new SablierV2ProxyTargetApprove(); targetPermit2 = new SablierV2ProxyTargetPermit2(permit2); targetPush = new SablierV2ProxyTargetPush(); } else { - (archive, batch, merkleStreamerFactory, plugin, targetApprove, targetPermit2, targetPush) = - deployOptimizedPeriphery(users.admin.addr, permit2); + (batch, merkleStreamerFactory, targetApprove, targetPermit2, targetPush) = deployOptimizedPeriphery(permit2); } // The default target. target = targetApprove; @@ -135,7 +126,6 @@ abstract contract Base_Test is Assertions, DeployOptimized, Events, Merkle, V2Co /// @dev Labels the most relevant contracts. function labelContracts() internal { vm.label({ account: address(aliceProxy), newLabel: "Alice's Proxy" }); - vm.label({ account: address(archive), newLabel: "Archive" }); vm.label({ account: address(asset), newLabel: IERC20Metadata(address(asset)).symbol() }); vm.label({ account: address(merkleStreamerFactory), newLabel: "MerkleStreamerFactory" }); vm.label({ account: address(merkleStreamerLL), newLabel: "MerkleStreamerLL" }); @@ -143,7 +133,6 @@ abstract contract Base_Test is Assertions, DeployOptimized, Events, Merkle, V2Co vm.label({ account: address(lockupDynamic), newLabel: "LockupDynamic" }); vm.label({ account: address(lockupLinear), newLabel: "LockupLinear" }); vm.label({ account: address(permit2), newLabel: "Permit2" }); - vm.label({ account: address(plugin), newLabel: "ProxyPlugin" }); vm.label({ account: address(targetApprove), newLabel: "ProxyTargetApprove" }); vm.label({ account: address(targetPermit2), newLabel: "ProxyTargetPermit2" }); vm.label({ account: address(targetPush), newLabel: "ProxyTargetPush" }); diff --git a/test/fork/assets/USDC.t.sol b/test/fork/assets/USDC.t.sol index 086bfbc1..0bfb0d7a 100644 --- a/test/fork/assets/USDC.t.sol +++ b/test/fork/assets/USDC.t.sol @@ -6,7 +6,6 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { CreateWithMilestones_Batch_Fork_Test } from "../batch/createWithMilestones.t.sol"; import { CreateWithRange_Batch_Fork_Test } from "../batch/createWithRange.t.sol"; import { MerkleStreamerLL_Fork_Test } from "../merkle-streamer/MerkleStreamerLL.t.sol"; -import { OnStreamCanceled_Fork_Test } from "../plugin/onStreamCanceled.t.sol"; import { BatchCancelMultiple_TargetApprove_Fork_Test, BatchCreate_TargetApprove_Fork_Test @@ -36,5 +35,3 @@ contract USDC_CreateWithMilestones_Batch_Fork_Test is CreateWithMilestones_Batch contract USDC_CreateWithRange_Batch_Fork_Test is CreateWithRange_Batch_Fork_Test(usdc) { } contract USDC_MerkleStreamerLL_Fork_Test is MerkleStreamerLL_Fork_Test(usdc) { } - -contract USDC_OnStreamCanceled_Plugin_Fork_Test is OnStreamCanceled_Fork_Test(usdc) { } diff --git a/test/fork/assets/USDT.t.sol b/test/fork/assets/USDT.t.sol index 2d3b9023..02a7fd96 100644 --- a/test/fork/assets/USDT.t.sol +++ b/test/fork/assets/USDT.t.sol @@ -6,7 +6,6 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { CreateWithMilestones_Batch_Fork_Test } from "../batch/createWithMilestones.t.sol"; import { CreateWithRange_Batch_Fork_Test } from "../batch/createWithRange.t.sol"; import { MerkleStreamerLL_Fork_Test } from "../merkle-streamer/MerkleStreamerLL.t.sol"; -import { OnStreamCanceled_Fork_Test } from "../plugin/onStreamCanceled.t.sol"; import { BatchCancelMultiple_TargetApprove_Fork_Test, BatchCreate_TargetApprove_Fork_Test @@ -36,5 +35,3 @@ contract USDT_CreateWithMilestones_Batch_Fork_Test is CreateWithMilestones_Batch contract USDT_CreateWithRange_Batch_Fork_Test is CreateWithRange_Batch_Fork_Test(usdt) { } contract USDT_MerkleStreamerLL_Fork_Test is MerkleStreamerLL_Fork_Test(usdt) { } - -contract USDT_OnStreamCanceled_Plugin_Fork_Test is OnStreamCanceled_Fork_Test(usdt) { } diff --git a/test/fork/plugin/onStreamCanceled.t.sol b/test/fork/plugin/onStreamCanceled.t.sol deleted file mode 100644 index 0813cda7..00000000 --- a/test/fork/plugin/onStreamCanceled.t.sol +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.19 <0.9.0; - -import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { ISablierV2LockupSender } from "@sablier/v2-core/src/interfaces/hooks/ISablierV2LockupSender.sol"; -import { LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; -import { PermitSignature } from "@uniswap/permit2-test/utils/PermitSignature.sol"; - -import { Fork_Test } from "../Fork.t.sol"; - -/// @dev Runs against multiple fork assets. -abstract contract OnStreamCanceled_Fork_Test is Fork_Test, PermitSignature { - constructor(IERC20 asset_) Fork_Test(asset_) { } - - function setUp() public virtual override { - Fork_Test.setUp(); - proxyRegistry.installPlugin(plugin); - - if (!archive.isListed(address(lockupLinear))) { - address archiveAdmin = archive.admin(); - changePrank({ msgSender: archiveAdmin }); - archive.list(address(lockupLinear)); - changePrank({ msgSender: users.alice.addr }); - } - } - - function testForkFuzz_OnStreamCanceled(uint128 amount, uint256 timeJump) external { - amount = boundUint128(amount, defaults.PER_STREAM_AMOUNT(), MAX_UINT128); - timeJump = _bound(timeJump, 100 seconds, defaults.TOTAL_DURATION() - 1 seconds); - - // Mint the fuzzed amount to the proxy owner. - deal({ token: address(asset), to: users.alice.addr, give: amount }); - - // ABI encode the parameters and call the function via the proxy. - LockupLinear.CreateWithRange memory createParams = defaults.createWithRange(asset); - createParams.totalAmount = amount; - bytes memory data = abi.encodeCall(targetApprove.createWithRange, (lockupLinear, createParams, bytes(""))); - bytes memory response = aliceProxy.execute(address(targetApprove), data); - uint256 streamId = abi.decode(response, (uint256)); - - // Retrieve the initial asset balance of the proxy owner. - uint256 initialBalance = asset.balanceOf(users.alice.addr); - - // Simulate the passage of time. - vm.warp({ timestamp: defaults.START_TIME() + timeJump }); - - // Make the recipient the caller so that Sablier calls the hook implemented by the plugin. - changePrank({ msgSender: users.recipient0.addr }); - - // Expect a call to the hook. - uint128 senderAmount = lockupLinear.refundableAmountOf(streamId); - uint128 recipientAmount = amount - senderAmount; - vm.expectCall( - address(aliceProxy), - abi.encodeCall( - ISablierV2LockupSender.onStreamCanceled, - (streamId, users.recipient0.addr, senderAmount, recipientAmount) - ) - ); - - // Asset flow: Sablier contract → proxy → proxy owner - // Expect transfers from the Sablier contract to the proxy, and then from the proxy to the proxy owner. - expectCallToTransfer({ asset_: address(asset), to: address(aliceProxy), amount: senderAmount }); - expectCallToTransfer({ asset_: address(asset), to: users.alice.addr, amount: senderAmount }); - - // Cancel the stream and trigger the plugin. - lockupLinear.cancel(streamId); - - // Assert that the balances match. - uint256 actualBalance = asset.balanceOf(users.alice.addr); - uint256 expectedBalance = initialBalance + senderAmount; - assertEq(actualBalance, expectedBalance, "balances mismatch"); - } -} diff --git a/test/integration/archive/list/list.t.sol b/test/integration/archive/list/list.t.sol deleted file mode 100644 index cee6b999..00000000 --- a/test/integration/archive/list/list.t.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.19 <0.9.0; - -import { Errors } from "@sablier/v2-core/src/libraries/Errors.sol"; - -import { Integration_Test } from "../../Integration.t.sol"; - -contract List_Integration_Test is Integration_Test { - function test_RevertWhen_CallerNotAdmin() external { - changePrank({ msgSender: users.eve.addr }); - vm.expectRevert(abi.encodeWithSelector(Errors.CallerNotAdmin.selector, users.admin.addr, users.eve.addr)); - archive.list(address(lockupLinear)); - } - - modifier whenCallerAdmin() { - changePrank({ msgSender: users.admin.addr }); - _; - } - - function test_List_AddressListed() external whenCallerAdmin { - archive.list(address(lockupLinear)); - archive.list(address(lockupLinear)); - bool isListed = archive.isListed(address(lockupLinear)); - assertTrue(isListed, "isListed"); - } - - modifier givenAddressNotListed() { - _; - } - - function test_List() external whenCallerAdmin givenAddressNotListed { - vm.expectEmit({ emitter: address(archive) }); - emit List({ admin: users.admin.addr, addr: address(lockupLinear) }); - archive.list(address(lockupLinear)); - bool isListed = archive.isListed(address(lockupLinear)); - assertTrue(isListed, "isListed"); - } -} diff --git a/test/integration/archive/list/list.tree b/test/integration/archive/list/list.tree deleted file mode 100644 index ffd59082..00000000 --- a/test/integration/archive/list/list.tree +++ /dev/null @@ -1,9 +0,0 @@ -list.t.sol -├── when the caller is not the admin -│ └── it should revert -└── when the caller is the admin - ├── given the address is listed - │ └── it should do nothing - └── given the address is not listed - ├── it should list the address - └── it should emit a {List} event diff --git a/test/integration/archive/unlist/unlist.t.sol b/test/integration/archive/unlist/unlist.t.sol deleted file mode 100644 index 33784b1e..00000000 --- a/test/integration/archive/unlist/unlist.t.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.19 <0.9.0; - -import { Errors } from "@sablier/v2-core/src/libraries/Errors.sol"; - -import { Integration_Test } from "../../Integration.t.sol"; - -contract Unlist_Integration_Test is Integration_Test { - function test_RevertWhen_CallerNotAdmin() external { - changePrank({ msgSender: users.eve.addr }); - vm.expectRevert(abi.encodeWithSelector(Errors.CallerNotAdmin.selector, users.admin.addr, users.eve.addr)); - archive.unlist(address(lockupLinear)); - } - - modifier whenCallerAdmin() { - changePrank({ msgSender: users.admin.addr }); - _; - } - - function test_Unlist_AddressNotListed() external whenCallerAdmin { - archive.unlist(address(lockupLinear)); - bool isListed = archive.isListed(address(lockupLinear)); - assertFalse(isListed, "isListed"); - } - - modifier givenAddressListed() { - archive.list(address(lockupLinear)); - _; - } - - function test_Unlist() external whenCallerAdmin givenAddressListed { - vm.expectEmit({ emitter: address(archive) }); - emit Unlist({ admin: users.admin.addr, addr: address(lockupLinear) }); - archive.unlist(address(lockupLinear)); - bool isListed = archive.isListed(address(lockupLinear)); - assertFalse(isListed, "isListed"); - } -} diff --git a/test/integration/archive/unlist/unlist.tree b/test/integration/archive/unlist/unlist.tree deleted file mode 100644 index c17ba5ea..00000000 --- a/test/integration/archive/unlist/unlist.tree +++ /dev/null @@ -1,9 +0,0 @@ -unlist.t.sol -├── when the caller is not the admin -│ └── it should revert -└── when the caller is the admin - ├── given the address is not listed - │ └── it should do nothing - └── given the address is listed - ├── it should unlist the address - └── it should emit an {Unlist} event diff --git a/test/integration/plugin/get-methods/getMethods.t.sol b/test/integration/plugin/get-methods/getMethods.t.sol deleted file mode 100644 index 4e780ac4..00000000 --- a/test/integration/plugin/get-methods/getMethods.t.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.19 <0.9.0; - -import { SablierV2ProxyPlugin } from "src/SablierV2ProxyPlugin.sol"; - -import { Integration_Test } from "../../Integration.t.sol"; - -contract GetMethods_Integration_Test is Integration_Test { - function test_GetMethods() external { - bytes4[] memory actualMethods = plugin.getMethods(); - bytes4[] memory expectedMethods = new bytes4[](1); - expectedMethods[0] = SablierV2ProxyPlugin.onStreamCanceled.selector; - assertEq(actualMethods, expectedMethods, "methods do not match"); - } -} diff --git a/test/integration/plugin/on-stream-canceled/onStreamCanceled.t.sol b/test/integration/plugin/on-stream-canceled/onStreamCanceled.t.sol deleted file mode 100644 index e369a6b1..00000000 --- a/test/integration/plugin/on-stream-canceled/onStreamCanceled.t.sol +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.19 <0.9.0; - -import { ISablierV2LockupSender } from "@sablier/v2-core/src/interfaces/hooks/ISablierV2LockupSender.sol"; - -import { ISablierV2ProxyPlugin } from "src/interfaces/ISablierV2ProxyPlugin.sol"; -import { Errors } from "src/libraries/Errors.sol"; - -import { Integration_Test } from "../../Integration.t.sol"; - -contract OnStreamCanceled_Integration_Test is Integration_Test { - uint256 internal streamId; - - function setUp() public virtual override { - Integration_Test.setUp(); - proxyRegistry.installPlugin(plugin); - - asset.approve({ spender: address(lockupLinear), amount: MAX_UINT256 }); - streamId = lockupLinear.createWithRange(defaults.createWithRange()); - - // List the {LockupLinear} contract in the archive. - changePrank({ msgSender: users.admin.addr }); - archive.list(address(lockupLinear)); - changePrank({ msgSender: users.alice.addr }); - } - - function test_RevertWhen_NotDelegateCalled() external { - vm.expectRevert(Errors.CallNotDelegateCall.selector); - plugin.onStreamCanceled({ - streamId: streamId, - recipient: users.recipient0.addr, - senderAmount: 100e18, - recipientAmount: 0 - }); - } - - modifier whenDelegateCalled() { - _; - } - - function test_RevertGiven_CallerNotListed() external whenDelegateCalled { - changePrank({ msgSender: users.eve.addr }); - vm.expectRevert(abi.encodeWithSelector(Errors.SablierV2ProxyPlugin_UnknownCaller.selector, users.eve.addr)); - ISablierV2ProxyPlugin(address(aliceProxy)).onStreamCanceled({ - streamId: streamId, - recipient: users.recipient0.addr, - senderAmount: 100e18, - recipientAmount: 0 - }); - } - - modifier givenCallerListed() { - _; - } - - function test_OnStreamCanceled() external whenDelegateCalled givenCallerListed { - // Retrieve the initial asset balance of the proxy owner. - uint256 initialBalance = asset.balanceOf(users.alice.addr); - - // Simulate the passage of time. - vm.warp(defaults.CLIFF_TIME()); - - // Make the recipient the caller so that Sablier calls the hook implemented by the plugin. - changePrank({ msgSender: users.recipient0.addr }); - - // Expect a call to the hook. - uint128 senderAmount = defaults.REFUND_AMOUNT(); - uint128 recipientAmount = defaults.WITHDRAW_AMOUNT(); - vm.expectCall( - address(aliceProxy), - abi.encodeCall( - ISablierV2LockupSender.onStreamCanceled, - (streamId, users.recipient0.addr, senderAmount, recipientAmount) - ) - ); - - // Asset flow: Sablier contract → proxy → proxy owner - // Expect transfers from the Sablier contract to the proxy, and then from the proxy to the proxy owner. - expectCallToTransfer({ to: address(aliceProxy), amount: senderAmount }); - expectCallToTransfer({ to: users.alice.addr, amount: senderAmount }); - - // Cancel the stream and trigger the plugin. - lockupLinear.cancel(streamId); - - // Assert that the balances match. - uint256 actualBalance = asset.balanceOf(users.alice.addr); - uint256 expectedBalance = initialBalance + senderAmount; - assertEq(actualBalance, expectedBalance, "balances mismatch"); - } -} diff --git a/test/integration/plugin/on-stream-canceled/onStreamCanceled.tree b/test/integration/plugin/on-stream-canceled/onStreamCanceled.tree deleted file mode 100644 index e1176b3a..00000000 --- a/test/integration/plugin/on-stream-canceled/onStreamCanceled.tree +++ /dev/null @@ -1,8 +0,0 @@ -onStreamCanceled.t.sol -├── when not delegate called -│ └── it should revert -└── when delegate called - ├── given the caller is not listed in the archive - │ └── it should revert - └── given the caller is listed in the archive - └── it should forward the assets to the proxy owner diff --git a/test/utils/DeployOptimized.sol b/test/utils/DeployOptimized.sol index 83e20b5b..c86ab760 100644 --- a/test/utils/DeployOptimized.sol +++ b/test/utils/DeployOptimized.sol @@ -4,22 +4,13 @@ pragma solidity >=0.8.19 <0.9.0; import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransfer.sol"; import { StdCheats } from "forge-std/StdCheats.sol"; -import { ISablierV2Archive } from "../../src/interfaces/ISablierV2Archive.sol"; import { ISablierV2Batch } from "../../src/interfaces/ISablierV2Batch.sol"; import { ISablierV2MerkleStreamerFactory } from "../../src/interfaces/ISablierV2MerkleStreamerFactory.sol"; -import { ISablierV2ProxyPlugin } from "../../src/interfaces/ISablierV2ProxyPlugin.sol"; import { SablierV2ProxyTargetApprove } from "../../src/SablierV2ProxyTargetApprove.sol"; import { SablierV2ProxyTargetPermit2 } from "../../src/SablierV2ProxyTargetPermit2.sol"; import { SablierV2ProxyTargetPush } from "../../src/SablierV2ProxyTargetPush.sol"; abstract contract DeployOptimized is StdCheats { - /// @dev Deploys {SablierV2Archive} from a optimized source compiled with `--via-ir`. - function deployOptimizedArchive(address initialAdmin) internal returns (ISablierV2Archive) { - return ISablierV2Archive( - deployCode("out-optimized/SablierV2Archive.sol/SablierV2Archive.json", abi.encode(initialAdmin)) - ); - } - /// @dev Deploys {SablierV2Batch} from a optimized source compiled with `--via-ir`. function deployOptimizedBatch() internal returns (ISablierV2Batch) { return ISablierV2Batch(deployCode("out-optimized/SablierV2Batch.sol/SablierV2Batch.json")); @@ -32,13 +23,6 @@ abstract contract DeployOptimized is StdCheats { ); } - /// @dev Deploys {SablierV2ProxyPlugin} from a optimized source compiled with `--via-ir`. - function deployOptimizedProxyPlugin(ISablierV2Archive archive_) internal returns (ISablierV2ProxyPlugin) { - return ISablierV2ProxyPlugin( - deployCode("out-optimized/SablierV2ProxyPlugin.sol/SablierV2ProxyPlugin.json", abi.encode(archive_)) - ); - } - /// @dev Deploys {SablierV2ProxyTargetApprove} from a optimized source compiled with `--via-ir`. function deployOptimizedProxyTargetApprove() internal returns (SablierV2ProxyTargetApprove) { return SablierV2ProxyTargetApprove( @@ -67,34 +51,24 @@ abstract contract DeployOptimized is StdCheats { /// @notice Deploys all V2 Periphery contracts from a optimized source in the following order: /// - /// 1. {SablierV2Archive} - /// 2. {SablierV2Batch} - /// 3. {SablierV2MerkleStreamerFactory} - /// 4. {SablierV2ProxyPlugin} - /// 5. {SablierV2ProxyTargetApprove} - /// 6. {SablierV2ProxyTargetPermit2} - /// 7. {SablierV2ProxyTargetPush} - function deployOptimizedPeriphery( - address initialAdmin, - IAllowanceTransfer permit2_ - ) + /// 1. {SablierV2Batch} + /// 2. {SablierV2MerkleStreamerFactory} + /// 3. {SablierV2ProxyTargetApprove} + /// 4. {SablierV2ProxyTargetPermit2} + /// 5. {SablierV2ProxyTargetPush} + function deployOptimizedPeriphery(IAllowanceTransfer permit2_) internal returns ( - ISablierV2Archive, ISablierV2Batch, ISablierV2MerkleStreamerFactory, - ISablierV2ProxyPlugin, SablierV2ProxyTargetApprove, SablierV2ProxyTargetPermit2, SablierV2ProxyTargetPush ) { - ISablierV2Archive archive_ = deployOptimizedArchive(initialAdmin); return ( - archive_, deployOptimizedBatch(), deployOptimizedMerkleStreamerFactory(), - deployOptimizedProxyPlugin(archive_), deployOptimizedProxyTargetApprove(), deployOptimizedProxyTargetPermit2(permit2_), deployOptimizedProxyTargetPush() diff --git a/test/utils/Events.sol b/test/utils/Events.sol index 83873147..1c6aed6a 100644 --- a/test/utils/Events.sol +++ b/test/utils/Events.sol @@ -25,6 +25,4 @@ abstract contract Events { uint256 aggregateAmount, uint256 recipientsCount ); - event List(address indexed admin, address indexed addr); - event Unlist(address indexed admin, address indexed addr); } diff --git a/test/utils/Precompiles.sol b/test/utils/Precompiles.sol index 82220d7e..74fdd7d0 100644 --- a/test/utils/Precompiles.sol +++ b/test/utils/Precompiles.sol @@ -4,10 +4,8 @@ pragma solidity >=0.8.19; import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransfer.sol"; -import { ISablierV2Archive } from "../../src/interfaces/ISablierV2Archive.sol"; import { ISablierV2Batch } from "../../src/interfaces/ISablierV2Batch.sol"; import { ISablierV2MerkleStreamerFactory } from "../../src/interfaces/ISablierV2MerkleStreamerFactory.sol"; -import { ISablierV2ProxyPlugin } from "../../src/interfaces/ISablierV2ProxyPlugin.sol"; import { ISablierV2ProxyTarget } from "../../src/interfaces/ISablierV2ProxyTarget.sol"; contract Precompiles { @@ -15,14 +13,10 @@ contract Precompiles { BYTECODES //////////////////////////////////////////////////////////////////////////*/ - bytes public constant BYTECODE_ARCHIVE = - hex"60803461007457601f61048238819003918201601f19168301916001600160401b038311848410176100795780849260209460405283398101031261007457516001600160a01b0381169081900361007457600080546001600160a01b0319169190911790556040516103f290816100908239f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826375829def146102e657508163bb032a661461022b578163bde3672d1461011c578163f794062e146100af575063f851a4401461005c57600080fd5b346100ab57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ab5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b9050346101185760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610118573573ffffffffffffffffffffffffffffffffffffffff811680910361011857818360ff92602095526001855220541690519015158152f35b8280fd5b919050346101185760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101185781359173ffffffffffffffffffffffffffffffffffffffff808416809403610227578454163381036101d4575050818352600160205282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008154169055337fb9835cd339eaf06fa84e93033cbaef0efbd524b078bf101a5a73040c8e1a3a6b8380a380f35b82517fc6cce6a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169181019182523360208301529081906040010390fd5b8480fd5b919050346101185760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101185781359173ffffffffffffffffffffffffffffffffffffffff808416809403610227578454163381036101d45750508183526001602052822060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055337fb9b4b5889ee1c30795c18ef5221a2a05de69d5655670bd5db987bbecc1b9646b8380a380f35b8491346101185760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101185780359173ffffffffffffffffffffffffffffffffffffffff91828416809403610227578454928316338103610397575050507fffffffffffffffffffffffff00000000000000000000000000000000000000001681178255337fbdd36143ee09de60bdefca70680e0f71189b2ed7acee364b53917ad433fdaf808380a380f35b7fc6cce6a400000000000000000000000000000000000000000000000000000000835273ffffffffffffffffffffffffffffffffffffffff1690820190815233602082015281906040010390fdfea164736f6c6343000815000a"; bytes public constant BYTECODE_BATCH = hex"6080806040523461001657611a6e908161001c8239f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c9081638c72706e14610c7d575080639b38b39a14610864578063bd4eb1a4146104ac5763e8d349611461004b57600080fd5b346104345760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610434576100826111c0565b61008a6110c7565b9060443567ffffffffffffffff808211610434573660238301121561043457816004013511610434573660246101208360040135028301011161043457806004013515610482576000805b8260040135821061044d5761010291508473ffffffffffffffffffffffffffffffffffffffff85166115a1565b61010f816004013561130a565b9160005b82600401358110610130576040518061012c8682611185565b0390f35b8060e0610145828660040135602488016111e3565b01610163606061015d84886004013560248a016111e3565b01611359565b90610176838760040135602489016111e3565b91610194602061018e868a6004013560248c016111e3565b01611366565b6101ae6101a9868a6004013560248c016111e3565b611366565b916fffffffffffffffffffffffffffffffff6101dd60406101d78960048e013560248f016111e3565b01611223565b73ffffffffffffffffffffffffffffffffffffffff61020c8c61015d60809c8260248f946004013591016111e3565b94816040519761021b89611240565b16875216602086015216604084015273ffffffffffffffffffffffffffffffffffffffff8b166060840152151586830152151560a082015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608436030112610434576103c4926102c060e09360405161029581611279565b6102a160a08501611387565b81526102b060c0809501611387565b6020820152838501523690611399565b83830152604051957fab167ccc00000000000000000000000000000000000000000000000000000000875273ffffffffffffffffffffffffffffffffffffffff835116600488015273ffffffffffffffffffffffffffffffffffffffff60208401511660248801526fffffffffffffffffffffffffffffffff604084015116604488015273ffffffffffffffffffffffffffffffffffffffff60608401511660648801528201511515608487015260a0820151151560a4870152810151602064ffffffffff918281511660c489015201511660e486015201516101048401906020809173ffffffffffffffffffffffffffffffffffffffff81511684520151910152565b60208261014481600073ffffffffffffffffffffffffffffffffffffffff88165af1801561044157600090610409575b6001925061040282876113df565b5201610113565b506020823d602011610439575b81610423602093836112b1565b8101031261043457600191516103f4565b600080fd5b3d9150610416565b6040513d6000823e3d90fd5b6001906fffffffffffffffffffffffffffffffff61047860406101d786886004013560248a016111e3565b16019101906100d5565b60046040517f763e559d000000000000000000000000000000000000000000000000000000008152fd5b34610434576104ba366110ea565b909281156104825760009060005b838110610836575073ffffffffffffffffffffffffffffffffffffffff6104f291169184836115a1565b6104fb8261130a565b9260005b838110610514576040518061012c8782611185565b61051f818588611404565b60a001908685610530838284611404565b60200161053c90611359565b9381610549858286611404565b60600161055590611366565b85610561818488611404565b60e0810161056e91611444565b9561057a929197611404565b61058390611366565b968c87610591818684611404565b60800161059d90611223565b946105a792611404565b6040016105b390611359565b90604051986105c18a611240565b73ffffffffffffffffffffffffffffffffffffffff168952151560208901521515604088015273ffffffffffffffffffffffffffffffffffffffff1660608701526fffffffffffffffffffffffffffffffff16608086015273ffffffffffffffffffffffffffffffffffffffff861660a08601523661063f91611399565b60c0850152369061064f92611498565b60e083015260405180927f168444560000000000000000000000000000000000000000000000000000000082526004820160209052610144820190805173ffffffffffffffffffffffffffffffffffffffff166024840152602081015115156044840152604081015115156064840152606081015173ffffffffffffffffffffffffffffffffffffffff16608484015260808101516fffffffffffffffffffffffffffffffff1660a484015260a081015173ffffffffffffffffffffffffffffffffffffffff1660c484015260c081015160e4840161074d916020809173ffffffffffffffffffffffffffffffffffffffff81511684520151910152565b60e0015190610124830161012090528151809152610164830191602001906000905b8082106107db57505050908060209203816000885af18015610441576000906107a8575b600192506107a182886113df565b52016104ff565b506020823d6020116107d3575b816107c2602093836112b1565b810103126104345760019151610793565b3d91506107b5565b919350916020606082610828600194885164ffffffffff604080926fffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152015116910152565b01940192018593929161076f565b916001906fffffffffffffffffffffffffffffffff61085b60806101d787898c611404565b160192016104c8565b346104345760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104345761089b6111c0565b6108a36110c7565b6044359167ffffffffffffffff8084116104345736602385011215610434578360040135116104345760248301903660246101408660040135028601011161043457836004013515610482576000805b85600401358210610c4b5761092091508473ffffffffffffffffffffffffffffffffffffffff84166115a1565b61092d846004013561130a565b9260005b8560040135811061094a576040518061012c8782611185565b808661010061095f87948360040135866113f3565b0183610975606061015d868660040135856113f3565b610998602061018e8761098d818960040135886113f3565b9760040135866113f3565b906fffffffffffffffffffffffffffffffff8c73ffffffffffffffffffffffffffffffffffffffff6109fe6109ea60406101d78c6109de6101a98260048a01358e6113f3565b9a8760040135906113f3565b9261015d8b60809d8e9360040135906113f3565b948160405197610a0d89611240565b16875216602086015216604084015273ffffffffffffffffffffffffffffffffffffffff88166060840152151586830152151560a082015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60843603011261043457610bd392610ac260e093604051610a878161125d565b610a9360a08501611387565b8152610ab28660c095610aa7878201611387565b602085015201611387565b6040820152838501523690611399565b83830152604051957f96ce143100000000000000000000000000000000000000000000000000000000875273ffffffffffffffffffffffffffffffffffffffff835116600488015273ffffffffffffffffffffffffffffffffffffffff60208401511660248801526fffffffffffffffffffffffffffffffff604084015116604488015273ffffffffffffffffffffffffffffffffffffffff60608401511660648801528201511515608487015260a0820151151560a4870152810151604064ffffffffff918281511660c48901528260208201511660e489015201511661010486015201516101248401906020809173ffffffffffffffffffffffffffffffffffffffff81511684520151910152565b60208261016481600073ffffffffffffffffffffffffffffffffffffffff89165af1801561044157600090610c18575b60019250610c1182886113df565b5201610931565b506020823d602011610c43575b81610c32602093836112b1565b810103126104345760019151610c03565b3d9150610c25565b6001906fffffffffffffffffffffffffffffffff610c7360406101d7868b600401358a6113f3565b16019101906108f3565b3461043457610c8b366110ea565b929093831561109f57506000805b84821061107157610cc291508373ffffffffffffffffffffffffffffffffffffffff84166115a1565b610ccb8361130a565b9360005b848110610ce4576040518061012c8882611185565b60c0610cf1828785611549565b0190610d03604061015d838987611549565b91610d14608061018e848a88611549565b92610d2e610d23848a88611549565b610100810190611444565b9091610d3e6101a9868c8a611549565b936020610d4c878d8b611549565b01359464ffffffffff861686036104345788610d7f606061015d8f80610d7960a06101d78f80958a611549565b95611549565b96604051998a61012081011067ffffffffffffffff6101208d0111176110425773ffffffffffffffffffffffffffffffffffffffff908b99610e3a99989764ffffffffff6fffffffffffffffffffffffffffffffff96956101009f86610e2e9b9a61012083016040521690521660208d0152151560408c0152151560608b01521660808901521660a087015273ffffffffffffffffffffffffffffffffffffffff8b1660c08701523690611399565b60e08501523691611498565b838201526040519283917fc33cd35e0000000000000000000000000000000000000000000000000000000083526020600484015273ffffffffffffffffffffffffffffffffffffffff815116602484015264ffffffffff602082015116604484015260408101511515606484015260608101511515608484015273ffffffffffffffffffffffffffffffffffffffff60808201511660a48401526fffffffffffffffffffffffffffffffff60a08201511660c484015273ffffffffffffffffffffffffffffffffffffffff60c08201511660e4840152610f4360e08201516101048501906020809173ffffffffffffffffffffffffffffffffffffffff81511684520151910152565b0151610140610144830152805180610164840152602061018484019201906000905b808210610fe75750505090806020920381600073ffffffffffffffffffffffffffffffffffffffff89165af1801561044157600090610fb4575b60019250610fad82896113df565b5201610ccf565b506020823d602011610fdf575b81610fce602093836112b1565b810103126104345760019151610f9f565b3d9150610fc1565b919350916020606082611034600194885164ffffffffff604080926fffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152015116910152565b019401920185939291610f65565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001906fffffffffffffffffffffffffffffffff61109560a06101d7868a8c611549565b1601910190610c99565b807f763e559d0000000000000000000000000000000000000000000000000000000060049252fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361043457565b9060607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126104345773ffffffffffffffffffffffffffffffffffffffff91600435838116810361043457926024359081168103610434579160443567ffffffffffffffff9283821161043457806023830112156104345781600401359384116104345760248460051b83010111610434576024019190565b6020908160408183019282815285518094520193019160005b8281106111ac575050505090565b83518552938101939281019260010161119e565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361043457565b91908110156111f457610120020190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b356fffffffffffffffffffffffffffffffff811681036104345790565b610100810190811067ffffffffffffffff82111761104257604052565b6060810190811067ffffffffffffffff82111761104257604052565b6040810190811067ffffffffffffffff82111761104257604052565b6080810190811067ffffffffffffffff82111761104257604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761104257604052565b67ffffffffffffffff81116110425760051b60200190565b90611314826112f2565b61132160405191826112b1565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061134f82946112f2565b0190602036910137565b3580151581036104345790565b3573ffffffffffffffffffffffffffffffffffffffff811681036104345790565b359064ffffffffff8216820361043457565b9190826040910312610434576040516113b181611279565b8092803573ffffffffffffffffffffffffffffffffffffffff81168103610434578252602090810135910152565b80518210156111f45760209160051b010190565b91908110156111f457610140020190565b91908110156111f45760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0181360301821215610434570190565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610434570180359067ffffffffffffffff82116104345760200191606082023603831361043457565b9291926114a4826112f2565b6040946114b3865192836112b1565b8195848352602080930191606080960285019481861161043457925b8584106114df5750505050505050565b8684830312610434578251906114f48261125d565b84356fffffffffffffffffffffffffffffffff81168103610434578252858501359067ffffffffffffffff8216820361043457828792838b95015261153a868801611387565b868201528152019301926114cf565b91908110156111f45760051b810135907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee181360301821215610434570190565b90816020910312610434575180151581036104345790565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604480820186905273ffffffffffffffffffffffffffffffffffffffff8086169594602093600092908581606481878d5af180156117b75761178a575b508551917fdd62ed3e0000000000000000000000000000000000000000000000000000000083523060048401521690816024820152848185818b5afa90811561178057908991849161174b575b501061166f575b5050505050505050565b8451968280868a017f095ea7b3000000000000000000000000000000000000000000000000000000009b8c82528560248d0152878c0152868b526116b28b611295565b8a519082855af1906116c26118e1565b82611718575b508161170d575b5061166557611700976116fb95519485015260248401528183015281526116f581611295565b826117c1565b6117c1565b3880808080808080611665565b90503b1515386116cf565b809192505190868215928315611733575b50505090386116c8565b6117439350820181019101611589565b388681611729565b809250868092503d8311611779575b61176481836112b1565b81010312611775578890513861165e565b8280fd5b503d61175a565b86513d85823e3d90fd5b6117a990863d88116117b0575b6117a181836112b1565b810190611589565b5038611611565b503d611797565b87513d86823e3d90fd5b60405161182c9173ffffffffffffffffffffffffffffffffffffffff166117e782611279565b6000806020958685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656487860152868151910182855af16118266118e1565b9161193f565b8051908282159283156118c9575b505050156118455750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b6118d99350820181019101611589565b38828161183a565b3d1561193a573d9067ffffffffffffffff8211611042576040519161192e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601846112b1565b82523d6000602084013e565b606090565b919290156119ba5750815115611953575090565b3b1561195c5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b8251909150156119cd5750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110611a4a575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201611a0956fea164736f6c6343000815000a"; bytes public constant BYTECODE_MERKLE_STREAMER_FACTORY = hex"6080806040523461001657611ba6908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806373b01dbb1461011557638ccff38b1461003257600080fd5b34610110576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101105773ffffffffffffffffffffffffffffffffffffffff9081610081610681565b1660005260008152604060002060405191828183549182815201908193600052826000209060005b8181106100fa57505050836100bf9103846106a4565b60405192818401908285525180915260408401929160005b8281106100e45785850386f35b83518716855293810193928101926001016100d7565b82548816845292840192600192830192016100a9565b600080fd5b34610110576101807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101105761014d610681565b73ffffffffffffffffffffffffffffffffffffffff60243516602435036101105773ffffffffffffffffffffffffffffffffffffffff60443516604435036101105764ffffffffff60843516608435036101105760407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5c3601126101105760c060405260a43564ffffffffff811681036101105760805264ffffffffff60c4351660c435036101105760c43560a05260e43590811515820361011057610104359182151583036101105767ffffffffffffffff610124351161011057366023610124350112156101105767ffffffffffffffff610124356004013511610646576040519161028a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6101243560040135011601846106a4565b6004610124359081013580855236910160240111610110576101243560040135602461012435016020850137600060206101243560040135850101526040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808360601b1660208301528060243560601b16603483015260443560601b166048820152606435605c8201527fffffffffff00000000000000000000000000000000000000000000000000000060843560d81b16607c820152606181528060a081011067ffffffffffffffff60a0830111176106465760a08101604052805160208201209060a0810160a06114b48301011067ffffffffffffffff60a06114b48401011117610646576114b46106e660a083013973ffffffffffffffffffffffffffffffffffffffff83811660a06114b4840181810192909252602435831660c083015260443590921660e082015260643561010082015264ffffffffff608435811661012080840191909152608051821661014084015283519091166101608301528615156101808301528815156101a0830152908390030191016000f59283156106755773ffffffffffffffffffffffffffffffffffffffff82166000526000602052604060002094855468010000000000000000811015610646576001810180885581101561061757602096600052866000200173ffffffffffffffffffffffffffffffffffffffff86167fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790556040519373ffffffffffffffffffffffffffffffffffffffff861685526064358786015264ffffffffff6084351660408601526105146060860160806020908164ffffffffff91828151168552015116910152565b151560a0850152151560c084015261014060e08401528051908161014085015260005b8281106106025750507fb2f6bc588a802f2ce7f8dec57a5096c107d2fc000d5b4cc65745a2c0e232349c610160936000858483010152610144356101008201526101643561012082015273ffffffffffffffffffffffffffffffffffffffff6044351694817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f73ffffffffffffffffffffffffffffffffffffffff806024351698169601168101030190a473ffffffffffffffffffffffffffffffffffffffff60405191168152f35b81810187015185820161016001528601610537565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040513d6000823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361011057565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106465760405256fe610140604081815234620002c15781620014b48038038091620000238285620002e2565b83398101039061012091828112620002c15783516001600160a01b039182821691829003620002c157602091828701519184831694858403620002c1578689015190811693848203620002c15760608a015191886200008560808d0162000306565b94609f190112620002c157885192838a016001600160401b03811185821017620002ab578a52620000b960a08d0162000306565b8452620000c960c08d0162000306565b84890190815294620000de60e08e0162000319565b91610100809e01620000f09062000319565b93600098600160a01b60019003198a541617895560805260e05260c05260a0528a5288525164ffffffffff16600254915160281b69ffffffffff00000000001691600160501b600190031916171760025584519280840191808063095ea7b360e01b948581528860248901526000196044890152604488526200017388620002c6565b87519082885af16200018462000430565b8162000269575b50806200025e575b156200021c575b8651610f6690898b836200054e843960805183818161031f015281816105af0152610aa2015260a0518381816105d601526109c6015260c0518381816101450152818161090001528181610cad0152610e02015260e0518381816102d0015261050b0152518281816105fe015261098a015251818181610195015261076d0152f35b62000252956200024c9388519384015260248301526044820152604481526200024581620002c6565b8262000327565b62000327565b3880808080806200019a565b50833b151562000193565b8091505183811591821562000284575b50509050386200018b565b8380929350010312620002a757826200029e910162000319565b80833862000279565b5080fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b608081019081106001600160401b03821117620002ab57604052565b601f909101601f19168101906001600160401b03821190821017620002ab57604052565b519064ffffffffff82168203620002c157565b51908115158203620002c157565b60408051908101916001600160a01b03166001600160401b03831182841017620002ab576200039b926040526000806020958685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656487860152868151910182855af16200039462000430565b9162000473565b80518281159182156200040d575b5050905015620003b65750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b8380929350010312620002c1578162000427910162000319565b808238620003a9565b3d156200046e573d906001600160401b038211620002ab576040519162000462601f8201601f191660200184620002e2565b82523d6000602084013e565b606090565b91929015620004d8575081511562000489575090565b3b15620004935790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015620004ec5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b82851062000533575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506200050f56fe60806040818152600436101561001457600080fd5b600091823560e01c9081631686c909146109eb5750806316c3549d146109af5780631bfd6814146109735780633bfe03a8146109445780633f31ae3f146103435780634800d97f146102f357806351e75e8b146102b957806375829def146101d557806390e64d13146101b95780639e93e57714610169578063bb4b573414610128578063ce516507146100e65763f851a440146100b157600080fd5b346100e257816003193601126100e25773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b50346100e25760206003193601126100e25760209061011f60043560ff6001918060081c60005282602052161b60406000205416151590565b90519015158152f35b50346100e257816003193601126100e2576020905164ffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100e257816003193601126100e2576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100e257816003193601126100e25760209061011f610dfa565b5090346102b65760206003193601126102b6576101f0610d2a565b81549073ffffffffffffffffffffffffffffffffffffffff9081831633810361026857507fffffffffffffffffffffffff00000000000000000000000000000000000000009394501691829116178255337fbdd36143ee09de60bdefca70680e0f71189b2ed7acee364b53917ad433fdaf808380a380f35b85517fc6cce6a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff919091166004820152336024820152604490fd5b80fd5b50346100e257816003193601126100e257602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100e257816003193601126100e2576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5090346102b65760806003193601126102b6576004359160243573ffffffffffffffffffffffffffffffffffffffff811680910361094057604435906fffffffffffffffffffffffffffffffff821680920361093c576064359067ffffffffffffffff958683116109385736602384011215610938578260040135878111610934578060051b93602485820101903682116109305787516020810190858252868a820152886060820152606081526103fa81610d9d565b5190208851602081019182526020815261041381610d52565b5190209261041f610dfa565b6108d3576104458560ff6001918060081c60005282602052161b60406000205416151590565b6108a35761045860208a51980188610db9565b8652602401602086015b828210610893575050509386945b84518610156105035760208660051b86010151908181106000146104f55788526020528587205b947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146104c85760010194610470565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b908852602052858720610497565b9186918989947f00000000000000000000000000000000000000000000000000000000000000000361086a578260081c85526001602052838520600160ff85161b8154179055835161055481610d52565b85815285602082015273ffffffffffffffffffffffffffffffffffffffff8654168551926101008401908482109082111761083d5786528252866020830152828583015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660608301527f0000000000000000000000000000000000000000000000000000000000000000151560808301527f0000000000000000000000000000000000000000000000000000000000000000151560a0830152845161062f81610d52565b64ffffffffff600254818116835260281c16602082015260c083015260e0820152602060e08551927fab167ccc00000000000000000000000000000000000000000000000000000000845273ffffffffffffffffffffffffffffffffffffffff815116600485015273ffffffffffffffffffffffffffffffffffffffff838201511660248501526fffffffffffffffffffffffffffffffff8782015116604485015273ffffffffffffffffffffffffffffffffffffffff606082015116606485015260808101511515608485015260a0810151151560a485015264ffffffffff8360c08301518281511660c488015201511660e4850152015173ffffffffffffffffffffffffffffffffffffffff8151166101048401520151610124820152602081610144818873ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af19485156108325780956107d7575b5050937f28b58397e03322f670d6b223cc863f8c148e368b8b615412e6798a641a22842d838593602097825191825288820152a351908152f35b9095919294506020863d60201161082a575b816107f660209383610db9565b810103126102b65750935192907f28b58397e03322f670d6b223cc863f8c148e368b8b615412e6798a641a22842d8361079d565b3d91506107e9565b8451903d90823e3d90fd5b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b600484517fb3f3b2a6000000000000000000000000000000000000000000000000000000008152fd5b8135815260209182019101610462565b6024858a51907f3548783b0000000000000000000000000000000000000000000000000000000082526004820152fd5b88517f74b43bd00000000000000000000000000000000000000000000000000000000081524260048201527f000000000000000000000000000000000000000000000000000000000000000064ffffffffff166024820152604490fd5b8880fd5b8680fd5b8580fd5b8380fd5b8280fd5b5090346102b657806003193601126102b6575060025464ffffffffff825191818116835260281c166020820152f35b50346100e257816003193601126100e257602090517f000000000000000000000000000000000000000000000000000000000000000015158152f35b50346100e257816003193601126100e257602090517f000000000000000000000000000000000000000000000000000000000000000015158152f35b91905034610940578060031936011261094057610a06610d2a565b916024356fffffffffffffffffffffffffffffffff8116809103610d265773ffffffffffffffffffffffffffffffffffffffff9182865416338103610cdd575050610a4f610dfa565b15610c805782519160209281848201967fa9059cbb000000000000000000000000000000000000000000000000000000008852169586602483015283604483015260448252610a9d82610d9d565b8780847f00000000000000000000000000000000000000000000000000000000000000001692885194610acf86610d52565b8886527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656489870152519082855af13d15610c72573d9167ffffffffffffffff8311610c455790610b5c939291885192610b4f897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160185610db9565b83523d8b8985013e610e37565b8051848115918215610c25575b5050905015610ba257907f2e9d425ba8b27655048400b366d7b6a1f7180ebdb088e06bb7389704860ffe1f92918654169351908152a380f35b6084838551907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b838092935001031261093457830151801515810361093457808438610b69565b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b90610b5c9291606091610e37565b82517f1351f21d0000000000000000000000000000000000000000000000000000000081524260048201527f000000000000000000000000000000000000000000000000000000000000000064ffffffffff166024820152604490fd5b7fc6cce6a400000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff166004820152336024820152604490fd5b8480fd5b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610d4d57565b600080fd5b6040810190811067ffffffffffffffff821117610d6e57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610d6e57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610d6e57604052565b64ffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168015159081610e2f575090565b905042101590565b91929015610eb25750815115610e4b575090565b3b15610e545790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015610ec55750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610f42575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610f0156fea164736f6c6343000815000aa164736f6c6343000815000a"; - bytes public constant BYTECODE_PROXY_PLUGIN = - hex"60c03461007d57601f61098238819003918201601f19168301916001600160401b038311848410176100825780849260209460405283398101031261007d57516001600160a01b038116810361007d573060805260a0526040516108e9908161009982396080518161013b015260a051818181608f01526101970152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600092833560e01c9182636aeb4594146105e65750816372eba203146100b7575063cbd7aee91461004657600080fd5b346100b357817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100b3576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b919050346105e25760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105e2578135602491823573ffffffffffffffffffffffffffffffffffffffff90818116036105de57604435926fffffffffffffffffffffffffffffffff8085168095036104fa57606435908116036105da57817f00000000000000000000000000000000000000000000000000000000000000001630146105b2578251937ff794062e0000000000000000000000000000000000000000000000000000000085523387860152602094858188818c887f0000000000000000000000000000000000000000000000000000000000000000165af19081156104bf578991610585575b50156105575783517fb971302a000000000000000000000000000000000000000000000000000000008152828882015285818881335afa9081156104bf57899161053a575b50833091160361050f578351917feac8f5b80000000000000000000000000000000000000000000000000000000083528783015284828781335afa9182156105055788926104c9575b5083517f8da5cb5b00000000000000000000000000000000000000000000000000000000815285818981305afa9081156104bf578991610492575b5084519184878401927fa9059cbb0000000000000000000000000000000000000000000000000000000084521688840152604483015260448252608082019367ffffffffffffffff9383861085871117610467578587521691899182916102f6876106e5565b8887527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460a0820152519082855af1903d15610458573d92831161042d579061037c93929185519261036f887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160185610730565b83523d8a8885013e6107ba565b805190838215928315610415575b50505015610396578480f35b517f08c379a000000000000000000000000000000000000000000000000000000000815292830152602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608490fd5b6104259350820181019101610771565b38838161038a565b868960418a7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b9061037c9392506060916107ba565b888b60418c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6104b29150863d88116104b8575b6104aa8183610730565b81019061078e565b38610290565b503d6104a0565b85513d8b823e3d90fd5b9091508481813d83116104fe575b6104e18183610730565b810103126104fa575182811681036104fa579038610255565b8780fd5b503d6104d7565b84513d8a823e3d90fd5b85886001897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6105519150863d88116104b8576104aa8183610730565b3861020c565b83517f09bd4d6800000000000000000000000000000000000000000000000000000000815233818901528690fd5b6105a59150863d88116105ab575b61059d8183610730565b810190610771565b386101c7565b503d610593565b8583517fbbff6135000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8580fd5b8280fd5b909150346106e157837ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106e157610620816106e5565b60019384825260209081830193823686378351156106b5575091907f72eba20300000000000000000000000000000000000000000000000000000000849694528451948186019282875251809352850195925b8281106106805785870386f35b83517fffffffff0000000000000000000000000000000000000000000000000000000016875295810195928101928401610673565b9060326024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8380fd5b6040810190811067ffffffffffffffff82111761070157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761070157604052565b90816020910312610789575180151581036107895790565b600080fd5b90816020910312610789575173ffffffffffffffffffffffffffffffffffffffff811681036107895790565b9192901561083557508151156107ce575090565b3b156107d75790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b8251909150156108485750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b8481106108c5575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b81810183015186820160440152859350820161088456fea164736f6c6343000815000a"; bytes public constant BYTECODE_PROXY_TARGET_APPROVE = hex"60a0806040523461002357306080526147df90816100298239608051816136bb0152f35b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c806308b1834a14612db05780630a3b8c7714612c705780630d7fe86314612ab75780632104b57d146127645780632f5c8223146123da57806365092a79146123725780636a09d49a1461228557806379bcb2e314611f3b5780637d2085b014611d8b57806386f2891e14611d1357806391c68e991461192557806398590ef9146117235780639dc29fac146116a8578063a3143b761461162f578063ad26c0fb146115a4578063b76d0a58146112e9578063b82027bf14611035578063b956b45f14610f8a578063c44d5f7814610dbf578063d4f880f814610b8e578063ec4ac9a7146108a1578063ed233b3414610622578063edc1e8a014610439578063f16306121461028a5763f2bf799e1461013057600080fd5b3461023c576003199060808236011261023c5761014b6131e4565b9167ffffffffffffffff6024358181116102865761016d903690600401613532565b92909161017861320e565b9060643590811161028257610191903690600401613532565b92909661019c6136b1565b6001600160a01b0380911694853b1561027e576101ef9060409995949951977fa2ffb897000000000000000000000000000000000000000000000000000000008952606060048a01526064890191613674565b9716602486015284870301604485015280865260208096019195855b82811061024a57868087818180890381838c5af1801561023f5761022c5750f35b61023590613252565b61023c5780f35b80fd5b6040513d84823e3d90fd5b90919282806001926fffffffffffffffffffffffffffffffff61026c8c6133c4565b1681520198019101969291909661020b565b8780fd5b8580fd5b8380fd5b503461023c57604060031936011261023c5767ffffffffffffffff600435818111610435576102bd903690600401613532565b916024918235828111610282576102d8903690600401613532565b9390926102e36136b1565b851561040b5786906102f58686614411565b93825b88811061030e578361030b89898961455e565b80f35b610319818a84613605565b356001600160a01b03811680910361040757610336828b85613605565b60209081810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561027e570180359086821161027e578201928160051b3603841361027e57803b1561027e57888880946103cc604051978896879586947f8659c2700000000000000000000000000000000000000000000000000000000086526004860152840191613674565b03925af19081156103fc5785916103e8575b50506001016102f8565b6103f190613252565b6102865783386103de565b6040513d87823e3d90fd5b8480fd5b60046040517f71594532000000000000000000000000000000000000000000000000000000008152fd5b8280fd5b506003199060408236011261023c576104506131e4565b916024359067ffffffffffffffff90818311610286576101409083360301126104355760405190610480826132b2565b61048c836004016131fa565b825261049a60248401613453565b94602095868401526104ae60448501613398565b60408401526104bf60648501613398565b60608401526104d0608485016131fa565b60808401526104e160a485016133c4565b9160a084019283526104f560c486016131fa565b9460c0850195865261050a3660e483016133f7565b60e086015261012481013591821161061e57013660238201121561028257926105916105c6938796936105488a973690602460048201359101613465565b6101008501526105566136b1565b6fffffffffffffffffffffffffffffffff9081341683526001600160a01b0380916105838289511661463d565b16955116915116908461422f565b6040519485809481937fc33cd35e00000000000000000000000000000000000000000000000000000000835260048301613e71565b03925af191821561061257916105e0575b50604051908152f35b90508181813d831161060b575b6105f78183613323565b810103126106065751386105d7565b600080fd5b503d6105ed565b604051903d90823e3d90fd5b8680fd5b503461023c5760031960a08136011261089d5761063d6131e4565b916024359161064a61320e565b916064359167ffffffffffffffff908184116104355761012090843603011261089d5760843590811161089d57610685903690600401613224565b505061068f6136b1565b6106976136b1565b6001600160a01b0380951690604051947feac8f5b80000000000000000000000000000000000000000000000000000000086528060048701526020968787602481875afa96871561089257839761085a575b50861690604051937f70a0823100000000000000000000000000000000000000000000000000000000918286523060048701528986602481875afa9586156103fc57859661082b575b50813b156104075784916024839260405194859384927f40e58ee500000000000000000000000000000000000000000000000000000000845260048401525af18015610820578992918591610807575b505060246040518094819382523060048301525afa91821561061257916107d6575b50936107b66107c5926107ce9661370d565b906107bf6144df565b90613749565b60040190613f97565b604051908152f35b9490508585813d8311610800575b6107ee8183613323565b810103126106065793516107b66107a4565b503d6107e4565b61081391929350613252565b6104355787908338610782565b6040513d86823e3d90fd5b9095508981813d8311610853575b6108438183613323565b8101031261060657519438610732565b503d610839565b9096508781813d831161088b575b6108728183613323565b81010312610435575186811681036104355795386106e9565b503d610868565b6040513d85823e3d90fd5b5080fd5b503461023c576108b036613597565b50509190926108bd6136b1565b821561040b5784805b848210610b575761094f915061093f6001600160a01b036108e56144df565b9216916001600160a01b03604051917f23b872dd0000000000000000000000000000000000000000000000000000000060208401521660248201523060448201528260648201526064815261093981613307565b856137bd565b836001600160a01b03841661422f565b61095883613a7e565b93855b848110610974576040518061097088826134f7565b0390f35b60c0610981828785613e31565b01906109996040610993838987613e31565b01613acd565b6109af60806109a9848a88613e31565b01613ada565b6109c86109bd848a88613e31565b610100810190613ccb565b91906109dd6109d8868c8a613e31565b613ada565b9260206109eb878d8b613e31565b01359264ffffffffff84168403610b5357610ae4976fffffffffffffffffffffffffffffffff8a6001600160a01b038f94819960209b64ffffffffff610aab9b8f6060610993828d610a51610a9f9f610a4b610a57978f9260a093613e31565b01613a61565b9b613e31565b936040519e8f91610a67836132b2565b169052168d8d0152151560408c0152151560608b01521660808901521660a08701526001600160a01b038c1660c087015236906133f7565b60e08501523691613465565b610100820152604051809481927fc33cd35e00000000000000000000000000000000000000000000000000000000835260048301613e71565b03818b6001600160a01b0389165af18015610b48578890610b15575b60019250610b0e8289613b94565b520161095b565b506020823d602011610b40575b81610b2f60209383613323565b810103126106065760019151610b00565b3d9150610b22565b6040513d8a823e3d90fd5b8d80fd5b6001600160a01b036001916fffffffffffffffffffffffffffffffff610b8360a0610a4b878b8d613e31565b1601169101906108c6565b503461023c5761018060031936011261023c57610ba96131e4565b906101407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36011261023c57610164359067ffffffffffffffff821161023c5750610bf8903690600401613224565b5050610c026136b1565b608435906001600160a01b0382811691811682840361060657606435926fffffffffffffffffffffffffffffffff841680940361060657610ca084610c456144df565b96610c9a6040518760209a7f23b872dd000000000000000000000000000000000000000000000000000000008c84015216602482015230604482015283606482015260648152610c9481613307565b826137bd565b8461422f565b604051937fab167ccc0000000000000000000000000000000000000000000000000000000085526024358481168091036106065760048601526044358481168091036106065760248601526044850152606484015260a43580151580910361060657608484015260c4358015158091036106065760a484015260e4359164ffffffffff928381168091036106065760c48501526101049283359081168091036106065760e4850152610124908135908116809103610606576000859384928896840152610144938435908401525af1908115610db357600091610d865750604051908152f35b908282813d8311610dac575b610d9c8183613323565b8101031261023c575051386105d7565b503d610d92565b6040513d6000823e3d90fd5b5061016060031936011261023c57610dd56131e4565b906101407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36011261023c5760405191610e0e83613295565b610e16613364565b8352610e2061320e565b9260209384820152610e306133a5565b9060408101918252610e406133e1565b60608201908152610e4f61337a565b6080830152610e5c613389565b60a083015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1c36011261060657604051610e97816132cf565b64ffffffffff60e4358181168103610606578252610104359081168103610606578782015260c083015260407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedc3601126106065760405191610ef8836132cf565b610124356001600160a01b03948582168203610606578796899686610f55946105c69852610144358982015260e0860152610f316136b1565b806fffffffffffffffffffffffffffffffff9283341685526105838289511661463d565b6040519485809481937fab167ccc00000000000000000000000000000000000000000000000000000000835260048301613aee565b503461023c57608060031936011261023c5780610fa56131e4565b610fad61320e565b610fb56133a5565b91610fbe6136b1565b6001600160a01b03809116803b15610407578492836064926fffffffffffffffffffffffffffffffff60405197889687957ffdd46d6000000000000000000000000000000000000000000000000000000000875260243560048801521660248601521660448401525af1801561023f5761022c5750f35b503461023c5761104436613597565b505091926110506136b1565b821561040b578490855b8481106112b257506001600160a01b036110e49116916110dd6001600160a01b036110836144df565b9216916001600160a01b03604051917f23b872dd000000000000000000000000000000000000000000000000000000006020840152166024820152306044820152826064820152606481526110d781613307565b876137bd565b858361422f565b6110ed83613a7e565b93855b848110611105576040518061097088826134f7565b611110818686613c8b565b60a0019061111f818787613c8b565b60200161112b90613acd565b611136828888613c8b565b60600161114290613ada565b9261114e838989613c8b565b60e0810161115b91613ccb565b919092611169858b8b613c8b565b61117290613ada565b9561117e868c8c613c8b565b60800161118a90613a61565b91611196878d8d613c8b565b6040016111a290613acd565b90604051986111b08a613295565b6001600160a01b0316895215156020890152151560408801526001600160a01b031660608701526fffffffffffffffffffffffffffffffff1660808601526001600160a01b03861660a086015236611207916133f7565b60c0850152369061121792613465565b60e0830152836040518080947f16844456000000000000000000000000000000000000000000000000000000008252600482019061125491613d1f565b03818b5a94602095f18015610b4857889061127f575b600192506112788289613b94565b52016110f0565b506020823d6020116112aa575b8161129960209383613323565b81010312610606576001915161126a565b3d915061128c565b916001600160a01b036001916fffffffffffffffffffffffffffffffff6112df6080610a4b888b8b613c8b565b160116920161105a565b503461023c576003199060608236011261023c576113056131e4565b9067ffffffffffffffff90816024351161023c5761014080946024353603011261023c5760443591821161023c5750611342903690600401613224565b505061134c6136b1565b6113e961135d60c460243501613ada565b6fffffffffffffffffffffffffffffffff61137c60a460243501613a61565b16906113da6113896144df565b6001600160a01b03604051917f23b872dd00000000000000000000000000000000000000000000000000000000602084015216602482015230604482015283606482015260648152610c9481613307565b6001600160a01b03841661422f565b60405180927fc33cd35e0000000000000000000000000000000000000000000000000000000082526020600483015261016482016001600160a01b036114336024356004016131fa565b16602484015264ffffffffff61144c6024803501613453565b166044840152611460604460243501613398565b15156064840152611475606460243501613398565b151560848401526001600160a01b036114926084602435016131fa565b1660a48401526fffffffffffffffffffffffffffffffff6114b760a4602435016133c4565b1660c48401526001600160a01b036114d360c4602435016131fa565b1660e48401526114ec610104840160e460243501613c6c565b6115016101246024350160243560040161418b565b91829193610144860152526101848301919060005b81811061158257505050918160006001600160a01b03826020960393165af1908115610db35760009161154f575b602082604051908152f35b6020813d60201161157a575b8161156860209383613323565b8101031261089d575190506020611544565b3d915061155b565b9193509160608082611596600194886141de565b019401910191859392611516565b503461023c57806001600160a01b036115bc36613563565b9290916115c76136b1565b1691823b1561162a576040517fc156a11d00000000000000000000000000000000000000000000000000000000815260048101929092526001600160a01b031660248201529082908290818381604481015b03925af1801561023f5761022c5750f35b505050fd5b503461023c57806001600160a01b0361164736613563565b9290916116526136b1565b1691823b1561162a576040517fea5ead1900000000000000000000000000000000000000000000000000000000815260048101929092526001600160a01b03166024820152908290829081838160448101611619565b503461023c57604060031936011261023c57806001600160a01b036116cb6131e4565b6116d36136b1565b16803b15611720578180916024604051809481937f42966c68000000000000000000000000000000000000000000000000000000008352833560048401525af1801561023f5761022c5750f35b50fd5b503461023c57604060031936011261023c5761173d6131e4565b6024356117486136b1565b6001600160a01b0380921691604051917feac8f5b8000000000000000000000000000000000000000000000000000000008352806004840152846020928385602481895afa94851561023f5782956118ed575b50841691604051957f70a0823100000000000000000000000000000000000000000000000000000000918288523060048901528588602481885afa9788156108205784986118ba575b50813b156102865783916024839260405196879384927f40e58ee500000000000000000000000000000000000000000000000000000000845260048401525af19283156118ad578593611894575b505060246040518094819382523060048301525afa9182156103fc578592611864575b505061030b926107b69161370d565b90809250813d831161188d575b61187b8183613323565b810103126106065751826107b6611855565b503d611871565b6118a091929350613252565b6102825782908638611832565b50604051903d90823e3d90fd5b86809299508195503d83116118e6575b6118d48183613323565b810103126106065787925196386117e4565b503d6118ca565b9094508381813d831161191e575b6119058183613323565b8101031261089d5751848116810361089d57933861179b565b503d6118fb565b503461023c576101e060031936011261023c576119406131e4565b602480359161194d61320e565b6101607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c360112610407576101c43567ffffffffffffffff811161028257611999903690600401613224565b50506119a36136b1565b6119ab6136b1565b6001600160a01b03809216604051907feac8f5b800000000000000000000000000000000000000000000000000000000825285600483015260209586838781855afa928315610b48578893611cdb575b508785841691604051937f70a0823100000000000000000000000000000000000000000000000000000000918286523060048701528a868b81885afa958615610820578496611ca8575b50813b156102865783918a839260405196879384927f40e58ee500000000000000000000000000000000000000000000000000000000845260048401525af19283156118ad578a93611c8b575b5050876040518094819382523060048301525afa908115610b48578596979891611c53575b50611ac692916107b69161370d565b611ace6136b1565b169060c435818116908181036106065760a435906fffffffffffffffffffffffffffffffff82168092036106065781611b5a91611b54611b0c6144df565b87604051917f23b872dd000000000000000000000000000000000000000000000000000000008d840152168a82015230604482015283606482015260648152610c9481613307565b8661422f565b604051947f96ce143100000000000000000000000000000000000000000000000000000000865260643584811680910361060657600487015260843590848216809203610606578601526044850152606484015260e43580151580910361060657608484015261010480358015158091036106065760a485015264ffffffffff916101248035848116908190036106065760c48701526101449384358181168091036106065760e48801526101649384359182168092036106065787015261018435918216809203610606578694869485936000938501526101a435908401525af1908115610db357600091610d865750604051908152f35b9450909190508684813d8111611c84575b611c6e8183613323565b8101031261060657925184939190611ac6611ab7565b503d611c64565b611c9791929350613252565b611ca45787908938611a92565b8880fd5b8b809297508195503d8311611cd4575b611cc28183613323565b81010312610606578a92519438611a45565b503d611cb8565b9092508681813d8311611d0c575b611cf38183613323565b8101031261027e5751848116810361027e5791386119fb565b503d611ce9565b503461023c57604060031936011261023c57806001600160a01b03611d366131e4565b611d3e6136b1565b16803b15611720578180916024604051809481937f7de6b1db000000000000000000000000000000000000000000000000000000008352833560048401525af1801561023f5761022c5750f35b503461023c576101a060031936011261023c57611da66131e4565b906101607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36011261023c57610184359067ffffffffffffffff821161023c5750611df5903690600401613224565b5050611dff6136b1565b608435906001600160a01b0382811691811682840361060657606435926fffffffffffffffffffffffffffffffff841680940361060657611e4284610c456144df565b604051937f96ce14310000000000000000000000000000000000000000000000000000000085526024358481168091036106065760048601526044358481168091036106065760248601526044850152606484015260a43580151580910361060657608484015260c4358015158091036106065760a484015260e4359164ffffffffff928381168091036106065760c48501526101049283358181168091036106065760e486015261012493843591821680920361060657850152610144908135908116809103610606576000859384928896840152610164938435908401525af1908115610db357600091610d865750604051908152f35b503461023c5760808060031936011261089d57611f566131e4565b90611f5f613364565b906044359267ffffffffffffffff9182851161028257366023860112156102825784600401359280841161061e57602486019560243691610120870201011161061e5760643590811161061e57611fba903690600401613224565b5050611fc46136b1565b821561040b57928591865b868582106122485750506001600160a01b0380911661204d82611ff06144df565b9516612046604051856020987f23b872dd000000000000000000000000000000000000000000000000000000008a8401521660248201523060448201528260648201526064815261204081613307565b866137bd565b848361422f565b61205685613a7e565b9682899416935b86811061207257604051806109708b826134f7565b61207d818884613a50565b60e00190868960608a8161209286838a613a50565b0161209c90613acd565b8a6120a887848b613a50565b938360a0978d8c8b836120bc828785613a50565b016120c690613ada565b986120d092613a50565b6120d990613ada565b988d8c6120e7818784613a50565b6040016120f390613a61565b956120fd92613a50565b0161210790613acd565b96816040519a6121168c613295565b168a5216908801526fffffffffffffffffffffffffffffffff16604087015285015215158d8401521515838301528036037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001604013610606576121e8948a936121ae926121916040519261218a846132cf565b8201613453565b82526121a060c0809201613453565b8683015284015236906133f7565b60e08201528c60405180809681947fab167ccc00000000000000000000000000000000000000000000000000000000835260048301613aee565b0391885af1801561223d578b9061220f575b60019250612208828c613b94565b520161205d565b508682813d8311612236575b6122258183613323565b8101031261060657600191516121fa565b503d61221b565b6040513d8d823e3d90fd5b81946fffffffffffffffffffffffffffffffff6122786040610a4b6001968b6001600160a01b03979d9a9d613a50565b1601169301949194611fcf565b503461023c57606060031936011261023c5761229f6131e4565b8167ffffffffffffffff602435818111610435576122c1903690600401613532565b92909160443590811161089d576122dc903690600401613532565b6122e46136b1565b6001600160a01b036122f68686614411565b961691823b1561028657612344928492836040518096819582947f8659c270000000000000000000000000000000000000000000000000000000008452602060048501526024840191613674565b03925af1801561023f5761235e575b505061030b9261455e565b61236790613252565b610286578338612353565b503461023c576003199060608236011261023c5761238e6131e4565b916024359167ffffffffffffffff9182841161089d5761012090843603011261023c5760443591821161023c5760206107ce85856123cf3660048801613224565b505060040190613f97565b503461023c576101c060031936011261023c576123f56131e4565b602480359161240261320e565b6101407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c360112610407576101a43567ffffffffffffffff81116102825761244e903690600401613224565b50506124586136b1565b6124606136b1565b6001600160a01b03809216604051907feac8f5b800000000000000000000000000000000000000000000000000000000825285600483015260209586838781855afa928315610b4857889361272c575b508785841691604051937f70a0823100000000000000000000000000000000000000000000000000000000918286523060048701528a868b81885afa9586156108205784966126f9575b50813b156102865783918a839260405196879384927f40e58ee500000000000000000000000000000000000000000000000000000000845260048401525af19283156118ad578a936126e0575b5050876040518094819382523060048301525afa908115610b485785969798916126a8575b5061257b92916107b69161370d565b6125836136b1565b169060c435818116908181036106065760a435906fffffffffffffffffffffffffffffffff821680920361060657816125c191611b54611b0c6144df565b604051947fab167ccc00000000000000000000000000000000000000000000000000000000865260643584811680910361060657600487015260843590848216809203610606578601526044850152606484015260e43580151580910361060657608484015261010480358015158091036106065760a48501526101249182359164ffffffffff928381168091036106065760c48701526101449283359081168091036106065760e4870152610164359182168092036106065786948694859360009385015261018435908401525af1908115610db357600091610d865750604051908152f35b9450909190508684813d81116126d9575b6126c38183613323565b810103126106065792518493919061257b61256c565b503d6126b9565b6126ec91929350613252565b611ca45787908938612547565b8b809297508195503d8311612725575b6127138183613323565b81010312610606578a925194386124fa565b503d612709565b9092508681813d831161275d575b6127448183613323565b8101031261027e5751848116810361027e5791386124b0565b503d61273a565b503461023c576080908160031936011261023c576127806131e4565b90612789613364565b67ffffffffffffffff9260443584811161028657366023820112156102865780600401359480861161040757602482019160243691610140890201011161040757606435908111610407576127e2903690600401613224565b50506127ec6136b1565b841561040b579091839190825b868110612a7a57506001600160a01b0380941661286f856128186144df565b9516612868604051886020987f23b872dd000000000000000000000000000000000000000000000000000000008a8401521660248201523060448201528260648201526064815261093981613307565b838361422f565b61287887613a7e565b9685879316925b81811061289457604051806109708b826134f7565b806128a18b928488613ba8565b610100018660608a816128b5868986613ba8565b016128bf90613acd565b956128cb868986613ba8565b96888d806128da8a848a613ba8565b016128e490613ada565b94846128f18b858b613ba8565b6128fa90613ada565b988b612907818784613ba8565b60400161291390613a61565b9561291d92613ba8565b0161292790613acd565b9581604051996129368b613295565b16895216908701526fffffffffffffffffffffffffffffffff1660408601528a84860152151590840152151560a08301528436037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600112610606576129e18992612a1995604051906129a7826132eb565b6129b360a08201613453565b82526129d260e060c0926129c8848201613453565b8986015201613453565b604083015284015236906133f7565b60e0820152604051809481927f96ce143100000000000000000000000000000000000000000000000000000000835260048301613bb9565b03818c885af18015612a6f578990612a41575b60019250612a3a828c613b94565b520161287f565b508682813d8311612a68575b612a578183613323565b810103126106065760019151612a2c565b503d612a4d565b6040513d8b823e3d90fd5b926001600160a01b036001916fffffffffffffffffffffffffffffffff612aaa6040610a4b898d8a9c999c613ba8565b16011693019390936127f9565b5061018060031936011261023c57612acd6131e4565b906101607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36011261023c5760405191612b0683613295565b612b0e613364565b8352612b1861320e565b9260209384820152612b286133a5565b9060408101918252612b386133e1565b60608201908152612b4761337a565b6080830152612b54613389565b60a083015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1c36011261060657604051612b8f816132eb565b64ffffffffff60e4358181168103610606578252610104358181168103610606578883015261012435908116810361060657604082015260c083015260407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffebc3601126106065760405191612c02836132cf565b610144356001600160a01b03948582168203610606578796899686612c3b946105c69852610164358982015260e0860152610f316136b1565b6040519485809481937f96ce143100000000000000000000000000000000000000000000000000000000835260048301613bb9565b506003199060408236011261023c57612c876131e4565b916024359067ffffffffffffffff90818311610286576101209083360301126104355760405190612cb782613295565b612cc3836004016131fa565b8252612cd160248401613398565b9460209586840152612ce560448501613398565b6040840152612cf6606485016131fa565b6060840152612d07608485016133c4565b9160808401928352612d1b60a486016131fa565b9460a08501958652612d303660c483016133f7565b60c086015261010481013591821161061e5701366023820112156102825792612d7b6105c693879693612d6e8a973690602460048201359101613465565b60e08501526105566136b1565b6040519485809481937f1684445600000000000000000000000000000000000000000000000000000000835260048301613d1f565b503461023c576003199060a08236011261023c57612dcc6131e4565b906024803593612dda61320e565b6064359367ffffffffffffffff80861161089d576101408660040194873603011261089d5760843590811161089d57612e17903690600401613224565b5050612e216136b1565b612e296136b1565b6001600160a01b03809616604051917feac8f5b800000000000000000000000000000000000000000000000000000000835288600484015260209889848881865afa93841561023f5782946131ac575b5088841690604051937f70a0823100000000000000000000000000000000000000000000000000000000918286523060048701528c868b81875afa9586156103fc57859661317d575b50813b156104075784918a839260405194859384927f40e58ee500000000000000000000000000000000000000000000000000000000845260048401525af1801561082057908c929161316a575b50886040518094819382523060048301525afa91821561061257908995949392613135575b5089979694939291612f469161370d565b612f4e6144df565b612f5792613749565b612f5f6136b1565b169160c4840193612f6f85613ada565b9660a48201956fffffffffffffffffffffffffffffffff9889612f9189613a61565b16612f9a6144df565b84604051918c83017f23b872dd000000000000000000000000000000000000000000000000000000009052168882015230604482015281606482015260648152612fe381613307565b612fed90836137bd565b612ff7918861422f565b6040519889977fc33cd35e0000000000000000000000000000000000000000000000000000000089528960048a015261016489019684613036886131fa565b16818b0152850161304690613453565b64ffffffffff1660448a01526044850161305f90613398565b151560648a01526064850161307390613398565b151560848a01528360848601613088906131fa565b1660a48a0152613097906133c4565b1660c48801526130a6906131fa565b1660e4860152610104850160e48201906130bf91613c6c565b610124016130cc9161418b565b6101406101448601529182905261018484019160005b81811061310c57505050600083809203925af1908115610db357600091610d865750604051908152f35b9290939550819450613120816001936141de565b606080910194019101908694928694926130e2565b809295508a8092503d8311613163575b61314f8183613323565b810103126106065751879390612f46612f35565b503d613145565b61317690949194613252565b9238612f10565b9095508c81813d83116131a5575b6131958183613323565b8101031261040757519438612ec2565b503d61318b565b9093508981813d83116131dd575b6131c48183613323565b8101031261089d5751888116810361089d579238612e79565b503d6131ba565b600435906001600160a01b038216820361060657565b35906001600160a01b038216820361060657565b604435906001600160a01b038216820361060657565b9181601f840112156106065782359167ffffffffffffffff8311610606576020838186019501011161060657565b67ffffffffffffffff811161326657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610100810190811067ffffffffffffffff82111761326657604052565b610120810190811067ffffffffffffffff82111761326657604052565b6040810190811067ffffffffffffffff82111761326657604052565b6060810190811067ffffffffffffffff82111761326657604052565b60a0810190811067ffffffffffffffff82111761326657604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761326657604052565b602435906001600160a01b038216820361060657565b60a43590811515820361060657565b60c43590811515820361060657565b3590811515820361060657565b606435906fffffffffffffffffffffffffffffffff8216820361060657565b35906fffffffffffffffffffffffffffffffff8216820361060657565b608435906001600160a01b038216820361060657565b91908260409103126106065760405161340f816132cf565b602080829461341d816131fa565b84520135910152565b67ffffffffffffffff81116132665760051b60200190565b359067ffffffffffffffff8216820361060657565b359064ffffffffff8216820361060657565b92919261347182613426565b60409461348086519283613323565b8195848352602080930191606080960285019481861161060657925b8584106134ac5750505050505050565b86848303126106065784879184516134c3816132eb565b6134cc876133c4565b81526134d983880161343e565b838201526134e8868801613453565b8682015281520193019261349c565b6020908160408183019282815285518094520193019160005b82811061351e575050505090565b835185529381019392810192600101613510565b9181601f840112156106065782359167ffffffffffffffff8311610606576020808501948460051b01011161060657565b6003196060910112610606576001600160a01b03600435818116810361060657916024359160443590811681036106065790565b6080600319820112610606576001600160a01b0391600435838116810361060657926024359081168103610606579167ffffffffffffffff9160443583811161060657826135e791600401613532565b939093926064359182116106065761360191600401613224565b9091565b91908110156136455760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc181360301821215610606570190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116106065760209260051b809284830137010190565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630146136e357565b60046040517fbbff6135000000000000000000000000000000000000000000000000000000008152fd5b9190820391821161371a57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000060208201526001600160a01b039290921660248301526044808301939093529181526137a39161379e606483613323565b6137bd565b565b90816020910312610606575180151581036106065790565b60405161381b916001600160a01b03166137d6826132cf565b6000806020958685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656487860152868151910182855af16138156138d0565b9161392e565b8051908282159283156138b8575b505050156138345750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b6138c893508201810191016137a5565b388281613829565b3d15613929573d9067ffffffffffffffff8211613266576040519161391d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184613323565b82523d6000602084013e565b606090565b919290156139a95750815115613942575090565b3b1561394b5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b8251909150156139bc5750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110613a39575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b8181018301518682016044015285935082016139f8565b919081101561364557610120020190565b356fffffffffffffffffffffffffffffffff811681036106065790565b90613a8882613426565b613a956040519182613323565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0613ac38294613426565b0190602036910137565b3580151581036106065790565b356001600160a01b03811681036106065790565b6137a39092919261010060e06101408301956001600160a01b038082511685528060208301511660208601526fffffffffffffffffffffffffffffffff6040830151166040860152606082015116606085015260808101511515608085015260a0810151151560a085015260c0810151602064ffffffffff918281511660c0880152015116828501520151910190602080916001600160a01b0381511684520151910152565b80518210156136455760209160051b010190565b919081101561364557610140020190565b6137a39092919261012060e06101608301956001600160a01b038082511685528060208301511660208601526fffffffffffffffffffffffffffffffff6040830151166040860152606082015116606085015260808101511515608085015260a0810151151560a085015260c0810151604064ffffffffff918281511660c088015282602082015116858801520151166101008501520151910190602080916001600160a01b0381511684520151910152565b602080916001600160a01b03613c81826131fa565b1684520135910152565b91908110156136455760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0181360301821215610606570190565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610606570180359067ffffffffffffffff82116106065760200191606082023603831361060657565b9060208083526101408301908061016060e06001600160a01b0395868151168489015283810151151560408901526040810151966060971515888a015280888301511660808a01526fffffffffffffffffffffffffffffffff60808301511660a08a015260a08201511660c0890152613db260c0820151838a0190602080916001600160a01b0381511684520151910152565b015195610120808201528651809552019401926000905b838210613dd857505050505090565b9091929394838282613e246001948a5164ffffffffff604080926fffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152015116910152565b0196019493920190613dc9565b91908110156136455760051b810135907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee181360301821215610606570190565b906020808352610160830190806101806001600160a01b0394858151168388015264ffffffffff8382015116604088015260408101519560609615158789015286820151151560808901528060808301511660a08901526fffffffffffffffffffffffffffffffff60a08301511660c089015260c08201511660e088015260e081015190613f1861010092838a0190602080916001600160a01b0381511684520151910152565b015195610140808201528651809552019401926000905b838210613f3e57505050505090565b9091929394838282613f8a6001948a5164ffffffffff604080926fffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152015116910152565b0196019493920190613f2f565b907f23b872dd000000000000000000000000000000000000000000000000000000006140d792613fc56136b1565b6001600160a01b0380911660a0840191613fde83613ada565b946140f860808201916fffffffffffffffffffffffffffffffff936140458561400686613a61565b1661400f6144df565b9a61403f6040518560209e8f9e8f84015216602482015230604482015283606482015260648152610c9481613307565b8861422f565b604051998a977f168444560000000000000000000000000000000000000000000000000000000089528960048a015261014489019683614084866131fa565b1660248b01526140958b8601613398565b151560448b01526140a860408601613398565b151560648b01526140cc606097856140c18a89016131fa565b1660848d01526133c4565b1660a48a01526131fa565b1660c48701526140ed60e4870160c08301613c6c565b61010081019061418b565b809193610120610124880152526101648501929160005b8281106141645750505050600083809203925af1908115610db357600091614138575b50905090565b82813d831161415d575b61414c8183613323565b8101031261023c5750518038614132565b503d614142565b929550600191949650808461417a8296896141de565b01950191019287949287969461410f565b90357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561060657016020813591019167ffffffffffffffff821161060657606082023603831361060657565b64ffffffffff614229604080936fffffffffffffffffffffffffffffffff614205826133c4565b16865267ffffffffffffffff61421d6020830161343e565b16602087015201613453565b16910152565b91906001600160a01b039283821690604051947fdd62ed3e0000000000000000000000000000000000000000000000000000000086523060048701528116918260248701526020958681604481855afa8015610db35786916000916143d1575b501061429e575b505050505050565b60008060405196614320886142f48b8201937f095ea7b3000000000000000000000000000000000000000000000000000000009889865260248401602090939291936001600160a01b0360408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018a5289613323565b87519082855af1906143306138d0565b8261439e575b5081614393575b501561434a575b80614296565b60405194850152602484015260006044840152604483526080830183811067ffffffffffffffff821117613266576143899361379e91604052826137bd565b3880808080614344565b90503b15153861433d565b8091925051908782159283156143b9575b5050509038614336565b6143c993508201810191016137a5565b3887816143af565b91508782813d83116143fa575b6143e88183613323565b8101031261023c57508590513861428f565b503d6143de565b91908110156136455760051b0190565b91909161441d83613a7e565b9260005b81811061442d57505050565b6001600160a01b036144436109d8838587614401565b16906040805180937f70a0823100000000000000000000000000000000000000000000000000000000825230600483015281602460209687935afa9182156144d557506000916144a4575b506001925061449d8288613b94565b5201614421565b919282813d83116144ce575b6144ba8183613323565b8101031261023c575090600191513861448e565b503d6144b0565b513d6000823e3d90fd5b6040517f8da5cb5b000000000000000000000000000000000000000000000000000000008152602081600481305afa908115610db357600091614520575090565b6020813d8211614556575b8161453860209383613323565b8101031261089d5751906001600160a01b038216820361023c575090565b3d915061452b565b909160005b8181106145705750505050565b6001600160a01b036145866109d8838588614401565b16906040805180937f70a0823100000000000000000000000000000000000000000000000000000000825230600483015281602460209687935afa9182156144d5575060009161460a575b50600192506145ee614604916145e78488613b94565b519061370d565b6145fc6109d884878a614401565b6107bf6144df565b01614563565b919282813d8311614636575b6146208183613323565b8101031261023c575051600191906145ee6145d1565b503d614616565b6001600160a01b031660409081517f70a08231000000000000000000000000000000000000000000000000000000008082526000903060048401526020908184602481885afa9384156147c8578394614799575b50843b156104355785517fd0e30db00000000000000000000000000000000000000000000000000000000081528381600481348a5af1801561478f5761477c575b508190602487518097819382523060048301525afa9182156147715791614741575b506146ff925061370d565b9034820361470b575050565b6044925051907fe5f762580000000000000000000000000000000000000000000000000000000082523460048301526024820152fd5b905082813d831161476a575b6147578183613323565b81010312610606576146ff9151386146f4565b503d61474d565b8551903d90823e3d90fd5b92614788839294613252565b92906146d2565b87513d86823e3d90fd5b9093508181813d83116147c1575b6147b18183613323565b8101031261043557519238614691565b503d6147a7565b86513d85823e3d90fdfea164736f6c6343000815000a"; bytes public constant BYTECODE_PROXY_TARGET_PERMIT2 = @@ -34,15 +28,6 @@ contract Precompiles { DEPLOYERS //////////////////////////////////////////////////////////////////////////*/ - /// @notice Deploys {SablierV2Archive} from precompiled bytecode. - function deployArchive(address initialAdmin) public returns (ISablierV2Archive archive) { - bytes memory creationBytecode = bytes.concat(BYTECODE_ARCHIVE, abi.encode(initialAdmin)); - assembly { - archive := create(0, add(creationBytecode, 0x20), mload(creationBytecode)) - } - require(address(archive) != address(0), "Sablier V2 Precompiles: deployment failed for Archive contract"); - } - /// @notice Deploys {SablierV2Batch} from precompiled bytecode. function deployBatch() public returns (ISablierV2Batch batch) { bytes memory creationBytecode = BYTECODE_BATCH; @@ -64,17 +49,6 @@ contract Precompiles { ); } - /// @notice Deploys {SablierV2ProxyPlugin} from precompiled bytecode. - function deployProxyPlugin(ISablierV2Archive archive) public returns (ISablierV2ProxyPlugin proxyPlugin) { - bytes memory creationBytecode = bytes.concat(BYTECODE_PROXY_PLUGIN, abi.encode(archive)); - assembly { - proxyPlugin := create(0, add(creationBytecode, 0x20), mload(creationBytecode)) - } - require( - address(proxyPlugin) != address(0), "Sablier V2 Precompiles: deployment failed for ProxyPlugin contract" - ); - } - /// @notice Deploys {SablierV2ProxyTargetApprove} from precompiled bytecode. function deployProxyTargetApprove() public returns (ISablierV2ProxyTarget proxyTargetApprove) { bytes memory creationBytecode = BYTECODE_PROXY_TARGET_APPROVE; @@ -116,32 +90,23 @@ contract Precompiles { /// @notice Deploys all V2 Periphery contracts in the following order: /// - /// 1. {SablierV2Archive} - /// 2. {SablierV2Batch} - /// 3. {SablierV2MerkleStreamerFactory} - /// 4. {SablierV2ProxyPlugin} - /// 5. {SablierV2ProxyTargetApprove} - /// 6. {SablierV2ProxyTargetPermit2} - /// 7. {SablierV2ProxyTargetPush} - function deployPeriphery( - address initialAdmin, - IAllowanceTransfer permit2 - ) + /// 1. {SablierV2Batch} + /// 2. {SablierV2MerkleStreamerFactory} + /// 3. {SablierV2ProxyTargetApprove} + /// 4. {SablierV2ProxyTargetPermit2} + /// 5. {SablierV2ProxyTargetPush} + function deployPeriphery(IAllowanceTransfer permit2) public returns ( - ISablierV2Archive archive, ISablierV2Batch batch, ISablierV2MerkleStreamerFactory merkleStreamerFactory, - ISablierV2ProxyPlugin proxyPlugin, ISablierV2ProxyTarget proxyTargetApprove, ISablierV2ProxyTarget proxyTargetPermit2, ISablierV2ProxyTarget proxyTargetPush ) { - archive = deployArchive(initialAdmin); batch = deployBatch(); merkleStreamerFactory = deployMerkleStreamerFactory(); - proxyPlugin = deployProxyPlugin(archive); proxyTargetApprove = deployProxyTargetApprove(); proxyTargetPermit2 = deployProxyTargetPermit2(permit2); proxyTargetPush = deployProxyTargetPush(); diff --git a/test/utils/Precompiles.t.sol b/test/utils/Precompiles.t.sol index 83452ca2..abb50eef 100644 --- a/test/utils/Precompiles.t.sol +++ b/test/utils/Precompiles.t.sol @@ -5,10 +5,8 @@ import { IAllowanceTransfer } from "@uniswap/permit2/interfaces/IAllowanceTransf import { DeployPermit2 } from "@uniswap/permit2-test/utils/DeployPermit2.sol"; import { LibString } from "solady/utils/LibString.sol"; -import { ISablierV2Archive } from "../../src/interfaces/ISablierV2Archive.sol"; import { ISablierV2Batch } from "../../src/interfaces/ISablierV2Batch.sol"; import { ISablierV2MerkleStreamerFactory } from "../../src/interfaces/ISablierV2MerkleStreamerFactory.sol"; -import { ISablierV2ProxyPlugin } from "../../src/interfaces/ISablierV2ProxyPlugin.sol"; import { ISablierV2ProxyTarget } from "../../src/interfaces/ISablierV2ProxyTarget.sol"; import { Base_Test } from "../Base.t.sol"; @@ -26,12 +24,6 @@ contract Precompiles_Test is Base_Test { } } - function test_DeployArchive() external onlyTestOptimizedProfile { - address actualArchive = address(precompiles.deployArchive(users.admin.addr)); - address expectedArchive = address(deployOptimizedArchive(users.admin.addr)); - assertEq(actualArchive.code, expectedArchive.code, "bytecodes mismatch"); - } - function test_DeployBatch() external onlyTestOptimizedProfile { address actualBatch = address(precompiles.deployBatch()); address expectedBatch = address(deployOptimizedBatch()); @@ -44,15 +36,6 @@ contract Precompiles_Test is Base_Test { assertEq(actualFactory.code, expectedFactory.code, "bytecodes mismatch"); } - function test_DeployProxyPlugin() external onlyTestOptimizedProfile { - ISablierV2Archive archive = deployOptimizedArchive(users.admin.addr); - address actualProxyPlugin = address(precompiles.deployProxyPlugin(archive)); - address expectedProxyPlugin = address(deployOptimizedProxyPlugin(archive)); - bytes memory expectedProxyPluginCode = - adjustBytecode(expectedProxyPlugin.code, expectedProxyPlugin, actualProxyPlugin); - assertEq(actualProxyPlugin.code, expectedProxyPluginCode, "bytecodes mismatch"); - } - function test_DeployProxyTargetApprove() external onlyTestOptimizedProfile { address actualProxyTargetApprove = address(precompiles.deployProxyTargetApprove()); address expectedProxyTargetApprove = address(deployOptimizedProxyTargetApprove()); @@ -81,18 +64,13 @@ contract Precompiles_Test is Base_Test { /// @dev Needed to prevent "Stack too deep" error struct Vars { IAllowanceTransfer permit2; - ISablierV2Archive actualArchive; ISablierV2Batch actualBatch; ISablierV2MerkleStreamerFactory actualMerkleStreamerFactory; - ISablierV2ProxyPlugin actualProxyPlugin; ISablierV2ProxyTarget actualProxyTargetApprove; ISablierV2ProxyTarget actualProxyTargetPermit2; ISablierV2ProxyTarget actualProxyTargetPush; - ISablierV2Archive expectedArchive; ISablierV2Batch expectedBatch; ISablierV2MerkleStreamerFactory expectedMerkleStreamerFactory; - ISablierV2ProxyPlugin expectedProxyPlugin; - bytes expectedProxyPluginCode; ISablierV2ProxyTarget expectedProxyTargetApprove; bytes expectedProxyTargetApproveCode; ISablierV2ProxyTarget expectedProxyTargetPermit2; @@ -106,26 +84,21 @@ contract Precompiles_Test is Base_Test { vars.permit2 = IAllowanceTransfer(new DeployPermit2().run()); ( - vars.actualArchive, vars.actualBatch, vars.actualMerkleStreamerFactory, - vars.actualProxyPlugin, vars.actualProxyTargetApprove, vars.actualProxyTargetPermit2, vars.actualProxyTargetPush - ) = precompiles.deployPeriphery(users.admin.addr, permit2); + ) = precompiles.deployPeriphery(permit2); ( - vars.expectedArchive, vars.expectedBatch, vars.expectedMerkleStreamerFactory, - vars.expectedProxyPlugin, vars.expectedProxyTargetApprove, vars.expectedProxyTargetPermit2, vars.expectedProxyTargetPush - ) = deployOptimizedPeriphery(users.admin.addr, permit2); + ) = deployOptimizedPeriphery(permit2); - assertEq(address(vars.actualArchive).code, address(vars.expectedArchive).code, "bytecodes mismatch"); assertEq(address(vars.actualBatch).code, address(vars.expectedBatch).code, "bytecodes mismatch"); assertEq( address(vars.actualMerkleStreamerFactory).code, @@ -133,13 +106,6 @@ contract Precompiles_Test is Base_Test { "bytecodes mismatch" ); - // We need to deploy the Proxy Plugin again here because the address of the Archive passed inside the - // `deployOptimizedPeriphery` function is `vars.expectedProxyPlugin`. Otherwise we cannot adjust the - // bytecode correctly. - vars.expectedProxyPlugin = deployOptimizedProxyPlugin(vars.actualArchive); - vars.expectedProxyPluginCode = adjustBytecode( - address(vars.expectedProxyPlugin).code, address(vars.expectedProxyPlugin), address(vars.actualProxyPlugin) - ); vars.expectedProxyTargetApproveCode = adjustBytecode( address(vars.expectedProxyTargetApprove).code, address(vars.expectedProxyTargetApprove), @@ -158,7 +124,6 @@ contract Precompiles_Test is Base_Test { address(vars.actualProxyTargetPush) ); - assertEq(address(vars.actualProxyPlugin).code, vars.expectedProxyPluginCode, "bytecodes mismatch"); assertEq(address(vars.actualProxyTargetApprove).code, vars.expectedProxyTargetApproveCode, "bytecodes mismatch"); assertEq(address(vars.actualProxyTargetPermit2).code, vars.expectedProxyTargetPermit2Code, "bytecodes mismatch"); assertEq(address(vars.actualProxyTargetPush).code, vars.expectedProxyTargetPushCode, "bytecodes mismatch"); From e1aebc23ddd12900ebb6591c3a7abb2378ac6ee6 Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Wed, 18 Oct 2023 23:33:35 +0300 Subject: [PATCH 2/5] build: bump v2-core --- lib/v2-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2-core b/lib/v2-core index 52df5c15..edf3609d 160000 --- a/lib/v2-core +++ b/lib/v2-core @@ -1 +1 @@ -Subproject commit 52df5c15da76e47ca396fcf4986fefade0db237f +Subproject commit edf3609dd27b17f69da603624746aae282627b05 From 9067e25371ca26387115722a982e399a79c85a17 Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Wed, 18 Oct 2023 23:44:02 +0300 Subject: [PATCH 3/5] chore: update .gas-snapshot --- .gas-snapshot | 276 ++++++++++++++++++++++++++++---------------------- 1 file changed, 154 insertions(+), 122 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index b7af7fe3..447dad07 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,124 +1,156 @@ -BatchCancelMultiple_TargetApprove_Integration_Test:test_BatchCancelMultiple() (gas: 4205436) -BatchCancelMultiple_TargetPermit2_Integration_Test:test_BatchCancelMultiple() (gas: 4290671) -BatchCancelMultiple_TargetPush_Integration_Test:test_BatchCancelMultiple() (gas: 4190462) -BatchCreateWithDeltas_TargetApprove_Integration_Test:test_BatchCreateWithDeltas() (gas: 2142864) -BatchCreateWithDeltas_TargetPermit2_Integration_Test:test_BatchCreateWithDeltas() (gas: 2200779) -BatchCreateWithDeltas_TargetPush_Integration_Test:test_BatchCreateWithDeltas() (gas: 2132906) -BatchCreateWithDurations_TargetApprove_Integration_Test:test_BatchCreateWithDurations() (gas: 1363217) -BatchCreateWithDurations_TargetPermit2_Integration_Test:test_BatchCreateWithDurations() (gas: 1421124) -BatchCreateWithDurations_TargetPush_Integration_Test:test_BatchCreateWithDurations() (gas: 1353391) -BatchCreateWithMilestones_TargetApprove_Integration_Test:test_BatchCreateWithMilestones() (gas: 2126222) -BatchCreateWithMilestones_TargetPermit2_Integration_Test:test_BatchCreateWithMilestones() (gas: 2184004) -BatchCreateWithMilestones_TargetPush_Integration_Test:test_BatchCreateWithMilestones() (gas: 2116097) -BatchCreateWithRange_TargetApprove_Integration_Test:test_BatchCreateWithRange() (gas: 1373322) -BatchCreateWithRange_TargetPermit2_Integration_Test:test_BatchCreateWithRange() (gas: 1431130) -BatchCreateWithRange_TargetPush_Integration_Test:test_BatchCreateWithRange() (gas: 1363331) -Burn_TargetApprove_Integration_Test:test_Burn_LockupDynamic() (gas: 331138) -Burn_TargetApprove_Integration_Test:test_Burn_LockupLinear() (gas: 269868) -Burn_TargetPermit2_Integration_Test:test_Burn_LockupDynamic() (gas: 377306) -Burn_TargetPermit2_Integration_Test:test_Burn_LockupLinear() (gas: 315917) -Burn_TargetPush_Integration_Test:test_Burn_LockupDynamic() (gas: 292060) -Burn_TargetPush_Integration_Test:test_Burn_LockupLinear() (gas: 230799) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDeltas_AcrossSablierContracts() (gas: 571159) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDeltas_SameSablierContract() (gas: 610992) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDurations_AcrossSablierContracts() (gas: 567009) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDurations_SameSablierContract() (gas: 453169) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithMilestones_AcrossSablierContracts() (gas: 569891) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithMilestones_SameSablierContract() (gas: 607530) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithRange_AcrossSablierContracts() (gas: 568615) -CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithRange_SameSablierContract() (gas: 455484) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDeltas_AcrossSablierContracts() (gas: 655964) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDeltas_SameSablierContract() (gas: 695807) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDurations_AcrossSablierContracts() (gas: 651847) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDurations_SameSablierContract() (gas: 534314) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithMilestones_AcrossSablierContracts() (gas: 654714) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithMilestones_SameSablierContract() (gas: 692395) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithRange_AcrossSablierContracts() (gas: 653440) -CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithRange_SameSablierContract() (gas: 537204) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDeltas_AcrossSablierContracts() (gas: 557866) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDeltas_SameSablierContract() (gas: 597690) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDurations_AcrossSablierContracts() (gas: 553711) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDurations_SameSablierContract() (gas: 436235) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithMilestones_AcrossSablierContracts() (gas: 556593) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithMilestones_SameSablierContract() (gas: 594221) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithRange_AcrossSablierContracts() (gas: 555316) -CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithRange_SameSablierContract() (gas: 439133) -CancelMultiple_TargetApprove_Integration_Test:test_CancelMultiple_LockupDynamic() (gas: 2540742) -CancelMultiple_TargetApprove_Integration_Test:test_CancelMultiple_LockupLinear() (gas: 1738790) -CancelMultiple_TargetPermit2_Integration_Test:test_CancelMultiple_LockupDynamic() (gas: 2598542) -CancelMultiple_TargetPermit2_Integration_Test:test_CancelMultiple_LockupLinear() (gas: 1796563) -CancelMultiple_TargetPush_Integration_Test:test_CancelMultiple_LockupDynamic() (gas: 2535529) -CancelMultiple_TargetPush_Integration_Test:test_CancelMultiple_LockupLinear() (gas: 1733692) -Cancel_TargetApprove_Integration_Test:test_Cancel_LockupDynamic() (gas: 387580) -Cancel_TargetApprove_Integration_Test:test_Cancel_LockupLinear() (gas: 307459) -Cancel_TargetPermit2_Integration_Test:test_Cancel_LockupDynamic() (gas: 445228) -Cancel_TargetPermit2_Integration_Test:test_Cancel_LockupLinear() (gas: 365047) -Cancel_TargetPush_Integration_Test:test_Cancel_LockupDynamic() (gas: 381443) -Cancel_TargetPush_Integration_Test:test_Cancel_LockupLinear() (gas: 301313) -Claim_Integration_Test:test_Claim() (gas: 265268) -Clawback_Integration_Test:testFuzz_Clawback(address) (runs: 20, μ: 279626, ~: 279626) -Constructor_MerkleStreamerLL_Integration_Test:test_Constructor() (gas: 1040641) -CreateMerkleStreamerLL_Integration_Test:testFuzz_CreateMerkleStreamerLL(address,uint40) (runs: 20, μ: 1026159, ~: 1028149) -CreateWithDeltas_Integration_Test:test_BatchCreateWithDeltas() (gas: 2055527) -CreateWithDurations_Integration_Test:test_BatchCreateWithDurations() (gas: 1307079) -CreateWithMilestones_Integration_Test:test_BatchCreateWithMilestones() (gas: 2035074) -CreateWithRange_Integration_Test:test_CreateWithRange() (gas: 1313740) -GetMerkleStreamers_Integration_Test:test_GetMerkleStreamers() (gas: 965469) +BatchCancelMultiple_TargetApprove_Integration_Test:test_BatchCancelMultiple() (gas: 4279984) +BatchCancelMultiple_TargetPermit2_Integration_Test:test_BatchCancelMultiple() (gas: 4365085) +BatchCancelMultiple_TargetPush_Integration_Test:test_BatchCancelMultiple() (gas: 4264839) +BatchCreateWithDeltas_TargetApprove_Integration_Test:test_BatchCreateWithDeltas() (gas: 2165768) +BatchCreateWithDeltas_TargetPermit2_Integration_Test:test_BatchCreateWithDeltas() (gas: 2223240) +BatchCreateWithDeltas_TargetPush_Integration_Test:test_BatchCreateWithDeltas() (gas: 2155334) +BatchCreateWithDurations_TargetApprove_Integration_Test:test_BatchCreateWithDurations() (gas: 1398065) +BatchCreateWithDurations_TargetPermit2_Integration_Test:test_BatchCreateWithDurations() (gas: 1455767) +BatchCreateWithDurations_TargetPush_Integration_Test:test_BatchCreateWithDurations() (gas: 1387974) +BatchCreateWithMilestones_TargetApprove_Integration_Test:test_BatchCreateWithMilestones() (gas: 2163757) +BatchCreateWithMilestones_TargetPermit2_Integration_Test:test_BatchCreateWithMilestones() (gas: 2221573) +BatchCreateWithMilestones_TargetPush_Integration_Test:test_BatchCreateWithMilestones() (gas: 2153632) +BatchCreateWithRange_TargetApprove_Integration_Test:test_BatchCreateWithRange() (gas: 1404653) +BatchCreateWithRange_TargetPermit2_Integration_Test:test_BatchCreateWithRange() (gas: 1462292) +BatchCreateWithRange_TargetPush_Integration_Test:test_BatchCreateWithRange() (gas: 1394491) +Burn_TargetApprove_Integration_Test:test_Burn_LockupDynamic() (gas: 335300) +Burn_TargetApprove_Integration_Test:test_Burn_LockupLinear() (gas: 273344) +Burn_TargetPermit2_Integration_Test:test_Burn_LockupDynamic() (gas: 382480) +Burn_TargetPermit2_Integration_Test:test_Burn_LockupLinear() (gas: 319415) +Burn_TargetPush_Integration_Test:test_Burn_LockupDynamic() (gas: 296206) +Burn_TargetPush_Integration_Test:test_Burn_LockupLinear() (gas: 234276) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDeltas_AcrossSablierContracts() (gas: 577216) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDeltas_SameSablierContract() (gas: 615744) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDurations_AcrossSablierContracts() (gas: 575048) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithDurations_SameSablierContract() (gas: 459612) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithMilestones_AcrossSablierContracts() (gas: 576806) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithMilestones_SameSablierContract() (gas: 615268) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithRange_AcrossSablierContracts() (gas: 576141) +CancelAndCreate_TargetApprove_Integration_Test:test_CancelAndCreateWithRange_SameSablierContract() (gas: 460847) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDeltas_AcrossSablierContracts() (gas: 662069) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDeltas_SameSablierContract() (gas: 700607) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDurations_AcrossSablierContracts() (gas: 659866) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithDurations_SameSablierContract() (gas: 542409) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithMilestones_AcrossSablierContracts() (gas: 661668) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithMilestones_SameSablierContract() (gas: 700119) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithRange_AcrossSablierContracts() (gas: 660960) +CancelAndCreate_TargetPermit2_Integration_Test:test_CancelAndCreateWithRange_SameSablierContract() (gas: 543954) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDeltas_AcrossSablierContracts() (gas: 563919) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDeltas_SameSablierContract() (gas: 602435) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDurations_AcrossSablierContracts() (gas: 561728) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithDurations_SameSablierContract() (gas: 444293) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithMilestones_AcrossSablierContracts() (gas: 563514) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithMilestones_SameSablierContract() (gas: 601942) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithRange_AcrossSablierContracts() (gas: 562820) +CancelAndCreate_TargetPush_Integration_Test:test_CancelAndCreateWithRange_SameSablierContract() (gas: 445836) +CancelMultiple_TargetApprove_Integration_Test:test_CancelMultiple_LockupDynamic() (gas: 2580879) +CancelMultiple_TargetApprove_Integration_Test:test_CancelMultiple_LockupLinear() (gas: 1772627) +CancelMultiple_TargetPermit2_Integration_Test:test_CancelMultiple_LockupDynamic() (gas: 2638711) +CancelMultiple_TargetPermit2_Integration_Test:test_CancelMultiple_LockupLinear() (gas: 1830264) +CancelMultiple_TargetPush_Integration_Test:test_CancelMultiple_LockupDynamic() (gas: 2575666) +CancelMultiple_TargetPush_Integration_Test:test_CancelMultiple_LockupLinear() (gas: 1767359) +Cancel_TargetApprove_Integration_Test:test_Cancel_LockupDynamic() (gas: 391578) +Cancel_TargetApprove_Integration_Test:test_Cancel_LockupLinear() (gas: 310624) +Cancel_TargetPermit2_Integration_Test:test_Cancel_LockupDynamic() (gas: 449197) +Cancel_TargetPermit2_Integration_Test:test_Cancel_LockupLinear() (gas: 368239) +Cancel_TargetPush_Integration_Test:test_Cancel_LockupDynamic() (gas: 385420) +Cancel_TargetPush_Integration_Test:test_Cancel_LockupLinear() (gas: 304482) +Claim_Integration_Test:test_Claim() (gas: 276787) +Claim_Integration_Test:test_RevertGiven_AlreadyClaimed() (gas: 264794) +Clawback_Integration_Test:testFuzz_Clawback(address) (runs: 20, μ: 289894, ~: 289894) +Constructor_MerkleStreamerLL_Integration_Test:test_Constructor() (gas: 1057889) +CreateMerkleStreamerLL_Integration_Test:testFuzz_CreateMerkleStreamerLL(address,uint40) (runs: 20, μ: 1026355, ~: 1026355) +CreateMerkleStreamerLL_Integration_Test:test_RevertGiven_AlreadyDeployed() (gas: 8937393460516730614) +CreateWithDeltas_Integration_Test:test_BatchCreateWithDeltas() (gas: 2074463) +CreateWithDurations_Integration_Test:test_BatchCreateWithDurations() (gas: 1338378) +CreateWithMilestones_Integration_Test:test_BatchCreateWithMilestones() (gas: 2067917) +CreateWithRange_Integration_Test:test_CreateWithRange() (gas: 1340546) +GetMerkleStreamers_Integration_Test:test_GetMerkleStreamers() (gas: 964471) GetMerkleStreamers_Integration_Test:test_GetMerkleStreamers_AdminDoesNotHaveMerkleStreamers(address) (runs: 20, μ: 13532, ~: 13532) -GetMethods_Integration_Test:test_GetMethods() (gas: 7316) -HasClaimed_Integration_Test:test_HasClaimed() (gas: 239627) -HasClaimed_Integration_Test:test_HasClaimed_IndexNotInTree() (gas: 7945) -HasClaimed_Integration_Test:test_HasClaimed_NotClaimed() (gas: 13180) -HasExpired_Integration_Test:test_HasExpired_ExpirationEqualToCurrentTime() (gas: 13927) -HasExpired_Integration_Test:test_HasExpired_ExpirationGreaterThanCurrentTime() (gas: 14021) +HasClaimed_Integration_Test:test_HasClaimed() (gas: 249939) +HasClaimed_Integration_Test:test_HasClaimed_IndexNotInTree() (gas: 7989) +HasClaimed_Integration_Test:test_HasClaimed_NotClaimed() (gas: 13246) +HasExpired_Integration_Test:test_HasExpired_ExpirationEqualToCurrentTime() (gas: 13949) +HasExpired_Integration_Test:test_HasExpired_ExpirationGreaterThanCurrentTime() (gas: 14043) HasExpired_Integration_Test:test_HasExpired_ExpirationLessThanCurrentTime() (gas: 5738) -HasExpired_Integration_Test:test_HasExpired_ExpirationZero() (gas: 957429) -List_Integration_Test:test_List() (gas: 39850) -List_Integration_Test:test_List_AddressListed() (gas: 42524) -List_Integration_Test:test_List_Event() (gas: 40774) -OnStreamCanceled_Integration_Test:test_OnStreamCanceled() (gas: 125870) -Renounce_TargetApprove_Integration_Test:test_Renounce_LockupDynamic() (gas: 352490) -Renounce_TargetApprove_Integration_Test:test_Renounce_LockupLinear() (gas: 266038) -Renounce_TargetPermit2_Integration_Test:test_Renounce_LockupDynamic() (gas: 410108) -Renounce_TargetPermit2_Integration_Test:test_Renounce_LockupLinear() (gas: 323612) -Renounce_TargetPush_Integration_Test:test_Renounce_LockupDynamic() (gas: 343443) -Renounce_TargetPush_Integration_Test:test_Renounce_LockupLinear() (gas: 257001) -Unlist_Integration_Test:test_Unlist() (gas: 29885) -Unlist_Integration_Test:test_Unlist_AddressNotListed() (gas: 20004) -Unlist_Integration_Test:test_Unlist_Event() (gas: 30699) -WithdrawMaxAndTransfer_TargetApprove_Integration_Test:test_WithdrawMaxAndTransfer_LockupDynamic() (gas: 390554) -WithdrawMaxAndTransfer_TargetApprove_Integration_Test:test_WithdrawMaxAndTransfer_LockupLinear() (gas: 307258) -WithdrawMaxAndTransfer_TargetPermit2_Integration_Test:test_WithdrawMaxAndTransfer_LockupDynamic() (gas: 448172) -WithdrawMaxAndTransfer_TargetPermit2_Integration_Test:test_WithdrawMaxAndTransfer_LockupLinear() (gas: 364813) -WithdrawMaxAndTransfer_TargetPush_Integration_Test:test_WithdrawMaxAndTransfer_LockupDynamic() (gas: 360662) -WithdrawMaxAndTransfer_TargetPush_Integration_Test:test_WithdrawMaxAndTransfer_LockupLinear() (gas: 277367) -WithdrawMax_TargetApprove_Integration_Test:test_WithdrawMax_Linear() (gas: 266022) -WithdrawMax_TargetApprove_Integration_Test:test_WithdrawMax_LockupDynamic() (gas: 342661) -WithdrawMax_TargetPermit2_Integration_Test:test_WithdrawMax_Linear() (gas: 323586) -WithdrawMax_TargetPermit2_Integration_Test:test_WithdrawMax_LockupDynamic() (gas: 400279) -WithdrawMax_TargetPush_Integration_Test:test_WithdrawMax_Linear() (gas: 256030) -WithdrawMax_TargetPush_Integration_Test:test_WithdrawMax_LockupDynamic() (gas: 332669) -WithdrawMultiple_TargetApprove_Integration_Test:test_WithdrawMultiple_LockupDynamic() (gas: 2336753) -WithdrawMultiple_TargetApprove_Integration_Test:test_WithdrawMultiple_LockupLinear() (gas: 1533930) -WithdrawMultiple_TargetPermit2_Integration_Test:test_WithdrawMultiple_LockupDynamic() (gas: 2394523) -WithdrawMultiple_TargetPermit2_Integration_Test:test_WithdrawMultiple_LockupLinear() (gas: 1591673) -WithdrawMultiple_TargetPush_Integration_Test:test_WithdrawMultiple_LockupDynamic() (gas: 2327685) -WithdrawMultiple_TargetPush_Integration_Test:test_WithdrawMultiple_LockupLinear() (gas: 1524991) -Withdraw_TargetApprove_Integration_Test:test_Withdraw_LockupDynamic() (gas: 365888) -Withdraw_TargetApprove_Integration_Test:test_Withdraw_LockupLinear() (gas: 285883) -Withdraw_TargetPermit2_Integration_Test:test_Withdraw_LockupDynamic() (gas: 423506) -Withdraw_TargetPermit2_Integration_Test:test_Withdraw_LockupLinear() (gas: 343438) -Withdraw_TargetPush_Integration_Test:test_Withdraw_LockupDynamic() (gas: 355896) -Withdraw_TargetPush_Integration_Test:test_Withdraw_LockupLinear() (gas: 275892) -WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithDeltas() (gas: 351868) -WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithDurations() (gas: 273419) -WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithMilestones() (gas: 349526) -WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithRange() (gas: 274165) -WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithDeltas() (gas: 351898) -WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithDurations() (gas: 273449) -WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithMilestones() (gas: 349556) -WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithRange() (gas: 274195) -WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithDeltas() (gas: 350821) -WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithDurations() (gas: 272373) -WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithMilestones() (gas: 348480) -WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithRange() (gas: 273119) \ No newline at end of file +HasExpired_Integration_Test:test_HasExpired_ExpirationZero() (gas: 956412) +MerkleBuilder_Test:testFuzz_ComputeLeaf(uint256,address,uint128) (runs: 20, μ: 1176, ~: 1176) +MerkleBuilder_Test:testFuzz_ComputeLeaves((uint256,address,uint128)[]) (runs: 20, μ: 329364, ~: 332179) +Precompiles_Test:test_DeployBatch() (gas: 2809098) +Precompiles_Test:test_DeployMerkleStreamerFactory() (gas: 2935320) +Precompiles_Test:test_DeployPeriphery() (gas: 40999541) +Precompiles_Test:test_DeployProxyTargetApprove() (gas: 11198860) +Precompiles_Test:test_DeployProxyTargetPermit2() (gas: 13005097) +Precompiles_Test:test_DeployProxyTargetPush() (gas: 10373924) +Renounce_TargetApprove_Integration_Test:test_Renounce_LockupDynamic() (gas: 356441) +Renounce_TargetApprove_Integration_Test:test_Renounce_LockupLinear() (gas: 268998) +Renounce_TargetPermit2_Integration_Test:test_Renounce_LockupDynamic() (gas: 414030) +Renounce_TargetPermit2_Integration_Test:test_Renounce_LockupLinear() (gas: 326599) +Renounce_TargetPush_Integration_Test:test_Renounce_LockupDynamic() (gas: 347373) +Renounce_TargetPush_Integration_Test:test_Renounce_LockupLinear() (gas: 259962) +USDC_BatchCancelMultiple_TargetApprove_Fork_Test:testForkFuzz_BatchCancelMultiple(uint256) (runs: 20, μ: 11086304, ~: 12481506) +USDC_BatchCancelMultiple_TargetPermit2_Fork_Test:testForkFuzz_BatchCancelMultiple(uint256) (runs: 20, μ: 10074423, ~: 10730331) +USDC_BatchCancelMultiple_TargetPush_Fork_Test:testForkFuzz_BatchCancelMultiple(uint256) (runs: 20, μ: 9529203, ~: 8589940) +USDC_BatchCreate_TargetApprove_Fork_Test:testForkFuzz_BatchCreateWithMilestones((uint128,address,uint128,uint40,(uint128,uint64,uint40)[],uint256)) (runs: 20, μ: 44879789, ~: 46145987) +USDC_BatchCreate_TargetApprove_Fork_Test:testForkFuzz_BatchCreateWithRange((uint128,(uint40,uint40,uint40),address,uint128,uint256)) (runs: 20, μ: 1675149, ~: 1521629) +USDC_BatchCreate_TargetPermit2_Fork_Test:testForkFuzz_BatchCreateWithMilestones((uint128,address,uint128,uint40,(uint128,uint64,uint40)[],uint256)) (runs: 20, μ: 45152074, ~: 48044873) +USDC_BatchCreate_TargetPermit2_Fork_Test:testForkFuzz_BatchCreateWithRange((uint128,(uint40,uint40,uint40),address,uint128,uint256)) (runs: 20, μ: 1844369, ~: 1948810) +USDC_BatchCreate_TargetPush_Fork_Test:testForkFuzz_BatchCreateWithMilestones((uint128,address,uint128,uint40,(uint128,uint64,uint40)[],uint256)) (runs: 20, μ: 41352354, ~: 35401416) +USDC_BatchCreate_TargetPush_Fork_Test:testForkFuzz_BatchCreateWithRange((uint128,(uint40,uint40,uint40),address,uint128,uint256)) (runs: 20, μ: 1831920, ~: 1948267) +USDC_CreateWithMilestones_Batch_Fork_Test:testForkFuzz_CreateWithMilestones((uint128,address,address,uint128,uint40,(uint128,uint64,uint40)[])) (runs: 20, μ: 40474682, ~: 31218338) +USDC_CreateWithRange_Batch_Fork_Test:testForkFuzz_CreateWithRange((uint128,(uint40,uint40,uint40),address,address,uint128)) (runs: 20, μ: 1449211, ~: 1694983) +USDC_MerkleStreamerLL_Fork_Test:testForkFuzz_MerkleStreamerLL((address,uint40,(uint256,uint256,uint128)[],uint256)) (runs: 20, μ: 5061479, ~: 4385208) +USDT_BatchCancelMultiple_TargetApprove_Fork_Test:testForkFuzz_BatchCancelMultiple(uint256) (runs: 20, μ: 11086304, ~: 12481506) +USDT_BatchCancelMultiple_TargetPermit2_Fork_Test:testForkFuzz_BatchCancelMultiple(uint256) (runs: 20, μ: 10074423, ~: 10730331) +USDT_BatchCancelMultiple_TargetPush_Fork_Test:testForkFuzz_BatchCancelMultiple(uint256) (runs: 20, μ: 9529203, ~: 8589940) +USDT_BatchCreate_TargetApprove_Fork_Test:testForkFuzz_BatchCreateWithMilestones((uint128,address,uint128,uint40,(uint128,uint64,uint40)[],uint256)) (runs: 20, μ: 44879789, ~: 46145987) +USDT_BatchCreate_TargetApprove_Fork_Test:testForkFuzz_BatchCreateWithRange((uint128,(uint40,uint40,uint40),address,uint128,uint256)) (runs: 20, μ: 1675149, ~: 1521629) +USDT_BatchCreate_TargetPermit2_Fork_Test:testForkFuzz_BatchCreateWithMilestones((uint128,address,uint128,uint40,(uint128,uint64,uint40)[],uint256)) (runs: 20, μ: 45152074, ~: 48044873) +USDT_BatchCreate_TargetPermit2_Fork_Test:testForkFuzz_BatchCreateWithRange((uint128,(uint40,uint40,uint40),address,uint128,uint256)) (runs: 20, μ: 1844369, ~: 1948810) +USDT_BatchCreate_TargetPush_Fork_Test:testForkFuzz_BatchCreateWithMilestones((uint128,address,uint128,uint40,(uint128,uint64,uint40)[],uint256)) (runs: 20, μ: 41352354, ~: 35401416) +USDT_BatchCreate_TargetPush_Fork_Test:testForkFuzz_BatchCreateWithRange((uint128,(uint40,uint40,uint40),address,uint128,uint256)) (runs: 20, μ: 1831920, ~: 1948267) +USDT_CreateWithMilestones_Batch_Fork_Test:testForkFuzz_CreateWithMilestones((uint128,address,address,uint128,uint40,(uint128,uint64,uint40)[])) (runs: 20, μ: 40474682, ~: 31218338) +USDT_CreateWithRange_Batch_Fork_Test:testForkFuzz_CreateWithRange((uint128,(uint40,uint40,uint40),address,address,uint128)) (runs: 20, μ: 1449211, ~: 1694983) +USDT_MerkleStreamerLL_Fork_Test:testForkFuzz_MerkleStreamerLL((address,uint40,(uint256,uint256,uint128)[],uint256)) (runs: 20, μ: 5061479, ~: 4385208) +WithdrawMaxAndTransfer_TargetApprove_Integration_Test:test_WithdrawMaxAndTransfer_LockupDynamic() (gas: 398281) +WithdrawMaxAndTransfer_TargetApprove_Integration_Test:test_WithdrawMaxAndTransfer_LockupLinear() (gas: 314084) +WithdrawMaxAndTransfer_TargetPermit2_Integration_Test:test_WithdrawMaxAndTransfer_LockupDynamic() (gas: 455870) +WithdrawMaxAndTransfer_TargetPermit2_Integration_Test:test_WithdrawMaxAndTransfer_LockupLinear() (gas: 371666) +WithdrawMaxAndTransfer_TargetPush_Integration_Test:test_WithdrawMaxAndTransfer_LockupDynamic() (gas: 368368) +WithdrawMaxAndTransfer_TargetPush_Integration_Test:test_WithdrawMaxAndTransfer_LockupLinear() (gas: 284193) +WithdrawMax_TargetApprove_Integration_Test:test_WithdrawMax_Linear() (gas: 268950) +WithdrawMax_TargetApprove_Integration_Test:test_WithdrawMax_LockupDynamic() (gas: 346388) +WithdrawMax_TargetPermit2_Integration_Test:test_WithdrawMax_Linear() (gas: 326542) +WithdrawMax_TargetPermit2_Integration_Test:test_WithdrawMax_LockupDynamic() (gas: 403977) +WithdrawMax_TargetPush_Integration_Test:test_WithdrawMax_Linear() (gas: 258960) +WithdrawMax_TargetPush_Integration_Test:test_WithdrawMax_LockupDynamic() (gas: 336375) +WithdrawMultiple_TargetApprove_Integration_Test:test_WithdrawMultiple_LockupDynamic() (gas: 2374009) +WithdrawMultiple_TargetApprove_Integration_Test:test_WithdrawMultiple_LockupLinear() (gas: 1565732) +WithdrawMultiple_TargetPermit2_Integration_Test:test_WithdrawMultiple_LockupDynamic() (gas: 2431811) +WithdrawMultiple_TargetPermit2_Integration_Test:test_WithdrawMultiple_LockupLinear() (gas: 1623339) +WithdrawMultiple_TargetPush_Integration_Test:test_WithdrawMultiple_LockupDynamic() (gas: 2364941) +WithdrawMultiple_TargetPush_Integration_Test:test_WithdrawMultiple_LockupLinear() (gas: 1556623) +Withdraw_TargetApprove_Integration_Test:test_Withdraw_LockupDynamic() (gas: 369772) +Withdraw_TargetApprove_Integration_Test:test_Withdraw_LockupLinear() (gas: 288951) +Withdraw_TargetPermit2_Integration_Test:test_Withdraw_LockupDynamic() (gas: 427361) +Withdraw_TargetPermit2_Integration_Test:test_Withdraw_LockupLinear() (gas: 346533) +Withdraw_TargetPush_Integration_Test:test_Withdraw_LockupDynamic() (gas: 359759) +Withdraw_TargetPush_Integration_Test:test_Withdraw_LockupLinear() (gas: 278960) +WrapAndCreate_TargetApprove_Fork_Test:testForkFuzz_WrapAndCreateWithMilestones(uint256,uint256) (runs: 20, μ: 334175, ~: 334205) +WrapAndCreate_TargetApprove_Fork_Test:testForkFuzz_WrapAndCreateWithRange(uint256) (runs: 20, μ: 256936, ~: 256685) +WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithDeltas() (gas: 353424) +WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithDurations() (gas: 277060) +WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithMilestones() (gas: 353634) +WrapAndCreate_TargetApprove_Integration_Test:test_WrapAndCreateWithRange() (gas: 277339) +WrapAndCreate_TargetPermit2_Fork_Test:testForkFuzz_WrapAndCreateWithMilestones(uint256,uint256) (runs: 20, μ: 334205, ~: 334235) +WrapAndCreate_TargetPermit2_Fork_Test:testForkFuzz_WrapAndCreateWithRange(uint256) (runs: 20, μ: 257001, ~: 256855) +WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithDeltas() (gas: 353454) +WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithDurations() (gas: 277090) +WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithMilestones() (gas: 353664) +WrapAndCreate_TargetPermit2_Integration_Test:test_WrapAndCreateWithRange() (gas: 277369) +WrapAndCreate_TargetPush_Fork_Test:testForkFuzz_WrapAndCreateWithMilestones(uint256,uint256) (runs: 20, μ: 333127, ~: 333157) +WrapAndCreate_TargetPush_Fork_Test:testForkFuzz_WrapAndCreateWithRange(uint256) (runs: 20, μ: 255855, ~: 255638) +WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithDeltas() (gas: 352378) +WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithDurations() (gas: 276014) +WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithMilestones() (gas: 352588) +WrapAndCreate_TargetPush_Integration_Test:test_WrapAndCreateWithRange() (gas: 276293) \ No newline at end of file From d97d7f2e76152c09162e0d5a3dddd8f336359317 Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Wed, 18 Oct 2023 23:47:41 +0300 Subject: [PATCH 4/5] docs: include plugin and archive removal in changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e94e3007..40d545a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ The format is based on [Common Changelog](https://common-changelog.org). ### Removed +- **Breaking**: Remove `ProxyPlugin` and `Archive` contracts + ([#213](https://github.com/sablier-labs/v2-periphery/pull/213)) - Remove `@openzeppelin/contracts` from Node.js peer dependencies ([#194](https://github.com/sablier-labs/v2-periphery/pull/194)) From ffa65fae88880bd9656731198c572c23c9d787b9 Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Thu, 19 Oct 2023 14:04:05 +0300 Subject: [PATCH 5/5] test: correct typos in comments --- test/Base.t.sol | 2 +- test/utils/DeployOptimized.sol | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Base.t.sol b/test/Base.t.sol index db34a8f4..348573a8 100644 --- a/test/Base.t.sol +++ b/test/Base.t.sol @@ -108,7 +108,7 @@ abstract contract Base_Test is Assertions, DeployOptimized, Events, Merkle, V2Co deal({ token: address(asset), to: user.addr, give: 1_000_000e18 }); } - /// @dev Conditionally deploy V2 Periphery normally or from a optimized source compiled with `--via-ir`. + /// @dev Conditionally deploy V2 Periphery normally or from an optimized source compiled with `--via-ir`. function deployPeripheryConditionally() internal { if (!isTestOptimizedProfile()) { batch = new SablierV2Batch(); diff --git a/test/utils/DeployOptimized.sol b/test/utils/DeployOptimized.sol index c86ab760..d2593035 100644 --- a/test/utils/DeployOptimized.sol +++ b/test/utils/DeployOptimized.sol @@ -11,26 +11,26 @@ import { SablierV2ProxyTargetPermit2 } from "../../src/SablierV2ProxyTargetPermi import { SablierV2ProxyTargetPush } from "../../src/SablierV2ProxyTargetPush.sol"; abstract contract DeployOptimized is StdCheats { - /// @dev Deploys {SablierV2Batch} from a optimized source compiled with `--via-ir`. + /// @dev Deploys {SablierV2Batch} from an optimized source compiled with `--via-ir`. function deployOptimizedBatch() internal returns (ISablierV2Batch) { return ISablierV2Batch(deployCode("out-optimized/SablierV2Batch.sol/SablierV2Batch.json")); } - /// @dev Deploys {SablierV2MerkleStreamerFactory} from a optimized source compiled with `--via-ir`. + /// @dev Deploys {SablierV2MerkleStreamerFactory} from an optimized source compiled with `--via-ir`. function deployOptimizedMerkleStreamerFactory() internal returns (ISablierV2MerkleStreamerFactory) { return ISablierV2MerkleStreamerFactory( deployCode("out-optimized/SablierV2MerkleStreamerFactory.sol/SablierV2MerkleStreamerFactory.json") ); } - /// @dev Deploys {SablierV2ProxyTargetApprove} from a optimized source compiled with `--via-ir`. + /// @dev Deploys {SablierV2ProxyTargetApprove} from an optimized source compiled with `--via-ir`. function deployOptimizedProxyTargetApprove() internal returns (SablierV2ProxyTargetApprove) { return SablierV2ProxyTargetApprove( deployCode("out-optimized/SablierV2ProxyTargetApprove.sol/SablierV2ProxyTargetApprove.json") ); } - /// @dev Deploys {SablierV2ProxyTargetPermit2} from a optimized source compiled with `--via-ir`. + /// @dev Deploys {SablierV2ProxyTargetPermit2} from an optimized source compiled with `--via-ir`. function deployOptimizedProxyTargetPermit2(IAllowanceTransfer permit2_) internal returns (SablierV2ProxyTargetPermit2) @@ -42,7 +42,7 @@ abstract contract DeployOptimized is StdCheats { ); } - /// @dev Deploys {SablierV2ProxyTargetPush} from a optimized source compiled with `--via-ir`. + /// @dev Deploys {SablierV2ProxyTargetPush} from an optimized source compiled with `--via-ir`. function deployOptimizedProxyTargetPush() internal returns (SablierV2ProxyTargetPush) { return SablierV2ProxyTargetPush( deployCode("out-optimized/SablierV2ProxyTargetPush.sol/SablierV2ProxyTargetPush.json")