Skip to content

feat: enhance Treasury and Relay contracts to support new quote token#4

Merged
devmicwal merged 2 commits intoblockydevs:mainfrom
pawell24-blocky-devs:feat/buyback-and-burn
Nov 28, 2025
Merged

feat: enhance Treasury and Relay contracts to support new quote token#4
devmicwal merged 2 commits intoblockydevs:mainfrom
pawell24-blocky-devs:feat/buyback-and-burn

Conversation

@pawell24-blocky-devs
Copy link
Collaborator

No description provided.

require(start == tokenToSell, "Treasury: Path start mismatch");
require(end == quote, "Treasury: Path must end in quote");

IERC20(tokenToSell).forceApprove(address(adapter), 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a need for approval reset? Won't the next line override the approval?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forceApprove(..., 0) is intentional, some ERC20s (USDT) revert if you change a non-zero allowance without resetting to zero first

recipient: address(this),
deadline: deadline,
amountIn: amountIn,
amountOut: 0,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amountOut: 0 - in exact-in requests is unused, exact-in flows enforce amountOutMinimum. We set it to zero to signal it’s ignored

@devmicwal devmicwal merged commit 93cca71 into blockydevs:main Nov 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants