From 051c525170fdde9b32e106bbb54f2b4d4d8b068a Mon Sep 17 00:00:00 2001 From: pradeep-selva Date: Fri, 17 Sep 2021 19:27:19 +0530 Subject: [PATCH] docs: IPeriphery.sol created --- contracts/Periphery.sol | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/contracts/Periphery.sol b/contracts/Periphery.sol index 4cce641..8650b65 100644 --- a/contracts/Periphery.sol +++ b/contracts/Periphery.sol @@ -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; @@ -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 @@ -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);