Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "ProxyPlugin" and "Archive" #213

Merged
merged 5 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 154 additions & 122 deletions .gas-snapshot

Large diffs are not rendered by default.

54 changes: 0 additions & 54 deletions .github/workflows/deploy-archive.yml

This file was deleted.

7 changes: 1 addition & 6 deletions .github/workflows/deploy-periphery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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"
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/deploy-proxy-plugin.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/list-in-archive.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
3 changes: 0 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 0 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
evm_version = "paris"
fs_permissions = [{ access = "read", path = "out-optimized" }]
gas_reports = [
"SablierV2Archive",
"SablierV2MerkleStreamerFactory",
"SablierV2MerkleStreamerLL",
"SablierV2ProxyPlugin",
"SablierV2ProxyTarget",
]
libs = ["lib"]
Expand Down
2 changes: 1 addition & 1 deletion lib/v2-core
Submodule v2-core updated 48 files
+318 −330 .gas-snapshot
+2 −0 .solhint.json
+6 −2 CHANGELOG.md
+6 −6 README.md
+0 −1 foundry.toml
+3 −3 package.json
+91 −78 pnpm-lock.yaml
+0 −1 shell/prepare-artifacts.sh
+22 −30 src/SablierV2LockupDynamic.sol
+22 −30 src/SablierV2LockupLinear.sol
+4 −4 src/abstracts/NoDelegateCall.sol
+9 −10 src/abstracts/SablierV2Lockup.sol
+6 −3 src/interfaces/ISablierV2Lockup.sol
+0 −27 src/interfaces/hooks/ISablierV2LockupSender.sol
+0 −4 test/Base.t.sol
+16 −16 test/fork/Fork.t.sol
+18 −17 test/fork/LockupDynamic.t.sol
+18 −17 test/fork/LockupLinear.t.sol
+4 −4 test/fork/assets/DAI.t.sol
+4 −4 test/fork/assets/EURS.t.sol
+4 −4 test/fork/assets/SHIB.t.sol
+4 −4 test/fork/assets/USDC.t.sol
+4 −4 test/fork/assets/USDT.t.sol
+0 −6 test/integration/Integration.t.sol
+2 −0 test/integration/concrete/lockup/burn/burn.t.sol
+6 −51 test/integration/concrete/lockup/cancel-multiple/cancelMultiple.t.sol
+6 −16 test/integration/concrete/lockup/cancel-multiple/cancelMultiple.tree
+8 −213 test/integration/concrete/lockup/cancel/cancel.t.sol
+28 −61 test/integration/concrete/lockup/cancel/cancel.tree
+6 −1 test/integration/concrete/lockup/withdraw-max-and-transfer/withdrawMaxAndTransfer.t.sol
+8 −2 test/integration/concrete/lockup/withdraw-max/withdrawMax.t.sol
+19 −4 test/integration/concrete/lockup/withdraw-multiple/withdrawMultiple.t.sol
+12 −2 test/integration/concrete/lockup/withdraw/withdraw.t.sol
+1 −1 test/integration/concrete/nft-descriptor/generateAccentColor.t.sol
+1 −1 test/integration/fuzz/lockup-dynamic/withdraw.t.sol
+2 −68 test/integration/fuzz/lockup/cancel.t.sol
+2 −0 test/integration/fuzz/lockup/cancelMultiple.t.sol
+4 −2 test/integration/fuzz/lockup/withdraw.t.sol
+7 −1 test/integration/fuzz/lockup/withdrawMax.t.sol
+6 −1 test/integration/fuzz/lockup/withdrawMaxAndTransfer.t.sol
+2 −2 test/integration/fuzz/lockup/withdrawMultiple.t.sol
+1 −27 test/integration/shared/lockup/cancel.t.sol
+1 −1 test/integration/shared/lockup/cancelMultiple.t.sol
+0 −21 test/mocks/hooks/GoodSender.sol
+0 −22 test/mocks/hooks/ReentrantSender.sol
+0 −22 test/mocks/hooks/RevertingSender.sol
+3 −2 test/utils/Events.sol
+4 −4 test/utils/Precompiles.sol
12 changes: 0 additions & 12 deletions script/DeployArchive.s.sol

This file was deleted.

24 changes: 0 additions & 24 deletions script/DeployDeterministicArchive.s.sol

This file was deleted.

20 changes: 5 additions & 15 deletions script/DeployDeterministicPeriphery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,20 +32,16 @@ contract DeployDeterministicPeriphery is BaseScript {
/// https://github.com/Arachnid/deterministic-deployment-proxy
function run(
string memory create2Salt,
address initialAdmin,
IAllowanceTransfer permit2
)
public
virtual
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 =
Expand Down
25 changes: 0 additions & 25 deletions script/DeployDeterministicProxyPlugin.s.sol

This file was deleted.

23 changes: 6 additions & 17 deletions script/DeployPeriphery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading