mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
prettier
This commit is contained in:
parent
6e7477bd1b
commit
0ee4b2af83
|
|
@ -11,14 +11,17 @@ contract Helpers is DSMath, Basic {
|
||||||
/**
|
/**
|
||||||
* @dev Connext Diamond Address
|
* @dev Connext Diamond Address
|
||||||
*/
|
*/
|
||||||
address internal constant connextAddr = 0x8f7492DE823025b4CfaAB1D34c58963F2af5DEDA;
|
address internal constant connextAddr =
|
||||||
|
0x8f7492DE823025b4CfaAB1D34c58963F2af5DEDA;
|
||||||
IConnext internal constant connext = IConnext(connextAddr);
|
IConnext internal constant connext = IConnext(connextAddr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev InstaReceiver Address
|
* @dev InstaReceiver Address
|
||||||
*/
|
*/
|
||||||
address internal constant instaReceiverAddr = 0x0000000000000000000000000000000000000000; // TODO: Add InstaReceiver address
|
address internal constant instaReceiverAddr =
|
||||||
IInstaReceiver internal constant instaReceiver = IInstaReceiver(instaReceiverAddr);
|
0x0000000000000000000000000000000000000000; // TODO: Add InstaReceiver address
|
||||||
|
IInstaReceiver internal constant instaReceiver =
|
||||||
|
IInstaReceiver(instaReceiverAddr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param destination The destination domain ID.
|
* @param destination The destination domain ID.
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,9 @@ interface IConnext {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IInstaReceiver {
|
interface IInstaReceiver {
|
||||||
function withdraw(
|
function withdraw(address _asset, uint256 _amount)
|
||||||
address _asset,
|
external
|
||||||
uint256 _amount
|
returns (bytes memory);
|
||||||
) external returns (bytes memory);
|
|
||||||
|
|
||||||
function xReceive(
|
function xReceive(
|
||||||
bytes32 _transferId,
|
bytes32 _transferId,
|
||||||
|
|
|
||||||
|
|
@ -1,101 +1,48 @@
|
||||||
//SPDX-License-Identifier: MIT
|
//SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
pragma solidity ^0.7.0;
|
pragma solidity ^0.7.0;
|
||||||
|
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* @title Connext.
|
* @title Connext.
|
||||||
|
|
||||||
* @dev Cross chain bridge.
|
* @dev Cross chain bridge.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { TokenInterface, MemoryInterface } from "../../common/interfaces.sol";
|
import { TokenInterface, MemoryInterface } from "../../common/interfaces.sol";
|
||||||
|
|
||||||
import { Stores } from "../../common/stores.sol";
|
import { Stores } from "../../common/stores.sol";
|
||||||
|
|
||||||
import "./interface.sol";
|
import "./interface.sol";
|
||||||
|
|
||||||
import "./helpers.sol";
|
import "./helpers.sol";
|
||||||
|
|
||||||
import "./events.sol";
|
import "./events.sol";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
abstract contract ConnextResolver is Helpers {
|
abstract contract ConnextResolver is Helpers {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* @dev Call xcall on Connext.
|
* @dev Call xcall on Connext.
|
||||||
|
|
||||||
* @notice Call xcall on Connext.
|
* @notice Call xcall on Connext.
|
||||||
|
|
||||||
* @param params XCallParams struct.
|
* @param params XCallParams struct.
|
||||||
|
|
||||||
* @param getId ID to retrieve amount from last spell.
|
* @param getId ID to retrieve amount from last spell.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function xcall(XCallParams memory params, uint256 getId)
|
function xcall(XCallParams memory params, uint256 getId)
|
||||||
|
|
||||||
external
|
external
|
||||||
|
|
||||||
payable
|
payable
|
||||||
|
|
||||||
returns (string memory _eventName, bytes memory _eventParam)
|
returns (string memory _eventName, bytes memory _eventParam)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
params.amount = getUint(getId, params.amount);
|
params.amount = getUint(getId, params.amount);
|
||||||
|
|
||||||
TokenInterface tokenContract = TokenInterface(params.asset);
|
TokenInterface tokenContract = TokenInterface(params.asset);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_xcall(params);
|
_xcall(params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_eventName = "LogXCall(uint32,address,address,address,uint256,uint256,uint256)";
|
_eventName = "LogXCall(uint32,address,address,address,uint256,uint256,uint256)";
|
||||||
|
|
||||||
_eventParam = abi.encode(
|
_eventParam = abi.encode(
|
||||||
|
|
||||||
params.destination,
|
params.destination,
|
||||||
|
|
||||||
params.to,
|
params.to,
|
||||||
|
|
||||||
params.asset,
|
params.asset,
|
||||||
|
|
||||||
params.delegate,
|
params.delegate,
|
||||||
|
|
||||||
params.amount,
|
params.amount,
|
||||||
|
|
||||||
params.slippage,
|
params.slippage,
|
||||||
|
|
||||||
getId
|
getId
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contract ConnectV2ConnextOptimism is ConnextResolver {
|
contract ConnectV2ConnextOptimism is ConnextResolver {
|
||||||
|
|
||||||
string public constant name = "Connext-v1.0";
|
string public constant name = "Connext-v1.0";
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user