Skip to content

Commit

Permalink
Merge pull request #7 from router-protocol/feat/sushiswap
Browse files Browse the repository at this point in the history
Feat/sushiswap
  • Loading branch information
YashikaGoyal912 authored Dec 29, 2023
2 parents 838be05 + da8e5d1 commit 0e62fa6
Show file tree
Hide file tree
Showing 39 changed files with 604 additions and 179 deletions.
4 changes: 2 additions & 2 deletions contracts/BatchTransaction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity 0.8.18;

import {ReentrancyGuard} from "./utils/ReentrancyGuard.sol";
import {Basic} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {Basic} from "router-intents/contracts/BaseAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {CallLib} from "./CallLib.sol";
import {IERC20, SafeERC20} from "./utils/SafeERC20.sol";
import {Errors} from "./Errors.sol";
Expand Down
13 changes: 7 additions & 6 deletions contracts/intent-adapters/erc20/ERC20Approval.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {DefaultRefundable} from "router-intents/contracts/DefaultRefundable.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {DefaultRefundable} from "router-intents/contracts/utils/DefaultRefundable.sol";
import {IERC20, SafeERC20} from "../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../utils/SafeERC20.sol";
* @notice Providing approval for ERC20 tokens.
*/
contract ERC20Approval is
RouterIntentAdapter,
RouterIntentEoaAdapter,
NitroMessageHandler,
DefaultRefundable
{
Expand All @@ -26,7 +27,7 @@ contract ERC20Approval is
address __dexspan,
address __defaultRefundAddress
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
DefaultRefundable(__defaultRefundAddress)
// solhint-disable-next-line no-empty-blocks
Expand All @@ -39,7 +40,7 @@ contract ERC20Approval is
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
13 changes: 7 additions & 6 deletions contracts/intent-adapters/erc20/ERC20Transfer.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {DefaultRefundable} from "router-intents/contracts/DefaultRefundable.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {DefaultRefundable} from "router-intents/contracts/utils/DefaultRefundable.sol";
import {IERC20, SafeERC20} from "../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../utils/SafeERC20.sol";
* @notice Transferring ERC20 tokens.
*/
contract ERC20Transfer is
RouterIntentAdapter,
RouterIntentEoaAdapter,
NitroMessageHandler,
DefaultRefundable
{
Expand All @@ -26,7 +27,7 @@ contract ERC20Transfer is
address __dexspan,
address __defaultRefundAddress
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
DefaultRefundable(__defaultRefundAddress)
// solhint-disable-next-line no-empty-blocks
Expand All @@ -39,7 +40,7 @@ contract ERC20Transfer is
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
pragma solidity 0.8.18;

import {AaveV3Helpers} from "./AaveV3Helpers.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {DefaultRefundable} from "router-intents/contracts/DefaultRefundable.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {DefaultRefundable} from "router-intents/contracts/utils/DefaultRefundable.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -13,7 +14,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Borrowing funds on AaveV3.
*/
contract AaveV3Borrow is
RouterIntentAdapter,
RouterIntentEoaAdapter,
NitroMessageHandler,
DefaultRefundable,
AaveV3Helpers
Expand All @@ -31,7 +32,7 @@ contract AaveV3Borrow is
address __aaveV3WrappedTokenGateway,
uint16 __aaveV3ReferralCode
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
DefaultRefundable(__defaultRefundAddress)
AaveV3Helpers(
Expand All @@ -49,7 +50,7 @@ contract AaveV3Borrow is
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity 0.8.18;

import {AaveV3Helpers} from "./AaveV3Helpers.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Supplying funds on AaveV3.
*/
contract AaveV3Supply is
RouterIntentAdapter,
RouterIntentEoaAdapter,
NitroMessageHandler,
AaveV3Helpers
{
Expand All @@ -30,7 +31,7 @@ contract AaveV3Supply is
address __aaveV3WrappedTokenGateway,
uint16 __aaveV3ReferralCode
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
AaveV3Helpers(
__aaveV3Pool,
Expand All @@ -47,7 +48,7 @@ contract AaveV3Supply is
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
11 changes: 6 additions & 5 deletions contracts/intent-adapters/liquid-staking/Ankr/AnkrStakeAvax.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity 0.8.18;

import {IAnkrStakeAvax} from "./Interfaces.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Staking AVAX to receive AnkrAVAX on Ankr.
* @notice This contract is only for Avalanche chain.
*/
contract AnkrStakeAvax is RouterIntentAdapter, NitroMessageHandler {
contract AnkrStakeAvax is RouterIntentEoaAdapter, NitroMessageHandler {
using SafeERC20 for IERC20;

address private immutable _ankrAvax;
Expand All @@ -33,7 +34,7 @@ contract AnkrStakeAvax is RouterIntentAdapter, NitroMessageHandler {
address __ankrAvax,
address __ankrPool
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
{
_ankrAvax = __ankrAvax;
Expand All @@ -53,7 +54,7 @@ contract AnkrStakeAvax is RouterIntentAdapter, NitroMessageHandler {
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
11 changes: 6 additions & 5 deletions contracts/intent-adapters/liquid-staking/Ankr/AnkrStakeBsc.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity 0.8.18;

import {IAnkrStakeBsc} from "./Interfaces.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Staking BSC to receive AnkrBSC on Ankr.
* @notice This contract is only for BSC chain.
*/
contract AnkrStakeBsc is RouterIntentAdapter, NitroMessageHandler {
contract AnkrStakeBsc is RouterIntentEoaAdapter, NitroMessageHandler {
using SafeERC20 for IERC20;

address private immutable _ankrBsc;
Expand All @@ -33,7 +34,7 @@ contract AnkrStakeBsc is RouterIntentAdapter, NitroMessageHandler {
address __ankrBsc,
address __ankrPool
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
{
_ankrBsc = __ankrBsc;
Expand All @@ -53,7 +54,7 @@ contract AnkrStakeBsc is RouterIntentAdapter, NitroMessageHandler {
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
11 changes: 6 additions & 5 deletions contracts/intent-adapters/liquid-staking/Ankr/AnkrStakeEth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity 0.8.18;

import {IAnkrStakeEth} from "./Interfaces.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Staking ETH to receive AnkrETH on Ankr.
* @notice This contract is only for Ethereum chain.
*/
contract AnkrStakeEth is RouterIntentAdapter, NitroMessageHandler {
contract AnkrStakeEth is RouterIntentEoaAdapter, NitroMessageHandler {
using SafeERC20 for IERC20;

address private immutable _ankrEth;
Expand All @@ -33,7 +34,7 @@ contract AnkrStakeEth is RouterIntentAdapter, NitroMessageHandler {
address __ankrEth,
address __ankrPool
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
{
_ankrEth = __ankrEth;
Expand All @@ -53,7 +54,7 @@ contract AnkrStakeEth is RouterIntentAdapter, NitroMessageHandler {
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity 0.8.18;

import {IAnkrStakeFtm} from "./Interfaces.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Staking FTM to receive AnkrFTM on Ankr.
* @notice This contract is only for Fantom chain.
*/
contract AnkrStakeFantom is RouterIntentAdapter, NitroMessageHandler {
contract AnkrStakeFantom is RouterIntentEoaAdapter, NitroMessageHandler {
using SafeERC20 for IERC20;

address private immutable _ankrFtm;
Expand All @@ -33,7 +34,7 @@ contract AnkrStakeFantom is RouterIntentAdapter, NitroMessageHandler {
address __ankrFtm,
address __ankrPool
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
{
_ankrFtm = __ankrFtm;
Expand All @@ -53,7 +54,7 @@ contract AnkrStakeFantom is RouterIntentAdapter, NitroMessageHandler {
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
11 changes: 6 additions & 5 deletions contracts/intent-adapters/liquid-staking/Ankr/AnkrStakeMatic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity 0.8.18;

import {IAnkrStakeMatic} from "./Interfaces.sol";
import {RouterIntentAdapter, Errors} from "router-intents/contracts/RouterIntentAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/NitroMessageHandler.sol";
import {RouterIntentEoaAdapter, EoaExecutor} from "router-intents/contracts/RouterIntentEoaAdapter.sol";
import {NitroMessageHandler} from "router-intents/contracts/utils/NitroMessageHandler.sol";
import {Errors} from "router-intents/contracts/utils/Errors.sol";
import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";

/**
Expand All @@ -12,7 +13,7 @@ import {IERC20, SafeERC20} from "../../../utils/SafeERC20.sol";
* @notice Staking MATIC to receive AnkrMATIC on Ankr.
* @notice This contract is only for Ethereum chain.
*/
contract AnkrStakeMatic is RouterIntentAdapter, NitroMessageHandler {
contract AnkrStakeMatic is RouterIntentEoaAdapter, NitroMessageHandler {
using SafeERC20 for IERC20;

address private immutable _ankrMatic;
Expand All @@ -35,7 +36,7 @@ contract AnkrStakeMatic is RouterIntentAdapter, NitroMessageHandler {
address __matic,
address __ankrPool
)
RouterIntentAdapter(__native, __wnative, __owner)
RouterIntentEoaAdapter(__native, __wnative, __owner)
NitroMessageHandler(__assetForwarder, __dexspan)
{
_ankrMatic = __ankrMatic;
Expand All @@ -60,7 +61,7 @@ contract AnkrStakeMatic is RouterIntentAdapter, NitroMessageHandler {
}

/**
* @inheritdoc RouterIntentAdapter
* @inheritdoc EoaExecutor
*/
function execute(
address,
Expand Down
Loading

0 comments on commit 0e62fa6

Please sign in to comment.