mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
commit
3e4b0bb033
|
@ -3,6 +3,7 @@ pragma experimental ABIEncoderV2;
|
|||
|
||||
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
||||
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
|
||||
import "@openzeppelin/contracts/utils/Address.sol";
|
||||
import { DSMath } from "./common/math.sol";
|
||||
|
||||
interface Account {
|
||||
|
@ -280,14 +281,14 @@ contract DydxFlashloaner is Setup, ICallee, DydxFlashloanBase, DSMath {
|
|||
require(sender == address(this), "not-same-sender");
|
||||
require(msg.sender == soloAddr, "not-solo-dydx-sender");
|
||||
|
||||
(AaveDataRaw memory _data, address dsa, uint ethAmt) = abi.decode(
|
||||
(bytes memory callData, uint ethAmt) = abi.decode(
|
||||
data,
|
||||
(AaveDataRaw, address, uint)
|
||||
(bytes, uint)
|
||||
);
|
||||
|
||||
wethContract.transfer(address(migrationAddr), ethAmt);
|
||||
|
||||
migrationAddr.migrateFlashCallback(_data, dsa, ethAmt);
|
||||
Address.functionCall(address(migrationAddr), callData);
|
||||
}
|
||||
|
||||
function initiateFlashLoan(bytes memory data, uint ethAmt) external {
|
||||
|
|
|
@ -184,7 +184,8 @@ contract MigrateResolver is LiquidityResolver {
|
|||
}
|
||||
|
||||
function migrateWithFlash(AaveDataRaw calldata _data, uint ethAmt) external {
|
||||
bytes memory data = abi.encode(_data, msg.sender, ethAmt);
|
||||
bytes memory callbackData = abi.encodeWithSelector(bytes4(this.migrateFlashCallback.selector), _data, msg.sender, ethAmt);
|
||||
bytes memory data = abi.encode(callbackData, ethAmt);
|
||||
|
||||
flashloanContract.initiateFlashLoan(data, ethAmt);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user