mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Remove withdraw() and calldata from events
This commit is contained in:
parent
896a7254b9
commit
2c428d3d4b
|
|
@ -9,7 +9,6 @@ contract Events {
|
||||||
address delegate,
|
address delegate,
|
||||||
uint256 amount,
|
uint256 amount,
|
||||||
uint256 slippage,
|
uint256 slippage,
|
||||||
bytes callData,
|
|
||||||
uint256 getId
|
uint256 getId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,25 +47,26 @@ contract Helpers is DSMath, Basic {
|
||||||
|
|
||||||
uint256 nativeTokenAmt;
|
uint256 nativeTokenAmt;
|
||||||
if (isNative) {
|
if (isNative) {
|
||||||
// xcall does not take native asset, must wrap
|
|
||||||
convertEthToWeth(true, tokenContract, params.amount);
|
|
||||||
params.amount = params.amount == uint256(-1)
|
params.amount = params.amount == uint256(-1)
|
||||||
? address(this).balance
|
? address(this).balance
|
||||||
: params.amount;
|
: params.amount;
|
||||||
|
|
||||||
|
// xcall does not take native asset, must wrap
|
||||||
|
convertEthToWeth(true, tokenContract, params.amount);
|
||||||
|
|
||||||
nativeTokenAmt = params.amount;
|
nativeTokenAmt = params.amount;
|
||||||
} else {
|
} else {
|
||||||
params.amount = params.amount == uint256(-1)
|
params.amount = params.amount == uint256(-1)
|
||||||
? tokenContract.balanceOf(address(this))
|
? tokenContract.balanceOf(address(this))
|
||||||
: params.amount;
|
: params.amount;
|
||||||
|
|
||||||
|
if (params.amount > 0) {
|
||||||
|
tokenContract.approve(connextAddr, params.amount);
|
||||||
|
}
|
||||||
|
|
||||||
nativeTokenAmt = 0;
|
nativeTokenAmt = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNative && params.amount > 0) {
|
|
||||||
approve(tokenContract, connextAddr, params.amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
connext.xcall{ value: params.relayerFee + nativeTokenAmt }(
|
connext.xcall{ value: params.relayerFee + nativeTokenAmt }(
|
||||||
params.destination,
|
params.destination,
|
||||||
params.to,
|
params.to,
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ abstract contract ConnextResolver is Helpers {
|
||||||
|
|
||||||
_xcall(params);
|
_xcall(params);
|
||||||
|
|
||||||
_eventName = "LogXCall(uint32,address,address,address,uint256,uint256,bytes,uint256)";
|
_eventName = "LogXCall(uint32,address,address,address,uint256,uint256,uint256)";
|
||||||
_eventParam = abi.encode(
|
_eventParam = abi.encode(
|
||||||
params.destination,
|
params.destination,
|
||||||
params.to,
|
params.to,
|
||||||
|
|
@ -38,21 +38,9 @@ abstract contract ConnextResolver is Helpers {
|
||||||
params.delegate,
|
params.delegate,
|
||||||
params.amount,
|
params.amount,
|
||||||
params.slippage,
|
params.slippage,
|
||||||
params.callData,
|
|
||||||
getId
|
getId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev Delegatecall'ed by DSA.
|
|
||||||
* @notice Withdraw from the receiver contract to the calling DSA.
|
|
||||||
* @param asset Address of the asset to withdraw.
|
|
||||||
* @param getId ID to retrieve amount from last spell.
|
|
||||||
*/
|
|
||||||
function withdraw(address asset, uint256 amount, uint256 getId) external {
|
|
||||||
uint256 _amt = getUint(getId, amount);
|
|
||||||
instaReceiver.withdraw(asset, _amt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
contract ConnectV2ConnextOptimism is ConnextResolver {
|
contract ConnectV2ConnextOptimism is ConnextResolver {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user