Skip to main content

ISablierV2ProxyTarget

Git Source

Proxy target with stateless scripts for interacting with Sablier V2 Core, designed to be used by stream senders.

Intended for use with an instance of PRBProxy through delegate calls. Any standard calls will be reverted.

Functions

batchCancelMultiple

Cancels multiple streams across different lockup contracts.

Notes:

  • All refunded assets are forwarded to the proxy owner.
  • It is assumed that assets includes all assets associated with the stream ids in batch. If any asset is missing, the refunded amount will be left in the proxy. Requirements:
  • Must be delegate called.
  • There must be at least one element in batch.
function batchCancelMultiple(Batch.CancelMultiple[] calldata batch, IERC20[] calldata assets) external;

Parameters

NameTypeDescription
batchBatch.CancelMultiple[]An array of structs, each encapsulating the lockup contract's address and the stream id to cancel.
assetsIERC20[]The contract addresses of the ERC-20 assets used for streaming.

burn

Mirror for {ISablierV2Lockup.burn}.

Must be delegate called.

function burn(ISablierV2Lockup lockup, uint256 streamId) external;

cancel

Mirror for {ISablierV2Lockup.cancel}.

Must be delegate called.

function cancel(ISablierV2Lockup lockup, uint256 streamId) external;

cancelMultiple

Mirror for {ISablierV2Lockup.cancelMultiple}.

Notes:

  • All refunded assets are forwarded to the proxy owner.
  • It is assumed that assets includes all assets associated with streamIds. If any asset is missing, the refunded amount will be left in the proxy. Requirements:
  • Must be delegate called.
function cancelMultiple(ISablierV2Lockup lockup, IERC20[] calldata assets, uint256[] calldata streamIds) external;

Parameters

NameTypeDescription
lockupISablierV2LockupThe address of the lockup streaming contract.
assetsIERC20[]The contract addresses of the ERC-20 assets used for streaming.
streamIdsuint256[]The stream ids to cancel.

renounce

Mirror for {ISablierV2Lockup.renounce}.

Must be delegate called.

function renounce(ISablierV2Lockup lockup, uint256 streamId) external;

withdraw

Mirror for {ISablierV2Lockup.withdraw}.

Must be delegate called.

function withdraw(ISablierV2Lockup lockup, uint256 streamId, address to, uint128 amount) external;

withdrawMax

Mirror for {ISablierV2Lockup.withdrawMax}.

Must be delegate called.

function withdrawMax(ISablierV2Lockup lockup, uint256 streamId, address to) external;

batchCreateWithDurations

Creates a batch of Lockup Linear streams using createWithDurations. Assets are transferred to the proxy via Permit2.

Requirements:

  • Must be delegate called.
  • There must be at least one element in batch.
  • All requirements from {ISablierV2LockupLinear.createWithDurations} must be met for each stream.
function batchCreateWithDurations(
ISablierV2LockupLinear lockupLinear,
IERC20 asset,
Batch.CreateWithDurations[] calldata batch,
Permit2Params calldata permit2Params
)
external
returns (uint256[] memory streamIds);

Parameters

NameTypeDescription
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
assetIERC20The contract address of the ERC-20 asset used for streaming.
batchBatch.CreateWithDurations[]An array of structs, each encapsulating a subset of the parameters of {SablierV2LockupLinear.createWithDurations}.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIdsuint256[]The ids of the newly created streams.

batchCreateWithRange

Creates a batch of Lockup Linear streams using createWithRange. Assets are transferred to the proxy via Permit2.

Requirements:

  • Must be delegate called.
  • There must be at least one element in batch.
  • All requirements from {ISablierV2LockupLinear.createWithRange} must be met for each stream.
function batchCreateWithRange(
ISablierV2LockupLinear lockupLinear,
IERC20 asset,
Batch.CreateWithRange[] calldata batch,
Permit2Params calldata permit2Params
)
external
returns (uint256[] memory streamIds);

Parameters

NameTypeDescription
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
assetIERC20The contract address of the ERC-20 asset used for streaming.
batchBatch.CreateWithRange[]An array of structs, each encapsulating a subset of the parameters of {SablierV2LockupLinear.createWithRange}.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIdsuint256[]The ids of the newly created streams.

cancelAndCreateWithDurations

Cancels a Lockup stream and creates a new Lockup Linear stream using createWithDurations. Assets are transferred to the proxy via Permit2.

Notes:

  • streamId can reference either a Lockup Linear or a Lockup Dynamic stream.
  • See {ISablierV2Lockup.cancel} and {ISablierV2LockupLinear.createWithDurations} for full documentation. Requirements:
  • Must be delegate called.
function cancelAndCreateWithDurations(
ISablierV2Lockup lockup,
uint256 streamId,
ISablierV2LockupLinear lockupLinear,
LockupLinear.CreateWithDurations calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 newStreamId);

Parameters

NameTypeDescription
lockupISablierV2LockupThe address of the lockup streaming contract where the stream to cancel is.
streamIduint256The id of the stream to cancel.
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract to use for creating the new stream.
createParamsLockupLinear.CreateWithDurations
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
newStreamIduint256The id of the newly created stream.

cancelAndCreateWithRange

Cancels a Lockup stream and creates a new Lockup Linear stream using createWithRange. Assets are transferred to the proxy via Permit2.

Notes:

  • streamId can reference either a Lockup Linear or a Lockup Dynamic stream.
  • See {ISablierV2Lockup.cancel} and {ISablierV2LockupLinear.createWithRange} for full documentation. Requirements:
  • Must be delegate called.
function cancelAndCreateWithRange(
ISablierV2Lockup lockup,
uint256 streamId,
ISablierV2LockupLinear lockupLinear,
LockupLinear.CreateWithRange calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 newStreamId);

Parameters

NameTypeDescription
lockupISablierV2LockupThe address of the lockup streaming contract where the stream to cancel is.
streamIduint256The id of the stream to cancel.
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract to use for creating the new stream.
createParamsLockupLinear.CreateWithRange
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
newStreamIduint256The id of the newly created stream.

createWithDurations

Mirror for {SablierV2LockupLinear.createWithDurations}. Assets are transferred to the proxy via Permit2.

Must be delegate called.

function createWithDurations(
ISablierV2LockupLinear lockupLinear,
LockupLinear.CreateWithDurations calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
createParamsLockupLinear.CreateWithDurationsStruct encapsulating the function parameters, which are documented in V2 Core.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.

createWithRange

Mirror for {SablierV2LockupLinear.createWithRange}. Assets are transferred to the proxy via Permit2.

Must be delegate called.

function createWithRange(
ISablierV2LockupLinear lockupLinear,
LockupLinear.CreateWithRange calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
createParamsLockupLinear.CreateWithRangeStruct encapsulating the function parameters, which are documented in V2 Core.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.

wrapAndCreateWithDurations

Wraps the native asset payment in ERC-20 form and creates a Lockup Linear stream using createWithDurations.

Notes:

  • createParams.totalAmount is overwritten with msg.value.
  • See {ISablierV2LockupLinear.createWithDurations} for full documentation. Requirements:
  • Must be delegate called.
  • The ERC-20 amount credited by the wrapper contract must be equal to msg.value.
function wrapAndCreateWithDurations(
ISablierV2LockupLinear lockupLinear,
LockupLinear.CreateWithDurations memory createParams
)
external
payable
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
createParamsLockupLinear.CreateWithDurationsStruct encapsulating the function parameters, which are documented in V2 Core.

wrapAndCreateWithRange

Wraps the native asset payment in ERC-20 form and creates a Lockup Linear stream using createWithRange.

Notes:

  • createParams.totalAmount is overwritten with msg.value.
  • See {ISablierV2LockupLinear.createWithRange} for full documentation. Requirements:
  • Must be delegate called.
  • The ERC-20 amount credited by the wrapper contract must be equal to msg.value.
function wrapAndCreateWithRange(
ISablierV2LockupLinear lockupLinear,
LockupLinear.CreateWithRange memory createParams
)
external
payable
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
createParamsLockupLinear.CreateWithRangeStruct encapsulating the function parameters, which are documented in V2 Core.

batchCreateWithDeltas

Creates a batch of Lockup Dynamic streams using createWithDeltas. Assets are transferred to the proxy via Permit2.

Requirements:

  • Must be delegate called.
  • There must be at least one element in batch.
  • All requirements from {ISablierV2LockupDynamic.createWithDeltas} must be met for each stream.
function batchCreateWithDeltas(
ISablierV2LockupDynamic lockupDynamic,
IERC20 asset,
Batch.CreateWithDeltas[] calldata batch,
Permit2Params calldata permit2Params
)
external
returns (uint256[] memory streamIds);

Parameters

NameTypeDescription
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract.
assetIERC20The contract address of the ERC-20 asset used for streaming.
batchBatch.CreateWithDeltas[]An array of structs, each encapsulating a subset of the parameters of {SablierV2LockupDynamic.createWithDeltas}.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIdsuint256[]The ids of the newly created streams.

batchCreateWithMilestones

Creates a batch of Lockup Dynamic streams using createWithMilestones. Assets are transferred to the proxy via Permit2.

Requirements:

  • Must be delegate called.
  • There must be at least one element in batch.
  • All requirements from {ISablierV2LockupDynamic.createWithMilestones} must be met for each stream.
function batchCreateWithMilestones(
ISablierV2LockupDynamic lockupDynamic,
IERC20 asset,
Batch.CreateWithMilestones[] calldata batch,
Permit2Params calldata permit2Params
)
external
returns (uint256[] memory streamIds);

Parameters

NameTypeDescription
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract.
assetIERC20The contract address of the ERC-20 asset used for streaming.
batchBatch.CreateWithMilestones[]An array of structs, each encapsulating a subset of the parameters of {SablierV2LockupDynamic.createWithMilestones}.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIdsuint256[]The ids of the newly created streams.

cancelAndCreateWithDeltas

Cancels a Lockup stream and creates a new Lockup Dynamic stream using createWithDeltas. Assets are transferred to the proxy via Permit2.

Notes:

  • streamId can reference either a Lockup Linear or a Lockup Dynamic stream.
  • See {ISablierV2Lockup.cancel} and {ISablierV2LockupDynamic.createWithDeltas} for full documentation. Requirements:
  • Must be delegate called.
function cancelAndCreateWithDeltas(
ISablierV2Lockup lockup,
uint256 streamId,
ISablierV2LockupDynamic lockupDynamic,
LockupDynamic.CreateWithDeltas calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 newStreamId);

Parameters

NameTypeDescription
lockupISablierV2LockupThe address of the lockup streaming contract where the stream to cancel is.
streamIduint256The id of the stream to cancel.
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract to use for creating the new stream.
createParamsLockupDynamic.CreateWithDeltasA struct encapsulating the create function parameters, which are documented in V2 Core.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
newStreamIduint256The id of the newly created stream.

cancelAndCreateWithMilestones

Cancels a Lockup stream and creates a new Lockup Dynamic stream using createWithMilestones. Assets are transferred to the proxy via Permit2.

Notes:

  • streamId can reference either a Lockup Linear or a Lockup Dynamic stream.
  • See {ISablierV2Lockup.cancel} and {ISablierV2LockupDynamic.createWithMilestones} for full documentation. Requirements:
  • Must be delegate called.
function cancelAndCreateWithMilestones(
ISablierV2Lockup lockup,
uint256 streamId,
ISablierV2LockupDynamic lockupDynamic,
LockupDynamic.CreateWithMilestones calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 newStreamId);

Parameters

NameTypeDescription
lockupISablierV2LockupThe address of the lockup streaming contract where the stream to cancel is.
streamIduint256The id of the stream to cancel.
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract to use for creating the new stream.
createParamsLockupDynamic.CreateWithMilestonesA struct encapsulating the create function parameters, which are documented in V2 Core.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
newStreamIduint256The id of the newly created stream.

createWithDeltas

Mirror for {SablierV2LockupDynamic.createWithDeltas}. Assets are transferred to the proxy via Permit2.

Must be delegate called.

function createWithDeltas(
ISablierV2LockupDynamic lockupDynamic,
LockupDynamic.CreateWithDeltas calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract.
createParamsLockupDynamic.CreateWithDeltasA struct encapsulating the create function parameters, which are documented in V2 Core.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.

createWithMilestones

Mirror for {SablierV2LockupDynamic.createWithMilestones}. Assets are transferred to the proxy via Permit2.

Must be delegate called.

function createWithMilestones(
ISablierV2LockupDynamic lockupDynamic,
LockupDynamic.CreateWithMilestones calldata createParams,
Permit2Params calldata permit2Params
)
external
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract.
createParamsLockupDynamic.CreateWithMilestonesStruct encapsulating the function parameters, which are documented in V2 Core.
permit2ParamsPermit2ParamsA struct encapsulating the parameters needed for Permit2, most importantly the signature.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.

wrapAndCreateWithDeltas

Wraps the native asset payment in ERC-20 form and creates a Lockup Dynamic stream using createWithDeltas.

Notes:

  • createParams.totalAmount is overwritten with msg.value.
  • See {ISablierV2LockupDynamic.createWithDeltas} for full documentation. Requirements:
  • Must be delegate called.
  • The ERC-20 amount credited by the wrapper contract must be equal to msg.value.
function wrapAndCreateWithDeltas(
ISablierV2LockupDynamic lockupDynamic,
LockupDynamic.CreateWithDeltas memory createParams
)
external
payable
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract.
createParamsLockupDynamic.CreateWithDeltasStruct encapsulating the function parameters, which are documented in V2 Core.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.

wrapAndCreateWithMilestones

Wraps the native asset payment in ERC-20 form and creates a Lockup Dynamic stream using createWithMilestones.

Notes:

  • createParams.totalAmount is overwritten with msg.value.
  • See {ISablierV2LockupDynamic.createWithMilestones} for full documentation. Requirements:
  • Must be delegate called.
  • The ERC-20 amount credited by the wrapper contract must be equal to msg.value.
function wrapAndCreateWithMilestones(
ISablierV2LockupDynamic lockupDynamic,
LockupDynamic.CreateWithMilestones memory createParams
)
external
payable
returns (uint256 streamId);

Parameters

NameTypeDescription
lockupDynamicISablierV2LockupDynamicThe address of the SablierV2LockupDynamic contract.
createParamsLockupDynamic.CreateWithMilestonesStruct encapsulating the function parameters, which are documented in V2 Core.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.