mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
103 lines
2.4 KiB
Solidity
103 lines
2.4 KiB
Solidity
pragma solidity ^0.6.5;
|
|
|
|
import { OneProtoData, OneProtoMultiData, OneInchData} from "../../common/interfaces.sol";
|
|
|
|
contract Events {
|
|
event LogSell(
|
|
address indexed buyToken,
|
|
address indexed sellToken,
|
|
uint256 buyAmt,
|
|
uint256 sellAmt,
|
|
uint256 getId,
|
|
uint256 setId
|
|
);
|
|
|
|
function emitLogSell(
|
|
OneProtoData memory oneProtoData,
|
|
uint256 getId,
|
|
uint256 setId
|
|
) internal {
|
|
emit LogSell(
|
|
address(oneProtoData.buyToken),
|
|
address(oneProtoData.sellToken),
|
|
oneProtoData._buyAmt,
|
|
oneProtoData._sellAmt,
|
|
getId,
|
|
setId
|
|
);
|
|
}
|
|
|
|
event LogSellTwo(
|
|
address indexed buyToken,
|
|
address indexed sellToken,
|
|
uint256 buyAmt,
|
|
uint256 sellAmt,
|
|
uint256 getId,
|
|
uint256 setId
|
|
);
|
|
|
|
function emitLogSellTwo(
|
|
OneProtoData memory oneProtoData,
|
|
uint256 getId,
|
|
uint256 setId
|
|
) internal {
|
|
emit LogSellTwo(
|
|
address(oneProtoData.buyToken),
|
|
address(oneProtoData.sellToken),
|
|
oneProtoData._buyAmt,
|
|
oneProtoData._sellAmt,
|
|
getId,
|
|
setId
|
|
);
|
|
}
|
|
|
|
event LogSellMulti(
|
|
address[] tokens,
|
|
address indexed buyToken,
|
|
address indexed sellToken,
|
|
uint256 buyAmt,
|
|
uint256 sellAmt,
|
|
uint256 getId,
|
|
uint256 setId
|
|
);
|
|
|
|
function emitLogSellMulti(
|
|
OneProtoMultiData memory oneProtoData,
|
|
uint256 getId,
|
|
uint256 setId
|
|
) internal {
|
|
emit LogSellMulti(
|
|
oneProtoData.tokens,
|
|
address(oneProtoData.buyToken),
|
|
address(oneProtoData.sellToken),
|
|
oneProtoData._buyAmt,
|
|
oneProtoData._sellAmt,
|
|
getId,
|
|
setId
|
|
);
|
|
}
|
|
|
|
event LogSellThree(
|
|
address indexed buyToken,
|
|
address indexed sellToken,
|
|
uint256 buyAmt,
|
|
uint256 sellAmt,
|
|
uint256 getId,
|
|
uint256 setId
|
|
);
|
|
|
|
|
|
function emitLogSellThree(
|
|
OneInchData memory oneInchData,
|
|
uint256 setId
|
|
) internal {
|
|
emit LogSellThree(
|
|
address(oneInchData.buyToken),
|
|
address(oneInchData.sellToken),
|
|
oneInchData._buyAmt,
|
|
oneInchData._sellAmt,
|
|
0,
|
|
setId
|
|
);
|
|
}
|
|
} |