From dd22b68bf1c6327a0e7706de4be5716d237c9587 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Wed, 24 Mar 2021 17:53:36 +0530 Subject: [PATCH] Update comments --- contracts/connectors/1proto/main.sol | 36 ++++++----- contracts/connectors/COMP/main.sol | 12 ++-- contracts/connectors/aave/v1/main.sol | 37 ++++++----- contracts/connectors/aave/v2/main.sol | 41 ++++++------ contracts/connectors/authority/main.sol | 6 +- contracts/connectors/basic/main.sol | 22 ++++--- contracts/connectors/compound/main.sol | 65 ++++++++++--------- contracts/connectors/makerdao/main.sol | 85 ++++++++++++++----------- contracts/connectors/uniswap/main.sol | 56 ++++++++-------- 9 files changed, 201 insertions(+), 159 deletions(-) diff --git a/contracts/connectors/1proto/main.sol b/contracts/connectors/1proto/main.sol index f233a641..aea7292d 100644 --- a/contracts/connectors/1proto/main.sol +++ b/contracts/connectors/1proto/main.sol @@ -131,15 +131,16 @@ abstract contract OneProtoResolverHelpers is OneProtoResolver { abstract contract OneProto is OneProtoResolverHelpers { /** - * @dev Sell ETH/ERC20_Token using 1proto using off-chain calculation. - * @param buyAddr buying token address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAddr selling token address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAmt selling token amount. - * @param unitAmt unit amount of buyAmt/sellAmt with slippage. - * @param distribution distribution of swap across different dex. - * @param disableDexes disable a dex. (To disable none: 0) - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @dev Sell ETH/ERC20_Token using 1Proto using off-chain calculation. + * @notice Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain. + * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAmt The amount of the token to sell. + * @param unitAmt The amount of buyAmt/sellAmt with slippage. + * @param distribution The distribution of swap across different DEXs. + * @param disableDexes Disable a dex. (To disable none: 0) + * @param getId ID to retrieve sellAmt. + * @param setId ID stores the amount of token brought. */ function sell( address buyAddr, @@ -168,14 +169,15 @@ abstract contract OneProto is OneProtoResolverHelpers { } /** - * @dev Sell ETH/ERC20_Token using 1proto using muliple token. - * @param tokens array of tokens. - * @param sellAmt selling token amount. - * @param unitAmt unit amount of buyAmt/sellAmt with slippage. - * @param distribution distribution of swap across different dex. - * @param disableDexes disable a dex. (To disable none: 0) - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @dev Sell Multiple tokens using 1proto using off-chain calculation. + * @notice Swap multiple tokens from exchanges like Uniswap, Kyber, 0x etc, with calculation done off-chain. + * @param tokens Array of tokens. + * @param sellAmt The amount of the token to sell. + * @param unitAmt The amount of buyAmt/sellAmt with slippage. + * @param distribution The distribution of swap across different DEXs. + * @param disableDexes Disable a dex. (To disable none: 0) + * @param getId ID to retrieve sellAmt. + * @param setId ID stores the amount of token brought. */ function sellMulti( address[] calldata tokens, diff --git a/contracts/connectors/COMP/main.sol b/contracts/connectors/COMP/main.sol index b776d1db..e2c74806 100644 --- a/contracts/connectors/COMP/main.sol +++ b/contracts/connectors/COMP/main.sol @@ -9,7 +9,8 @@ abstract contract CompResolver is Events, Helpers { /** * @dev Claim Accrued COMP Token. - * @param setId Set ctoken amount at this ID in `InstaMemory` Contract. + * @notice Claim Accrued COMP Token. + * @param setId ID stores the amount of COMP claimed. */ function ClaimComp(uint256 setId) external payable returns (string memory _eventName, bytes memory _eventParam) { TokenInterface _compToken = TokenInterface(address(compToken)); @@ -26,8 +27,9 @@ abstract contract CompResolver is Events, Helpers { /** * @dev Claim Accrued COMP Token. + * @notice Claim Accrued COMP Token. * @param tokens Array of tokens supplied and borrowed. - * @param setId Set ctoken amount at this ID in `InstaMemory` Contract. + * @param setId ID stores the amount of COMP claimed. */ function ClaimCompTwo(address[] calldata tokens, uint256 setId) external payable returns (string memory _eventName, bytes memory _eventParam) { uint _len = tokens.length; @@ -50,9 +52,10 @@ abstract contract CompResolver is Events, Helpers { /** * @dev Claim Accrued COMP Token. + * @notice Claim Accrued COMP Token. * @param supplyTokens Array of tokens supplied. * @param borrowTokens Array of tokens borrowed. - * @param setId Set ctoken amount at this ID in `InstaMemory` Contract. + * @param setId ID stores the amount of COMP claimed. */ function ClaimCompThree(address[] calldata supplyTokens, address[] calldata borrowTokens, uint256 setId) external payable returns (string memory _eventName, bytes memory _eventParam) { (address[] memory ctokens, bool isBorrow, bool isSupply) = mergeTokenArr(supplyTokens, borrowTokens); @@ -74,7 +77,8 @@ abstract contract CompResolver is Events, Helpers { /** * @dev Delegate votes. - * @param delegatee The address to delegate votes to. + * @notice Delegate votes. + * @param delegatee The address to delegate the votes to. */ function delegate(address delegatee) external payable returns (string memory _eventName, bytes memory _eventParam) { require(compToken.delegates(address(this)) != delegatee, "Already delegated to same delegatee."); diff --git a/contracts/connectors/aave/v1/main.sol b/contracts/connectors/aave/v1/main.sol index f1e1bdd2..8ffd6978 100644 --- a/contracts/connectors/aave/v1/main.sol +++ b/contracts/connectors/aave/v1/main.sol @@ -9,10 +9,11 @@ import { AaveInterface, AaveCoreInterface, ATokenInterface } from "./interface.s abstract contract AaveResolver is Events, Helpers { /** * @dev Deposit ETH/ERC20_Token. - * @param token token address to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to deposit. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Deposit a token to Aave v1 for lending / collaterization. + * @param token The address of the token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to deposit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens deposited. */ function deposit( address token, @@ -45,10 +46,11 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Withdraw ETH/ERC20_Token. - * @param token token address to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to withdraw. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Withdraw deposited token from Aave v1 + * @param token The address of the token to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to withdraw. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens withdrawn. */ function withdraw( address token, @@ -74,10 +76,11 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Borrow ETH/ERC20_Token. - * @param token token address to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to borrow. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Borrow a token using Aave v1 + * @param token The address of the token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to borrow. + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens borrowed. */ function borrow( address token, @@ -96,10 +99,11 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Payback borrowed ETH/ERC20_Token. - * @param token token address to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to payback. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Payback debt owed. + * @param token The address of the token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to payback. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens paid back. */ function payback( address token, @@ -132,6 +136,7 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Enable collateral + * @notice Enable an array of tokens as collateral * @param tokens Array of tokens to enable collateral */ function enableCollateral( diff --git a/contracts/connectors/aave/v2/main.sol b/contracts/connectors/aave/v2/main.sol index f25b44b5..8e414384 100644 --- a/contracts/connectors/aave/v2/main.sol +++ b/contracts/connectors/aave/v2/main.sol @@ -9,10 +9,11 @@ import { AaveInterface } from "./interface.sol"; abstract contract AaveResolver is Events, Helpers { /** * @dev Deposit ETH/ERC20_Token. - * @param token token address to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to deposit. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Deposit a token to Aave v2 for lending / collaterization. + * @param token The address of the token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to deposit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens deposited. */ function deposit( address token, @@ -52,10 +53,11 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Withdraw ETH/ERC20_Token. - * @param token token address to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to withdraw. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Withdraw deposited token from Aave v2 + * @param token The address of the token to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to withdraw. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens withdrawn. */ function withdraw( address token, @@ -87,11 +89,12 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Borrow ETH/ERC20_Token. - * @param token token address to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to borrow. - * @param rateMode type of borrow debt.(For Stable: 1, Variable: 2) - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Borrow a token using Aave v2 + * @param token The address of the token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to borrow. + * @param rateMode The type of borrow debt. (For Stable: 1, Variable: 2) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens borrowed. */ function borrow( address token, @@ -118,11 +121,12 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Payback borrowed ETH/ERC20_Token. - * @param token token address to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amt token amount to payback. - * @param rateMode type of borrow debt.(For Stable: 1, Variable: 2) - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Payback debt owed. + * @param token The address of the token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of the token to payback. (For max: `uint256(-1)`) + * @param rateMode The type of debt paying back. (For Stable: 1, Variable: 2) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens paid back. */ function payback( address token, @@ -156,6 +160,7 @@ abstract contract AaveResolver is Events, Helpers { /** * @dev Enable collateral + * @notice Enable an array of tokens as collateral * @param tokens Array of tokens to enable collateral */ function enableCollateral( diff --git a/contracts/connectors/authority/main.sol b/contracts/connectors/authority/main.sol index 683cf454..1d098c8f 100644 --- a/contracts/connectors/authority/main.sol +++ b/contracts/connectors/authority/main.sol @@ -7,7 +7,8 @@ import { Events } from "./events.sol"; abstract contract AuthorityResolver is Events, Helpers { /** * @dev Add New authority - * @param authority authority Address. + * @notice Add an address as account authority + * @param authority The authority Address. */ function add( address authority @@ -20,7 +21,8 @@ abstract contract AuthorityResolver is Events, Helpers { /** * @dev Remove authority - * @param authority authority Address. + * @notice Remove an address as account authority + * @param authority The authority Address. */ function remove( address authority diff --git a/contracts/connectors/basic/main.sol b/contracts/connectors/basic/main.sol index 2f881c41..83b5f129 100644 --- a/contracts/connectors/basic/main.sol +++ b/contracts/connectors/basic/main.sol @@ -12,10 +12,11 @@ abstract contract BasicResolver is Events, DSMath, Basic { /** * @dev Deposit Assets To Smart Account. - * @param token Token Address. - * @param amt Token Amount. - * @param getId Get Storage ID. - * @param setId Set Storage ID. + * @notice Deposit a token to DSA + * @param token The address of the token to deposit. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of tokens to deposit. (For max: `uint256(-1)` (Not valid for ETH)) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens deposited. */ function deposit( address token, @@ -39,12 +40,13 @@ abstract contract BasicResolver is Events, DSMath, Basic { } /** - * @dev Withdraw Assets To Smart Account. - * @param token Token Address. - * @param amt Token Amount. - * @param to Withdraw token address. - * @param getId Get Storage ID. - * @param setId Set Storage ID. + * @dev Withdraw Assets from Smart Account + * @notice Withdraw a token from DSA + * @param token The address of the token to withdraw. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amt The amount of tokens to withdraw. (For max: `uint256(-1)`) + * @param to The address to receive the token upon withdrawal + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens withdrawn. */ function withdraw( address token, diff --git a/contracts/connectors/compound/main.sol b/contracts/connectors/compound/main.sol index 2838d47e..dd869de5 100644 --- a/contracts/connectors/compound/main.sol +++ b/contracts/connectors/compound/main.sol @@ -10,10 +10,11 @@ import { CETHInterface, CTokenInterface, LiquidateData } from "./interface.sol"; abstract contract CompoundResolver is Events, Helpers { /** * @dev Deposit ETH/ERC20_Token. - * @param tokenId token id of the token to deposit.(For eg: ETH-A) - * @param amt token amount to deposit. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Deposit a token to Compound for lending / collaterization. + * @param tokenId The token id of the token to deposit.(For eg: ETH-A) + * @param amt The amount of the token to deposit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens deposited. */ function deposit( string calldata tokenId, @@ -44,10 +45,11 @@ abstract contract CompoundResolver is Events, Helpers { /** * @dev Withdraw ETH/ERC20_Token. - * @param tokenId token id of the token to withdraw.(For eg: ETH-A) - * @param amt token amount to withdraw. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Withdraw deposited token from Compound + * @param tokenId The token id of the token to withdraw.(For eg: ETH-A) + * @param amt The amount of the token to withdraw. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens withdrawn. */ function withdraw( string calldata tokenId, @@ -78,10 +80,11 @@ abstract contract CompoundResolver is Events, Helpers { /** * @dev Borrow ETH/ERC20_Token. - * @param tokenId token id of the token to borrow.(For eg: DAI-A) - * @param amt token amount to borrow. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Borrow a token using Compound + * @param tokenId The token id of the token to borrow.(For eg: DAI-A) + * @param amt The amount of the token to borrow. + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens borrowed. */ function borrow( string calldata tokenId, @@ -103,10 +106,11 @@ abstract contract CompoundResolver is Events, Helpers { /** * @dev Payback borrowed ETH/ERC20_Token. - * @param tokenId token id of the token to payback.(For eg: COMP-A) - * @param amt token amount to payback. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Payback debt owed. + * @param tokenId The token id of the token to payback.(For eg: COMP-A) + * @param amt The amount of the token to payback. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens paid back. */ function payback( string calldata tokenId, @@ -138,10 +142,11 @@ abstract contract CompoundResolver is Events, Helpers { /** * @dev Deposit ETH/ERC20_Token. - * @param tokenId token id of the token to depositCToken.(For eg: DAI-A) - * @param amt token amount to depositCToken. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set ctoken amount at this ID in `InstaMemory` Contract. + * @notice Same as deposit. The only difference is this method stores cToken amount in set ID. + * @param tokenId The token id of the token to depositCToken.(For eg: DAI-A) + * @param amt The amount of the token to deposit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of cTokens received. */ function depositCToken( string calldata tokenId, @@ -182,10 +187,11 @@ abstract contract CompoundResolver is Events, Helpers { /** * @dev Withdraw CETH/CERC20_Token using cToken Amt. - * @param tokenId token id of the token to withdraw CToken.(For eg: ETH-A) - * @param cTokenAmt ctoken amount to withdrawCToken. - * @param getId Get ctoken amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Same as withdraw. The only difference is this method fetch cToken amount in get ID. + * @param tokenId The token id of the token to withdraw CToken.(For eg: ETH-A) + * @param cTokenAmt The amount of cTokens to withdraw + * @param getId ID to retrieve cTokenAmt + * @param setId ID stores the amount of tokens withdrawn. */ function withdrawCToken( string calldata tokenId, @@ -218,12 +224,13 @@ abstract contract CompoundResolver is Events, Helpers { /** * @dev Liquidate a position. + * @notice Liquidate a position. * @param borrower Borrower's Address. - * @param tokenIdToPay token id of the token to pay for liquidation.(For eg: ETH-A) - * @param tokenIdInReturn token id of the token to return for liquidation.(For eg: USDC-A) - * @param amt token amount to pay for liquidation. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @param tokenIdToPay The token id of the token to pay for liquidation.(For eg: ETH-A) + * @param tokenIdInReturn The token id of the token to return for liquidation.(For eg: USDC-A) + * @param amt The amount of tokens to pay for liquidation. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of paid for liquidation. */ function liquidate( address borrower, diff --git a/contracts/connectors/makerdao/main.sol b/contracts/connectors/makerdao/main.sol index 139438d3..d7465af4 100644 --- a/contracts/connectors/makerdao/main.sol +++ b/contracts/connectors/makerdao/main.sol @@ -8,6 +8,7 @@ import { VatLike, TokenJoinInterface } from "./interface.sol"; abstract contract MakerResolver is Helpers, Events { /** * @dev Open Vault + * @notice Open a Maker Vault * @param colType Type of Collateral.(eg: 'ETH-A') */ function open(string calldata colType) external payable returns (string memory _eventName, bytes memory _eventParam) { @@ -21,6 +22,7 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Close Vault + * @notice Close a Maker Vault * @param vault Vault ID to close. */ function close(uint256 vault) external payable returns (string memory _eventName, bytes memory _eventParam) { @@ -39,10 +41,11 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Deposit ETH/ERC20_Token Collateral. - * @param vault Vault ID. - * @param amt token amount to deposit. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Deposit collateral to a Maker vault + * @param vault Vault ID. (Use 0 for last opened vault) + * @param amt The amount of tokens to deposit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens deposited. */ function deposit( uint256 vault, @@ -85,10 +88,11 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Withdraw ETH/ERC20_Token Collateral. - * @param vault Vault ID. - * @param amt token amount to withdraw. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Withdraw collateral from a Maker vault + * @param vault Vault ID. (Use 0 for last opened vault) + * @param amt The amount of tokens to withdraw. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of tokens withdrawn. */ function withdraw( uint256 vault, @@ -140,10 +144,11 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Borrow DAI. - * @param vault Vault ID. - * @param amt token amount to borrow. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Borrow DAI using a Maker vault + * @param vault Vault ID. (Use 0 for last opened vault) + * @param amt The amount of DAI to borrow. + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of DAI borrowed. */ function borrow( uint256 vault, @@ -188,10 +193,11 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Payback borrowed DAI. - * @param vault Vault ID. - * @param amt token amount to payback. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Payback DAI debt owed by a Maker vault + * @param vault Vault ID. (Use 0 for last opened vault) + * @param amt The amount of DAI to payback. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of DAI paid back. */ function payback( uint256 vault, @@ -233,10 +239,11 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Withdraw leftover ETH/ERC20_Token after Liquidation. - * @param vault Vault ID. - * @param amt token amount to Withdraw. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Withdraw leftover collateral after Liquidation. + * @param vault Vault ID. (Use 0 for last opened vault) + * @param amt token amount to Withdraw. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of collateral withdrawn. */ function withdrawLiquidated( uint256 vault, @@ -285,13 +292,14 @@ abstract contract MakerResolver is Helpers, Events { } /** * @dev Deposit ETH/ERC20_Token Collateral and Borrow DAI. - * @param vault Vault ID. - * @param depositAmt token deposit amount to Withdraw. - * @param borrowAmt token borrow amount to Withdraw. - * @param getIdDeposit Get deposit token amount at this ID from `InstaMemory` Contract. - * @param getIdBorrow Get borrow token amount at this ID from `InstaMemory` Contract. - * @param setIdDeposit Set deposit token amount at this ID in `InstaMemory` Contract. - * @param setIdBorrow Set borrow token amount at this ID in `InstaMemory` Contract. + * @notice Deposit collateral and borrow DAI. + * @param vault Vault ID. (Use 0 for last opened vault) + * @param depositAmt The amount of tokens to deposit. (For max: `uint256(-1)`) + * @param borrowAmt The amount of DAI to borrow. + * @param getIdDeposit ID to retrieve depositAmt. + * @param getIdBorrow ID to retrieve borrowAmt. + * @param setIdDeposit ID stores the amount of tokens deposited. + * @param setIdBorrow ID stores the amount of DAI borrowed. */ function depositAndBorrow( uint256 vault, @@ -365,10 +373,11 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Exit DAI from urn. - * @param vault Vault ID. - * @param amt token amount to exit. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Exit DAI from urn. + * @param vault Vault ID. (Use 0 for last opened vault) + * @param amt The amount of DAI to exit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of DAI exited. */ function exitDai( uint256 vault, @@ -406,9 +415,10 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Deposit DAI in DSR. - * @param amt DAI amount to deposit. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Deposit DAI in DSR. + * @param amt The amount of DAI to deposit. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of DAI deposited. */ function depositDai( uint256 amt, @@ -439,9 +449,10 @@ abstract contract MakerResolver is Helpers, Events { /** * @dev Withdraw DAI from DSR. - * @param amt DAI amount to withdraw. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Withdraw DAI from DSR. + * @param amt The amount of DAI to withdraw. (For max: `uint256(-1)`) + * @param getId ID to retrieve amt. + * @param setId ID stores the amount of DAI withdrawn. */ function withdrawDai( uint256 amt, diff --git a/contracts/connectors/uniswap/main.sol b/contracts/connectors/uniswap/main.sol index 9634f1a1..55e1155a 100644 --- a/contracts/connectors/uniswap/main.sol +++ b/contracts/connectors/uniswap/main.sol @@ -7,13 +7,14 @@ import { Events } from "./events.sol"; abstract contract UniswapResolver is Helpers, Events { /** * @dev Deposit Liquidity. - * @param tokenA tokenA address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param tokenB tokenB address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param amtA tokenA amount. - * @param unitAmt unit amount of amtB/amtA with slippage. - * @param slippage slippage amount. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Deposit Liquidity to a Uniswap pool. + * @param tokenA The address of token A.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param tokenB The address of token B.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param amtA The amount of A tokens to deposit. + * @param unitAmt The unit amount of of amtB/amtA with slippage. + * @param slippage Slippage amount. + * @param getId ID to retrieve amtA. + * @param setId ID stores the amount of pools tokens received. */ function deposit( address tokenA, @@ -41,13 +42,14 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Withdraw Liquidity. - * @param tokenA tokenA address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param tokenB tokenB address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param uniAmt uni token amount. - * @param unitAmtA unit amount of amtA/uniAmt with slippage. - * @param unitAmtB unit amount of amtB/uniAmt with slippage. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setIds Set token amounts at this IDs in `InstaMemory` Contract. + * @notice Withdraw Liquidity from a Uniswap pool. + * @param tokenA The address of token A.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param tokenB The address of token B.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param uniAmt The amount of pool tokens to withdraw. + * @param unitAmtA The unit amount of amtA/uniAmt with slippage. + * @param unitAmtB The unit amount of amtB/uniAmt with slippage. + * @param getId ID to retrieve uniAmt. + * @param setIds Array of IDs to store the amount tokens received. */ function withdraw( address tokenA, @@ -77,12 +79,13 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Buy ETH/ERC20_Token. - * @param buyAddr buying token address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAddr selling token amount.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param buyAmt buying token amount. - * @param unitAmt unit amount of sellAmt/buyAmt with slippage. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Buy a token using a Uniswap pool + * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param buyAmt The amount of tokens to buy. + * @param unitAmt The unit amount of sellAmt/buyAmt with slippage. + * @param getId ID to retrieve buyAmt. + * @param setId ID to store the amount of tokens sold. */ function buy( address buyAddr, @@ -127,12 +130,13 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Sell ETH/ERC20_Token. - * @param buyAddr buying token address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAddr selling token amount.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAmt selling token amount. - * @param unitAmt unit amount of buyAmt/sellAmt with slippage. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. + * @notice Sell a token using a Uniswap pool + * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAmt The amount of the token to sell. + * @param unitAmt The unit amount of buyAmt/sellAmt with slippage. + * @param getId ID to retrieve sellAmt. + * @param setId ID stores the amount of token brought. */ function sell( address buyAddr,