Skip to content

Commit

Permalink
test: forwardTo behaviour in SIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Dec 8, 2024
1 parent 812a106 commit 0821a51
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface ISynapseIntentPreviewer {
/// @dev Will not revert if the intent cannot be completed, returns empty values instead.
/// @dev Returns (amountIn, []) if the intent is a no-op (tokenIn == tokenOut).
/// @param swapQuoter Peripheral contract to use for swap quoting
/// @param forwardTo The address to which the proceeds of the intent should be forwarded to.
/// Note: if no forwarding is required (or done within the intent), use address(0).
/// @param tokenIn Initial token for the intent
/// @param tokenOut Final token for the intent
/// @param amountIn Initial amount of tokens to use for the intent
Expand All @@ -16,6 +18,7 @@ interface ISynapseIntentPreviewer {
/// Empty if the intent cannot be completed, or if intent is a no-op (tokenIn == tokenOut).
function previewIntent(
address swapQuoter,
address forwardTo,
address tokenIn,
address tokenOut,
uint256 amountIn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ contract SynapseIntentPreviewer is ISynapseIntentPreviewer {
/// @dev Amount value that signals that the Zap step should be performed using the full ZapRecipient balance.
uint256 internal constant FULL_BALANCE = type(uint256).max;

error SIP__NoOpForwardNotSupported();
error SIP__PoolTokenMismatch();
error SIP__PoolZeroAddress();
error SIP__RawParamsEmpty();
Expand All @@ -29,6 +30,7 @@ contract SynapseIntentPreviewer is ISynapseIntentPreviewer {
/// @inheritdoc ISynapseIntentPreviewer
function previewIntent(
address swapQuoter,
address forwardTo,
address tokenIn,
address tokenOut,
uint256 amountIn
Expand Down
Loading

0 comments on commit 0821a51

Please sign in to comment.