Merge pull request #1 from shriyatyagii/connext-connectors

This commit is contained in:
Sanchay Mittal 2023-04-24 22:49:25 +09:00 committed by GitHub
commit 77fae20b5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -62,6 +62,6 @@ abstract contract ConnextResolver is Helpers {
} }
} }
contract ConnectV2ConnextOptimism is ConnextResolver { contract ConnectV2ConnextArbitrum is ConnextResolver {
string public constant name = "Connext-v1.0"; string public constant name = "Connext-v1.0";
} }

View File

@ -62,6 +62,6 @@ abstract contract ConnextResolver is Helpers {
} }
} }
contract ConnectV2ConnextOptimism is ConnextResolver { contract ConnectV2Connext is ConnextResolver {
string public constant name = "Connext-v1.0"; string public constant name = "Connext-v1.0";
} }

View File

@ -30,14 +30,14 @@ abstract contract ConnextResolver is Helpers {
{ {
uint256 _amount = getUint(getId, params.amount); uint256 _amount = getUint(getId, params.amount);
TokenInterface tokenContract = TokenInterface(params.asset); TokenInterface tokenContract = TokenInterface(params.asset);
bool isNative = params.asset == ethAddr; bool isNative = params.asset == maticAddr;
if (isNative) { if (isNative) {
_amount = _amount == uint256(-1) ? address(this).balance : _amount; _amount = _amount == uint256(-1) ? address(this).balance : _amount;
params.asset = wethAddr; params.asset = wmaticAddr;
tokenContract = TokenInterface(params.asset); tokenContract = TokenInterface(params.asset);
// xcall does not take native asset, must wrap // xcall does not take native asset, must wrap
convertEthToWeth(true, tokenContract, _amount); convertMaticToWmatic(true, tokenContract, _amount);
} else { } else {
_amount = _amount == uint256(-1) ? tokenContract.balanceOf(address(this)) : _amount; _amount = _amount == uint256(-1) ? tokenContract.balanceOf(address(this)) : _amount;
@ -62,6 +62,6 @@ abstract contract ConnextResolver is Helpers {
} }
} }
contract ConnectV2ConnextOptimism is ConnextResolver { contract ConnectV2ConnextPolygon is ConnextResolver {
string public constant name = "Connext-v1.0"; string public constant name = "Connext-v1.0";
} }