2021-02-07 16:40:28 +00:00
|
|
|
pragma solidity ^0.7.0;
|
2020-11-20 14:49:48 +00:00
|
|
|
|
2021-02-07 16:40:28 +00:00
|
|
|
import { OneProtoData, OneProtoMultiData, OneInchData} from "./interface.sol";
|
2020-11-20 14:49:48 +00:00
|
|
|
|
2021-02-05 18:33:49 +00:00
|
|
|
contract Events {
|
2020-11-20 14:49:48 +00:00
|
|
|
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
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|