diff --git a/contracts/receivers/aave-v2-receiver/events.sol b/contracts/receivers/aave-v2-receiver/events.sol index 4d6372e..c4a3231 100644 --- a/contracts/receivers/aave-v2-receiver/events.sol +++ b/contracts/receivers/aave-v2-receiver/events.sol @@ -27,4 +27,12 @@ contract Events { ); event LogMigrate(uint _id); + + event LogFlashLoan( + address indexed sender, + address[] tokens, + uint[] amounts, + uint[] feeAmts, + uint route + ); } \ No newline at end of file diff --git a/contracts/receivers/aave-v2-receiver/interfaces.sol b/contracts/receivers/aave-v2-receiver/interfaces.sol index 46fa9b4..3203652 100644 --- a/contracts/receivers/aave-v2-receiver/interfaces.sol +++ b/contracts/receivers/aave-v2-receiver/interfaces.sol @@ -112,5 +112,5 @@ interface InstaListInterface { } interface DSAInterface { - function cast(address[] calldata _targets, bytes[] calldata _datas, address _origin) external payable returns (bytes32); + function castMigrate(string[] calldata _targets, bytes[] calldata _datas, address _origin) external payable returns (bytes32); } \ No newline at end of file diff --git a/contracts/receivers/aave-v2-receiver/main.sol b/contracts/receivers/aave-v2-receiver/main.sol index bef9733..7dfd37e 100644 --- a/contracts/receivers/aave-v2-receiver/main.sol +++ b/contracts/receivers/aave-v2-receiver/main.sol @@ -160,12 +160,19 @@ contract InstaFlash is AaveV2Migrator { data, (address, uint256, address[], uint256[], string[], bytes[]) ); - DSAInterface(msg.sender).cast(cd.dsaTargets, cd.dsaData, 0xB7fA44c2E964B6EB24893f7082Ecc08c8d0c0F87); + DSAInterface(msg.sender).castMigrate(cd.dsaTargets, cd.dsaData, 0xB7fA44c2E964B6EB24893f7082Ecc08c8d0c0F87); for (uint i = 0; i < _length; i++) { uint _finBal = _tokenContracts[i].balanceOf(address(this)); require(_finBal >= iniBal[i], "flashloan-not-returned"); } - // TODO: emit event + uint[] memory _feeAmts = new uint[](_length); + emit LogFlashLoan( + msg.sender, + _tokens, + _amounts, + _feeAmts, + 0 + ); } }