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

feat:deployment #21

Merged
merged 2 commits into from
Oct 13, 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
32 changes: 16 additions & 16 deletions broadcast/Deploy.s.sol/1/run-latest.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions broadcast/Deploy.s.sol/5/run-latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/JBBuybackDelegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ contract JBBuybackDelegate is ERC165, JBOperatable, IJBBuybackDelegate {

// Unpack the quote from the pool, given by the frontend.
(_quoteExists, _metadata) = JBDelegateMetadataLib.getMetadata(DELEGATE_ID, _data.metadata);
if (_quoteExists) (_minimumSwapAmountOut, _amountToSwapWith) = abi.decode(_metadata, (uint256, uint256));
if (_quoteExists) (_amountToSwapWith, _minimumSwapAmountOut) = abi.decode(_metadata, (uint256, uint256));
}

// If no amount was specified to swap with, default to the full amount of the payment.
Expand Down
16 changes: 8 additions & 8 deletions contracts/test/JBBuybackDelegate_Fork.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {

// Build the metadata using the quote at that block
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(_amountOutQuoted, _amountIn);
_data[0] = abi.encode(_amountIn, _amountOutQuoted);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down Expand Up @@ -286,7 +286,7 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {

// Build the metadata using the quote at that block
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(_amountOutQuoted, _amountIn);
_data[0] = abi.encode(_amountIn, _amountOutQuoted);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down Expand Up @@ -334,7 +334,7 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {
// Build the metadata using the quote at that block
// Build the metadata using the quote at that block
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(amountOutQuoted, amountPaid);
_data[0] = abi.encode(amountPaid, amountOutQuoted);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down Expand Up @@ -371,7 +371,7 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {
assert(_previousQuote != amountOutQuoted);

// Update the metadata
_data[0] = abi.encode(amountOutQuoted, amountPaid);
_data[0] = abi.encode(amountPaid, amountOutQuoted);

// Generate the metadata
_delegateMetadata = metadataHelper.createMetadata(_ids, _data);
Expand Down Expand Up @@ -416,7 +416,7 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {

// Build the metadata using the quote
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(_quote, _amountIn);
_data[0] = abi.encode(_amountIn, _quote);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down Expand Up @@ -567,8 +567,8 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {
// Build the metadata using the quote at that block
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(
69412820131620254304865 + 10, // 10 more than quote at that block
0
0,
69412820131620254304865 + 10 // 10 more than quote at that block
);

// Pass the delegate id
Expand Down Expand Up @@ -612,7 +612,7 @@ contract TestJBBuybackDelegate_Fork is Test, UniswapV3ForgeQuoter {

// Build the metadata using the quote at that block
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(amountOutQuoted, _amountIn);
_data[0] = abi.encode(_amountIn, amountOutQuoted);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/JBBuybackDelegate_Invariant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ contract BBDHandler is Test {

// set only valid metadata
bytes[] memory _quoteData = new bytes[](1);
_quoteData[0] = abi.encode(_quote, _amountIn);
_quoteData[0] = abi.encode(_amountIn, _quote);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/JBBuybackDelegate_Unit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ contract TestJBBuybackDelegate_Units is Test {

// Pass the quote as metadata
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(_swapOutCount, _amountIn);
_data[0] = abi.encode(_amountIn, _swapOutCount);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down Expand Up @@ -335,7 +335,7 @@ contract TestJBBuybackDelegate_Units is Test {

// Pass the quote as metadata
bytes[] memory _data = new bytes[](1);
_data[0] = abi.encode(_swapOutCount, _amountIn);
_data[0] = abi.encode(_amountIn, _swapOutCount);

// Pass the delegate id
bytes4[] memory _ids = new bytes4[](1);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/jbx-protocol/juice-buyback"
},
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",
"devDependencies": {
"@exhausted-pigeon/uniswap-v3-forge-quoter": "^1.0.1",
Expand Down
Loading