Skip to content

Commit

Permalink
docs: IPeriphery.sol created
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradeep-selva committed Sep 17, 2021
1 parent 5dbe204 commit 051c525
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions contracts/Periphery.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';
import '@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol';
import '@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol';
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol";
import "@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

import './interfaces/IVault.sol';
import "./interfaces/IPeriphery.sol";
import "./interfaces/IVault.sol";
import "./interfaces/IERC20Metadata.sol";
import "./libraries/LongMath.sol";

contract Periphery {
/// @inheritdoc IPeriphery
contract Periphery is IPeriphery {
using SafeMath for uint256;
using LongMath for uint256;
using SafeERC20 for IERC20Metadata;
Expand All @@ -34,8 +36,7 @@ contract Periphery {
token1 = vault.token1();
}

/// @notice Calls IVault's deposit method and sends all money back to user after transactions
/// @param amountIn Value of token0 to be deposited
/// @inheritdoc IPeriphery
function vaultDeposit(uint256 amountIn) external minimumAmount(amountIn) {
// Calculate amount to swap based on tokens in vault
// token0 / token1 = k
Expand Down Expand Up @@ -86,6 +87,7 @@ contract Periphery {
token1.safeTransfer(msg.sender, _tokenBalance(token1));
}

/// @inheritdoc IPeripheryn
function vaultWithdraw(uint256 shares) external minimumAmount(shares) {
// transfer shares from msg.sender & withdraw
vault.safeTransferFrom(msg.sender, address(this), shares);
Expand Down

0 comments on commit 051c525

Please sign in to comment.