mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Set fee collector to master address
This commit is contained in:
parent
ee73084c01
commit
942bf63271
|
@ -51,6 +51,10 @@ interface EventInterface {
|
|||
function emitEvent(uint _connectorType, uint _connectorID, bytes32 _eventCode, bytes calldata _eventData) external;
|
||||
}
|
||||
|
||||
interface IndexInterface {
|
||||
function master() external view returns (address);
|
||||
}
|
||||
|
||||
contract DSMath {
|
||||
|
||||
function add(uint x, uint y) internal pure returns (uint z) {
|
||||
|
@ -103,6 +107,13 @@ contract Helpers is DSMath {
|
|||
return 0x2af7ea6Cb911035f3eb1ED895Cb6692C39ecbA97; // InstaEvent Address
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Return InstaIndex Address.
|
||||
*/
|
||||
function getIndexAddr() internal pure returns (address) {
|
||||
return 0x2971AdFa57b20E5a416aE5a708A8655A9c74f723; // InstaIndex Address
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Get Uint value from InstaMemory Contract.
|
||||
*/
|
||||
|
@ -153,13 +164,6 @@ contract LiquidityHelpers is Helpers {
|
|||
return 0x06cB7C24990cBE6b9F99982f975f9147c000fec6; // TODO - change
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Return Fee collector address
|
||||
*/
|
||||
function getFeeCollectorAddr() internal pure returns (address) {
|
||||
return 0x06cB7C24990cBE6b9F99982f975f9147c000fec6; // TODO - change
|
||||
}
|
||||
|
||||
function calculateFeeAmt(address token, uint amt) internal view returns (uint feeAmt, uint totalAmt) {
|
||||
uint fee = InstaPoolFeeInterface(getInstaPoolFeeAddr()).getFee();
|
||||
if(fee == 0) {
|
||||
|
@ -293,7 +297,8 @@ contract LiquidityAccess is LiquidityManage {
|
|||
|
||||
_transfer(payable(address(liquidityContract)), token, _amt);
|
||||
liquidityContract.returnLiquidity(_tknAddrs);
|
||||
_transfer(payable(getFeeCollectorAddr()), token, feeAmt);
|
||||
|
||||
_transfer(payable(IndexInterface(getIndexAddr).master()), token, feeAmt);
|
||||
|
||||
|
||||
setUint(setId, _amt);
|
||||
|
@ -353,7 +358,7 @@ contract LiquidityAccess is LiquidityManage {
|
|||
(uint feeAmt,) = calculateFeeAmt(tokens[i], _amt);
|
||||
|
||||
_transfer(payable(address(liquidityContract)), tokens[i], _amt);
|
||||
_transfer(payable(getFeeCollectorAddr()), tokens[i], feeAmt);
|
||||
_transfer(payable(IndexInterface(getIndexAddr).master()), tokens[i], feeAmt);
|
||||
|
||||
setUint(setId[i], _amt);
|
||||
|
||||
|
@ -386,7 +391,7 @@ contract LiquidityAccess is LiquidityManage {
|
|||
|
||||
_transfer(payable(address(liquidityContract)), token, _amt);
|
||||
liquidityContract.returnLiquidity(_tknAddrs);
|
||||
_transfer(payable(getFeeCollectorAddr()), token, poolFeeAmt);
|
||||
_transfer(payable(IndexInterface(getIndexAddr).master()), token, poolFeeAmt);
|
||||
_transfer(payable(origin), token, originFeeAmt);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user