df8039f494
new file: Interchain-message/.eslintrc.js new file: Interchain-message/.gitignore new file: Interchain-message/.prettierrc new file: Interchain-message/.solhint.json new file: Interchain-message/.solhintignore new file: Interchain-message/contracts/interfaces/IBridge.sol new file: Interchain-message/contracts/interfaces/IMessageBus.sol new file: Interchain-message/contracts/interfaces/IMessageReceiverApp.sol new file: Interchain-message/contracts/interfaces/IUniswapRouterV3.sol new file: Interchain-message/contracts/interfaces/IWETH.sol new file: Interchain-message/contracts/message/apps/BridgeSwap.sol new file: Interchain-message/contracts/message/apps/RubicRouterV2.sol new file: Interchain-message/contracts/message/apps/RubicRouterV2ETH.sol new file: Interchain-message/contracts/message/apps/SwapBase.sol new file: Interchain-message/contracts/message/apps/TransferSwapInch.sol new file: Interchain-message/contracts/message/apps/TransferSwapV2.sol new file: Interchain-message/contracts/message/apps/TransferSwapV3.sol new file: Interchain-message/contracts/message/framework/MessageReceiverApp.sol new file: Interchain-message/contracts/message/framework/MessageSenderApp.sol new file: Interchain-message/contracts/message/libraries/MessageSenderLib.sol new file: Interchain-message/contracts/message/libraries/MsgDataTypes.sol new file: Interchain-message/contracts/test/MessageBusSender.sol new file: Interchain-message/contracts/test/TestERC20.sol new file: Interchain-message/contracts/test/TestMessages.sol new file: Interchain-message/contracts/test/WETH9.sol new file: Interchain-message/deployments/Readme.md new file: Interchain-message/executor/config/cbridge.toml new file: Interchain-message/executor/config/executor.toml new file: Interchain-message/executor/eth-ks/signer.json new file: Interchain-message/hardhat.config.ts new file: Interchain-message/package-lock.json new file: Interchain-message/package.json new file: Interchain-message/reports/contract_sizes.txt new file: Interchain-message/reports/gas_usage/summary.txt new file: Interchain-message/scripts/deploy/deploy.js new file: Interchain-message/scripts/deploy/deployAVAX.ts new file: Interchain-message/scripts/deploy/deployArbitrum.ts new file: Interchain-message/scripts/deploy/deployAurora.ts new file: Interchain-message/scripts/deploy/deployBSC.ts new file: Interchain-message/scripts/deploy/deployEth.ts new file: Interchain-message/scripts/deploy/deployFantom.ts new file: Interchain-message/scripts/deploy/deployPoly.ts new file: Interchain-message/scripts/privateKey.js new file: Interchain-message/scripts/sendTx/avaxToFantomBridge.js new file: Interchain-message/scripts/sendTx/avaxToFantomNativeV2.js new file: Interchain-message/test/RubicCrossChainBridge.spec.ts new file: Interchain-message/test/RubicCrossChainV2.spec.ts new file: Interchain-message/test/RubicCrossChainV3.spec.ts new file: Interchain-message/test/RubicFallback.spec.ts new file: Interchain-message/test/RubicSettings.spec.ts new file: Interchain-message/test/shared/consts.ts new file: Interchain-message/test/shared/fixtures.ts new file: Interchain-message/test/shared/utils.ts new file: Interchain-message/tsconfig.json deleted: Rubic-Inter-chain-Message-develop.zip deleted: proxy-instant-trades-master.zip deleted: rubic-app-master.zip deleted: rubic-sdk-master.zip
109 lines
4.1 KiB
Solidity
109 lines
4.1 KiB
Solidity
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
pragma solidity >=0.7.5;
|
|
pragma abicoder v2;
|
|
|
|
/// @title Router token swapping functionality
|
|
/// @notice Functions for swapping tokens via Uniswap Algebra
|
|
interface IUniswapRouterV3 {
|
|
/// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
|
|
/// @dev In the implementation you must pay the pool tokens owed for the swap.
|
|
/// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
|
|
/// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
|
|
/// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
|
|
/// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
|
|
/// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
|
|
/// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
|
|
/// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
|
|
function uniswapV3SwapCallback(
|
|
int256 amount0Delta,
|
|
int256 amount1Delta,
|
|
bytes calldata data
|
|
) external;
|
|
|
|
struct ExactInputSingleParams {
|
|
address tokenIn;
|
|
address tokenOut;
|
|
uint24 fee;
|
|
address recipient;
|
|
uint256 deadline;
|
|
uint256 amountIn;
|
|
uint256 amountOutMinimum;
|
|
uint160 sqrtPriceLimitX96;
|
|
}
|
|
|
|
/// @notice Swaps `amountIn` of one token for as much as possible of another token
|
|
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
|
|
/// @return amountOut The amount of the received token
|
|
function exactInputSingle(ExactInputSingleParams calldata params)
|
|
external
|
|
payable
|
|
returns (uint256 amountOut);
|
|
|
|
struct ExactInputParams {
|
|
bytes path;
|
|
address recipient;
|
|
uint256 deadline;
|
|
uint256 amountIn;
|
|
uint256 amountOutMinimum;
|
|
}
|
|
|
|
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
|
|
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
|
|
/// @return amountOut The amount of the received token
|
|
function exactInput(ExactInputParams calldata params)
|
|
external
|
|
payable
|
|
returns (uint256 amountOut);
|
|
|
|
struct ExactOutputSingleParams {
|
|
address tokenIn;
|
|
address tokenOut;
|
|
uint24 fee;
|
|
address recipient;
|
|
uint256 deadline;
|
|
uint256 amountOut;
|
|
uint256 amountInMaximum;
|
|
uint160 sqrtPriceLimitX96;
|
|
}
|
|
|
|
/// @notice Swaps as little as possible of one token for `amountOut` of another token
|
|
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
|
|
/// @return amountIn The amount of the input token
|
|
function exactOutputSingle(ExactOutputSingleParams calldata params)
|
|
external
|
|
payable
|
|
returns (uint256 amountIn);
|
|
|
|
struct ExactOutputParams {
|
|
bytes path;
|
|
address recipient;
|
|
uint256 deadline;
|
|
uint256 amountOut;
|
|
uint256 amountInMaximum;
|
|
}
|
|
|
|
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
|
|
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
|
|
/// @return amountIn The amount of the input token
|
|
function exactOutput(ExactOutputParams calldata params)
|
|
external
|
|
payable
|
|
returns (uint256 amountIn);
|
|
|
|
function WETH9() external view returns (address);
|
|
|
|
function WNativeToken() external view returns (address);
|
|
|
|
function refundETH() external payable;
|
|
|
|
function refundNativeToken() external payable;
|
|
|
|
function unwrapWETH9(uint256 amountMinimum, address recipient)
|
|
external
|
|
payable;
|
|
|
|
function unwrapWNativeToken(uint256 amountMinimum, address recipient)
|
|
external
|
|
payable;
|
|
}
|