mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
add: transaction asset relayerfee option
This commit is contained in:
parent
35b025bd68
commit
e775788549
|
|
@ -22,6 +22,7 @@ contract Helpers is DSMath, Basic {
|
||||||
* @param slippage Maximum amount of slippage the user will accept in BPS.
|
* @param slippage Maximum amount of slippage the user will accept in BPS.
|
||||||
* @param relayerFee Relayer fee paid in origin native asset.
|
* @param relayerFee Relayer fee paid in origin native asset.
|
||||||
* @param callData Encoded calldata to send.
|
* @param callData Encoded calldata to send.
|
||||||
|
* @param nativeRelayerFee booleam choice for relayer fee asset selection.
|
||||||
*/
|
*/
|
||||||
struct XCallParams {
|
struct XCallParams {
|
||||||
uint32 destination;
|
uint32 destination;
|
||||||
|
|
@ -32,9 +33,10 @@ contract Helpers is DSMath, Basic {
|
||||||
uint256 slippage;
|
uint256 slippage;
|
||||||
uint256 relayerFee;
|
uint256 relayerFee;
|
||||||
bytes callData;
|
bytes callData;
|
||||||
|
bool nativeRelayerFee;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _xcall(XCallParams memory params) internal {
|
function _xcallFeeNativeAsset(XCallParams memory params) internal {
|
||||||
connext.xcall{ value: params.relayerFee }(
|
connext.xcall{ value: params.relayerFee }(
|
||||||
params.destination,
|
params.destination,
|
||||||
params.to,
|
params.to,
|
||||||
|
|
@ -45,4 +47,17 @@ contract Helpers is DSMath, Basic {
|
||||||
params.callData
|
params.callData
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _xcallFeeTransactingAsseet(XCallParams memory params) internal {
|
||||||
|
connext.xcall(
|
||||||
|
params.destination,
|
||||||
|
params.to,
|
||||||
|
params.asset,
|
||||||
|
params.delegate,
|
||||||
|
params.amount - params.relayerFee,
|
||||||
|
params.slippage,
|
||||||
|
params.callData,
|
||||||
|
params.relayerFee
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user