Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuh25 committed Jan 24, 2024
1 parent 3002a6e commit d328ed9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
21 changes: 0 additions & 21 deletions contracts/guard/src/GuardV0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,13 @@

pragma solidity ^0.8.0;

import "forge-std/console.sol";
import "@openzeppelin/access/Ownable.sol";
import "./lib/Path.sol";

interface IGuard {
function validateCall(address sender, address target, bytes memory callDataWithSelector) external;
}

// interface IUniswapV2Router02 {
// function swapTokensForExactTokens(
// uint amountOut,
// uint amountInMax,
// address[] calldata path,
// address to,
// uint deadline
// ) external returns (uint[] memory amounts);

// function swapExactTokensForTokens(
// uint amountIn,
// uint amountOutMin,
// address[] calldata path,
// address to,
// uint deadline
// ) external returns (uint[] memory amounts);
// }

/**
* Prototype guard implementation.
*
Expand Down Expand Up @@ -275,8 +256,6 @@ contract GuardV0 is IGuard, Ownable {
// validate Uniswap v3 trade
function validate_exactInput(bytes memory callData) public view {
(ExactInputParams memory params) = abi.decode(callData, (ExactInputParams));

// TODO: validate all tokens in path
(address tokenOut, address tokenIn, ) = params.path.decodeFirstPool();

require(isAllowedReceiver(params.recipient), "Receiver address does not match");
Expand Down
2 changes: 1 addition & 1 deletion eth_defi/abi/guard/GuardV0.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion eth_defi/abi/guard/SimpleVaultV0.json

Large diffs are not rendered by default.

0 comments on commit d328ed9

Please sign in to comment.