mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
sort removed & interface updated
This commit is contained in:
parent
5f6a4bf284
commit
dd9c9533b8
|
@ -6,19 +6,7 @@ import "./interface.sol";
|
||||||
|
|
||||||
contract Helpers is Basic {
|
contract Helpers is Basic {
|
||||||
|
|
||||||
UniLimitOrder public constant limitCon_ = UniLimitOrder(0xfC428E6535dC5Fee30fb57cFc93EBB1D92fdCf6e);
|
IUniLimitOrder public constant limitCon_ = IUniLimitOrder(0xfC428E6535dC5Fee30fb57cFc93EBB1D92fdCf6e);
|
||||||
|
|
||||||
function sortTokenAddress(address _token0, address _token1)
|
|
||||||
internal
|
|
||||||
pure
|
|
||||||
returns (address token0, address token1)
|
|
||||||
{
|
|
||||||
if (_token0 > _token1) {
|
|
||||||
(token0, token1) = (_token1, _token0);
|
|
||||||
} else {
|
|
||||||
(token0, token1) = (_token0, _token1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct MintParams {
|
struct MintParams {
|
||||||
address token0;
|
address token0;
|
||||||
|
@ -58,19 +46,8 @@ contract Helpers is Basic {
|
||||||
approve(token1_, address(limitCon_), amountSend_);
|
approve(token1_, address(limitCon_), amountSend_);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
IUniLimitOrder.MintParams memory parameter =
|
||||||
(address token0, ) = sortTokenAddress(
|
IUniLimitOrder.MintParams(
|
||||||
address(token0_),
|
|
||||||
address(token1_)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (token0 != address(token0_)) {
|
|
||||||
(token0_, token1_) = (token1_, token0_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
UniLimitOrder.MintParams memory parameter =
|
|
||||||
UniLimitOrder.MintParams(
|
|
||||||
address(token0_),
|
address(token0_),
|
||||||
address(token1_),
|
address(token1_),
|
||||||
params_.fee,
|
params_.fee,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
pragma solidity ^0.8.1;
|
pragma solidity ^0.8.1;
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
interface UniLimitOrder {
|
interface IUniLimitOrder {
|
||||||
|
|
||||||
function NftToOwner(uint256) external view returns (address);
|
function NftToOwner(uint256) external view returns (address);
|
||||||
function token0to1(uint256) external view returns (bool);
|
function token0to1(uint256) external view returns (bool);
|
||||||
|
|
|
@ -2,7 +2,7 @@ pragma solidity ^0.8.1;
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import {Helpers} from "./helpers.sol";
|
import {Helpers} from "./helpers.sol";
|
||||||
import {UniLimitOrder} from "./interface.sol";
|
import {IUniLimitOrder} from "./interface.sol";
|
||||||
import {TokenInterface} from "../../common/interfaces.sol";
|
import {TokenInterface} from "../../common/interfaces.sol";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user