Skip to content

Commit

Permalink
Merge pull request #21 from jbx-protocol/feat/deployments
Browse files Browse the repository at this point in the history
feat:deployment
  • Loading branch information
simon-something authored Oct 13, 2023
2 parents 73bf06c + cac351c commit 409b3ac
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 44 deletions.
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

0 comments on commit 409b3ac

Please sign in to comment.