mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Added natspec comments
This commit is contained in:
parent
0870b9b83a
commit
6b18e337c7
|
@ -7,11 +7,23 @@ import "./interface.sol";
|
|||
|
||||
contract EulerHelpers is Basic {
|
||||
|
||||
/**
|
||||
* @dev Euler's Market Module
|
||||
*/
|
||||
IEulerMarkets internal constant markets =
|
||||
IEulerMarkets(0x3520d5a913427E6F0D6A83E07ccD4A4da316e4d3);
|
||||
|
||||
/**
|
||||
* @dev Euler's Execution Module
|
||||
*/
|
||||
IEulerExecute internal constant eulerExec = IEulerExecute(0x59828FdF7ee634AaaD3f58B19fDBa3b03E2D9d80);
|
||||
|
||||
/**
|
||||
* @dev Compute sub account address.
|
||||
* @notice Compute sub account address from sub-account id
|
||||
* @param primary primary address
|
||||
* @param subAccountId sub-account id whose address needs to be computed
|
||||
*/
|
||||
function getSubAccountAddress(address primary, uint256 subAccountId)
|
||||
public
|
||||
pure
|
||||
|
|
|
@ -5,12 +5,21 @@ import "./helpers.sol";
|
|||
|
||||
contract EulerImport is EulerHelpers {
|
||||
|
||||
/**
|
||||
* @dev Import Euler position.
|
||||
* @notice Import EOA's Euler subaccount position to DSA's Euler subaccount
|
||||
* @param userAccount The address of the EOA from which position will be imported
|
||||
* @param sourceId EOA sub-account id from which position be be imported
|
||||
* @param targetId DSA sub-account id
|
||||
* @param inputData The struct containing all the neccessary input data
|
||||
* @param enterMarket The boolean array to enable market in the imported position
|
||||
*/
|
||||
function importEuler(
|
||||
address userAccount,//EOA address
|
||||
address userAccount,
|
||||
uint256 sourceId,
|
||||
uint256 targetId,
|
||||
bool[] memory enterMarket,
|
||||
ImportInputData memory inputData
|
||||
ImportInputData memory inputData,
|
||||
bool[] memory enterMarket
|
||||
)
|
||||
external
|
||||
payable
|
||||
|
@ -20,7 +29,7 @@ contract EulerImport is EulerHelpers {
|
|||
}
|
||||
|
||||
function _importEuler(
|
||||
address userAccount,//EOA address
|
||||
address userAccount,
|
||||
uint256 sourceId,
|
||||
uint256 targetId,
|
||||
ImportInputData memory inputData,
|
||||
|
@ -36,7 +45,7 @@ contract EulerImport is EulerHelpers {
|
|||
require(inputData.supplyTokens.length > 0, "0-length-not-allowed");
|
||||
require(enterMarket.length == inputData.supplyTokens.length, "lengths-not-same");
|
||||
|
||||
address _sourceAccount = getSubAccountAddress(userAccount, sourceId); //User's EOA sub-account address
|
||||
address _sourceAccount = getSubAccountAddress(userAccount, sourceId);
|
||||
address _targetAccount = getSubAccountAddress(address(this), targetId);
|
||||
|
||||
ImportData memory data;
|
||||
|
@ -78,3 +87,7 @@ contract EulerImport is EulerHelpers {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
contract ConnectV2EulerImport is EulerImport {
|
||||
string public constant name = "Euler-import-v1.0";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user