Skip to content

Commit

Permalink
forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hayesgm committed Nov 15, 2024
1 parent 861e453 commit a2d4781
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/builder/PaycallWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ library PaycallWrapper {
scriptAddress: CodeJarHelper.getCodeAddress(paycallSource),
scriptCalldata: abi.encodeWithSelector(
Paycall.run.selector, operation.scriptAddress, operation.scriptCalldata, maxPaymentCost
),
),
scriptSources: scriptSources,
expiry: operation.expiry
});
Expand Down
17 changes: 8 additions & 9 deletions src/builder/PriceFeeds.sol
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ library PriceFeeds {
reverse[1] = false;
return (path, reverse);
} else if (
Strings
// e.g. IN/ABC and ABC/OUT -> We want IN/ABC and ABC/OUT, which equates to reverse=[false, false]
.stringEqIgnoreCase(inputAssetPriceFeeds[i].quoteSymbol, outputAssetPriceFeeds[j].baseSymbol)
// e.g. IN/ABC and ABC/OUT -> We want IN/ABC and ABC/OUT, which equates to reverse=[false, false]
Strings.stringEqIgnoreCase(inputAssetPriceFeeds[i].quoteSymbol, outputAssetPriceFeeds[j].baseSymbol)
) {
address[] memory path = new address[](2);
bool[] memory reverse = new bool[](2);
Expand All @@ -260,9 +259,8 @@ library PriceFeeds {
reverse[1] = false;
return (path, reverse);
} else if (
Strings
// e.g. ABC/IN and OUT/ABC -> We want IN/ABC and ABC/OUT, which equates to reverse=[true, true]
.stringEqIgnoreCase(inputAssetPriceFeeds[i].baseSymbol, outputAssetPriceFeeds[j].quoteSymbol)
// e.g. ABC/IN and OUT/ABC -> We want IN/ABC and ABC/OUT, which equates to reverse=[true, true]
Strings.stringEqIgnoreCase(inputAssetPriceFeeds[i].baseSymbol, outputAssetPriceFeeds[j].quoteSymbol)
) {
address[] memory path = new address[](2);
bool[] memory reverse = new bool[](2);
Expand All @@ -272,9 +270,10 @@ library PriceFeeds {
reverse[1] = true;
return (path, reverse);
} else if (
Strings
// e.g. IN/ABC and OUT/ABC -> We want IN/ABC and ABC/OUT, which equates to reverse=[false, true]
.stringEqIgnoreCase(inputAssetPriceFeeds[i].quoteSymbol, outputAssetPriceFeeds[j].quoteSymbol)
// e.g. IN/ABC and OUT/ABC -> We want IN/ABC and ABC/OUT, which equates to reverse=[false, true]
Strings.stringEqIgnoreCase(
inputAssetPriceFeeds[i].quoteSymbol, outputAssetPriceFeeds[j].quoteSymbol
)
) {
address[] memory path = new address[](2);
bool[] memory reverse = new bool[](2);
Expand Down
2 changes: 1 addition & 1 deletion src/builder/QuotecallWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ library QuotecallWrapper {
scriptAddress: CodeJarHelper.getCodeAddress(quotecallSource),
scriptCalldata: abi.encodeWithSelector(
Quotecall.run.selector, operation.scriptAddress, operation.scriptCalldata, quotedAmount
),
),
scriptSources: scriptSources,
expiry: operation.expiry
});
Expand Down
8 changes: 4 additions & 4 deletions src/builder/actions/Actions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ library Actions {
scriptAddress: CodeJarHelper.getCodeAddress(scriptSources[0]),
scriptCalldata: CCTP.encodeBridgeUSDC(
bridge.srcChainId, bridge.destinationChainId, bridge.amount, bridge.recipient, srcUSDCPositions.asset
),
),
scriptSources: scriptSources,
expiry: bridge.blockTimestamp + BRIDGE_EXPIRY_BUFFER
});
Expand Down Expand Up @@ -1187,7 +1187,7 @@ library Actions {
morpho: MorphoInfo.getMorphoAddress(borrowInput.chainId),
morphoMarketId: MorphoInfo.marketId(
MorphoInfo.getMarketParams(borrowInput.chainId, borrowInput.collateralAssetSymbol, borrowInput.assetSymbol)
)
)
});
Action memory action = Actions.Action({
chainId: borrowInput.chainId,
Expand Down Expand Up @@ -1257,7 +1257,7 @@ library Actions {
morpho: MorphoInfo.getMorphoAddress(repayInput.chainId),
morphoMarketId: MorphoInfo.marketId(
MorphoInfo.getMarketParams(repayInput.chainId, repayInput.collateralAssetSymbol, repayInput.assetSymbol)
)
)
});

Action memory action = Actions.Action({
Expand Down Expand Up @@ -1492,7 +1492,7 @@ library Actions {
scriptAddress: CodeJarHelper.getCodeAddress(type(WrapperActions).creationCode),
scriptCalldata: TokenWrapper.encodeActionToWrapOrUnwrap(
wrapOrUnwrap.chainId, wrapOrUnwrap.assetSymbol, wrapOrUnwrap.amount
),
),
scriptSources: scriptSources,
expiry: wrapOrUnwrap.blockTimestamp + STANDARD_EXPIRY_BUFFER
});
Expand Down
2 changes: 1 addition & 1 deletion src/builder/actions/SwapActionsBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract SwapActionsBuilder is QuarkBuilderBase {
sellToken: swapIntent.sellToken,
sellAssetSymbol: Accounts.findAssetPositions(
swapIntent.sellToken, swapIntent.chainId, chainAccountsList
).symbol,
).symbol,
sellAmount: swapIntent.sellAmount,
buyToken: swapIntent.buyToken,
buyAssetSymbol: Accounts.findAssetPositions(swapIntent.buyToken, swapIntent.chainId, chainAccountsList)
Expand Down
22 changes: 7 additions & 15 deletions src/builder/console.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,21 @@
pragma solidity >=0.4.22 <0.9.0;

library console {
address constant CONSOLE_ADDRESS =
0x000000000000000000636F6e736F6c652e6c6f67;
address constant CONSOLE_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67;

function _sendLogPayloadImplementation(bytes memory payload) internal view {
address consoleAddress = CONSOLE_ADDRESS;
/// @solidity memory-safe-assembly
assembly {
pop(
staticcall(
gas(),
consoleAddress,
add(payload, 32),
mload(payload),
0,
0
)
)
pop(staticcall(gas(), consoleAddress, add(payload, 32), mload(payload), 0, 0))
}
}

function _castToPure(
function(bytes memory) internal view fnIn
) internal pure returns (function(bytes memory) pure fnOut) {
function _castToPure(function(bytes memory) internal view fnIn)
internal
pure
returns (function(bytes memory) pure fnOut)
{
assembly {
fnOut := fnIn
}
Expand Down
2 changes: 1 addition & 1 deletion test/Multicall.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ contract MulticallTest is Test {
path: abi.encodePacked(USDC, uint24(500), WETH) // Path: USDC - 0.05% -> WETH
})
)
),
),
new bytes[](0)
)
),
Expand Down
4 changes: 2 additions & 2 deletions test/UniswapFlashLoan.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ contract UniswapFlashLoanTest is Test {
callContract: ethcallAddress,
callData: abi.encodeWithSelector(
Ethcall.run.selector, USDC, abi.encodeCall(IERC20.transfer, (address(1), 1000e6)), 0
)
)
});

QuarkWallet.QuarkOperation memory op = new QuarkOperationHelper().newBasicOpWithCalldata(
Expand Down Expand Up @@ -312,7 +312,7 @@ contract UniswapFlashLoanTest is Test {
callContract: ethcallAddress,
callData: abi.encodeWithSelector(
Ethcall.run.selector, USDC, abi.encodeCall(IERC20.approve, (comet, 1000e6)), 0
)
)
})
),
ScriptType.ScriptAddress
Expand Down
8 changes: 4 additions & 4 deletions test/builder/lib/QuarkBuilderTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,17 @@ contract QuarkBuilderTest {
chainPortfolios[i].account,
chainPortfolios[i].assetSymbols,
chainPortfolios[i].assetBalances
),
),
// cometPositions: cometPositionsFor
cometPositions: cometPositionsForCometPorfolios(
chainPortfolios[i].chainId, chainPortfolios[i].account, chainPortfolios[i].cometPortfolios
),
),
morphoPositions: morphoPositionsForMorphoPortfolios(
chainPortfolios[i].chainId, chainPortfolios[i].account, chainPortfolios[i].morphoPortfolios
),
),
morphoVaultPositions: morphoVaultPositionsForMorphoVaultPortfolios(
chainPortfolios[i].chainId, chainPortfolios[i].account, chainPortfolios[i].morphoVaultPortfolios
)
)
});
}

Expand Down

0 comments on commit a2d4781

Please sign in to comment.