Skip to content

Commit

Permalink
Add C4 audit, start to add weth router
Browse files Browse the repository at this point in the history
  • Loading branch information
af-afk committed Jan 14, 2025
1 parent 250a164 commit 1683fd5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Binary file added audits/code4rena.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions pkg/sol/IWETH10.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-Identifier: MIT

pragma solidity 0.8.16;

interface IWETH10 {
/// @dev `msg.value` of ETH sent to this contract grants caller account a matching increase in WETH10 token balance.
/// Emits {Transfer} event to reflect WETH10 token mint of `msg.value` from `address(0)` to caller account.
function deposit() external payable;

/// @dev Burn `value` WETH10 token from caller account and withdraw matching ETH to account (`to`).
/// Emits {Transfer} event to reflect WETH10 token burn of `value` to `address(0)` from caller account.
/// Requirements:
/// - caller account must have at least `value` balance of WETH10 token.
function withdrawTo(address payable to, uint256 value) external;
}
41 changes: 41 additions & 0 deletions pkg/sol/WETHRouter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-Identifier: MIT

pragma solidity 0.8.16;

import "./ISeawaterAMM.sol";
import "./IWETH10.sol";

contract WETHRouter {
IWETH10 immutable WETH;
ISeawaterAMM immutable SEAWATER;

constructor(IWETH10 _weth, ISeawaterAMM _amm) {
WETH = _weth;
SEAWATER = _amm;
}

function swapIn32502CA71(
address _token,
uint256 _amount,
uint256 _minOut
) external returns (int256, int256) {

}

function swapOut5E08A399(
address _token,
uint256 _amount,
uint256 _minOut
) external returns (int256, int256) {

}

function swap2ExactInED91BB1D(
address _tokenA,
address _tokenB,
uint256 _amount,
uint256 _minOut
) external returns (uint256, uint256) {

}
}

0 comments on commit 1683fd5

Please sign in to comment.