aave polygon claim function update

This commit is contained in:
Thrilok Kumar 2021-06-02 05:41:02 +05:30
parent 548b5383d8
commit 9ba2885a0f

View File

@ -35,8 +35,13 @@ abstract contract PolygonBridgeResolver is Events, Helpers {
} else { } else {
TokenInterface _token = TokenInterface(token); TokenInterface _token = TokenInterface(token);
_amt = _amt == uint(-1) ? _token.balanceOf(address(this)) : _amt; _amt = _amt == uint(-1) ? _token.balanceOf(address(this)) : _amt;
_token.approve(erc20Predicate, _amt); if (migrator.rootToChildToken(token) != address(0)) {
migrator.depositFor(targetDsa, token, abi.encode(_amt)); _token.approve(erc20Predicate, _amt);
migrator.depositFor(targetDsa, token, abi.encode(_amt));
} else {
_token.approve(address(migratorPlasma), _amt);
migratorPlasma.depositERC20ForUser(token, targetDsa, _amt);
}
} }
setUint(setId, _amt); setUint(setId, _amt);
@ -47,5 +52,5 @@ abstract contract PolygonBridgeResolver is Events, Helpers {
} }
contract ConnectV2PolygonBridge is PolygonBridgeResolver { contract ConnectV2PolygonBridge is PolygonBridgeResolver {
string public constant name = "Polygon-Bridge-v1"; string public constant name = "Polygon-Bridge-v1.1";
} }