Remove withdraw() and calldata from events

This commit is contained in:
just-a-node 2023-02-22 22:45:07 -07:00
parent 896a7254b9
commit 2c428d3d4b
No known key found for this signature in database
GPG Key ID: 0DA737526BA15F3B
3 changed files with 8 additions and 20 deletions

View File

@ -9,7 +9,6 @@ contract Events {
address delegate,
uint256 amount,
uint256 slippage,
bytes callData,
uint256 getId
);
}

View File

@ -47,25 +47,26 @@ contract Helpers is DSMath, Basic {
uint256 nativeTokenAmt;
if (isNative) {
// xcall does not take native asset, must wrap
convertEthToWeth(true, tokenContract, params.amount);
params.amount = params.amount == uint256(-1)
? address(this).balance
: params.amount;
// xcall does not take native asset, must wrap
convertEthToWeth(true, tokenContract, params.amount);
nativeTokenAmt = params.amount;
} else {
params.amount = params.amount == uint256(-1)
? tokenContract.balanceOf(address(this))
: params.amount;
if (params.amount > 0) {
tokenContract.approve(connextAddr, params.amount);
}
nativeTokenAmt = 0;
}
if (!isNative && params.amount > 0) {
approve(tokenContract, connextAddr, params.amount);
}
connext.xcall{ value: params.relayerFee + nativeTokenAmt }(
params.destination,
params.to,

View File

@ -30,7 +30,7 @@ abstract contract ConnextResolver is Helpers {
_xcall(params);
_eventName = "LogXCall(uint32,address,address,address,uint256,uint256,bytes,uint256)";
_eventName = "LogXCall(uint32,address,address,address,uint256,uint256,uint256)";
_eventParam = abi.encode(
params.destination,
params.to,
@ -38,21 +38,9 @@ abstract contract ConnextResolver is Helpers {
params.delegate,
params.amount,
params.slippage,
params.callData,
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 {