mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
minor edits
This commit is contained in:
parent
f5568f3dbd
commit
b5aae2f7c9
|
|
@ -189,19 +189,19 @@ contract UniswapHelpers is Helpers {
|
||||||
contract Resolver is UniswapHelpers {
|
contract Resolver is UniswapHelpers {
|
||||||
|
|
||||||
function getBuyAmount(address buyAddr, address sellAddr, uint sellAmt, uint slippage)
|
function getBuyAmount(address buyAddr, address sellAddr, uint sellAmt, uint slippage)
|
||||||
public view returns (uint expectedRate, uint unitAmt)
|
public view returns (uint buyAmt, uint unitAmt)
|
||||||
{
|
{
|
||||||
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
||||||
expectedRate = getExpectedBuyAmt(address(_buyAddr), address(_sellAddr), sellAmt);
|
buyAmt = getExpectedBuyAmt(address(_buyAddr), address(_sellAddr), sellAmt);
|
||||||
unitAmt = getBuyUnitAmt(_buyAddr, expectedRate, _sellAddr, sellAmt, slippage);
|
unitAmt = getBuyUnitAmt(_buyAddr, buyAmt, _sellAddr, sellAmt, slippage);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSellAmount(address buyAddr, address sellAddr, uint buyAmt, uint slippage)
|
function getSellAmount(address buyAddr, address sellAddr, uint buyAmt, uint slippage)
|
||||||
public view returns (uint expectedRate, uint unitAmt)
|
public view returns (uint sellAmt, uint unitAmt)
|
||||||
{
|
{
|
||||||
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
||||||
expectedRate = getExpectedSellAmt(address(_buyAddr), address(_sellAddr), buyAmt);
|
sellAmt = getExpectedSellAmt(address(_buyAddr), address(_sellAddr), buyAmt);
|
||||||
unitAmt = getSellUnitAmt(_sellAddr, expectedRate, _buyAddr, buyAmt, slippage);
|
unitAmt = getSellUnitAmt(_sellAddr, sellAmt, _buyAddr, buyAmt, slippage);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDepositAmount(
|
function getDepositAmount(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user