remove dpp & dvm events indexed
This commit is contained in:
@@ -57,19 +57,19 @@ contract DPPStorage is InitializableOwnable, ReentrancyGuard {
|
||||
|
||||
// ============ Events ============
|
||||
|
||||
event SetLpFeeRateModel(address indexed oldAddr, address indexed newAddr);
|
||||
event SetLpFeeRateModel(address oldAddr, address newAddr);
|
||||
|
||||
event SetMtFeeRateModel(address indexed oldAddr, address indexed newAddr);
|
||||
event SetMtFeeRateModel(address oldAddr, address newAddr);
|
||||
|
||||
event SetTradePermissionManager(address indexed oldAddr, address indexed newAddr);
|
||||
event SetTradePermissionManager(address oldAddr, address newAddr);
|
||||
|
||||
event SetMaintainer(address indexed oldAddr, address indexed newAddr);
|
||||
event SetMaintainer(address oldAddr, address newAddr);
|
||||
|
||||
event SetGasPriceSource(address indexed oldAddr, address indexed newAddr);
|
||||
event SetGasPriceSource(address oldAddr, address newAddr);
|
||||
|
||||
event SetISource(address indexed oldAddr, address indexed newAddr);
|
||||
event SetISource(address oldAddr, address newAddr);
|
||||
|
||||
event SetKSource(address indexed oldAddr, address indexed newAddr);
|
||||
event SetKSource(address oldAddr, address newAddr);
|
||||
|
||||
event SetBuy(bool allow);
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ contract DPPTrader is DPPVault {
|
||||
// ============ Events ============
|
||||
|
||||
event DODOSwap(
|
||||
address indexed fromToken,
|
||||
address indexed toToken,
|
||||
address fromToken,
|
||||
address toToken,
|
||||
uint256 fromAmount,
|
||||
uint256 toAmount,
|
||||
address trader
|
||||
@@ -122,12 +122,7 @@ contract DPPTrader is DPPVault {
|
||||
uint256 quoteAmount,
|
||||
address assetTo,
|
||||
bytes calldata data
|
||||
)
|
||||
external
|
||||
preventReentrant
|
||||
isSellAllow(assetTo)
|
||||
isBuyAllow(assetTo)
|
||||
{
|
||||
) external preventReentrant isSellAllow(assetTo) isBuyAllow(assetTo) {
|
||||
_transferBaseOut(assetTo, baseAmount);
|
||||
_transferQuoteOut(assetTo, quoteAmount);
|
||||
|
||||
@@ -264,10 +259,10 @@ contract DPPTrader is DPPVault {
|
||||
function _sync() internal {
|
||||
uint256 baseBalance = _BASE_TOKEN_.balanceOf(address(this));
|
||||
uint256 quoteBalance = _QUOTE_TOKEN_.balanceOf(address(this));
|
||||
if(baseBalance != _BASE_RESERVE_) {
|
||||
if (baseBalance != _BASE_RESERVE_) {
|
||||
_BASE_RESERVE_ = baseBalance;
|
||||
}
|
||||
if(quoteBalance != _QUOTE_RESERVE_) {
|
||||
if (quoteBalance != _QUOTE_RESERVE_) {
|
||||
_QUOTE_RESERVE_ = quoteBalance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,9 @@ import {IDODOCallee} from "../../intf/IDODOCallee.sol";
|
||||
contract DVMFunding is DVMVault {
|
||||
// ============ Events ============
|
||||
|
||||
event BuyShares(address indexed to, uint256 increaseShares, uint256 totalShares);
|
||||
event BuyShares(address to, uint256 increaseShares, uint256 totalShares);
|
||||
|
||||
event SellShares(
|
||||
address indexed payer,
|
||||
address indexed to,
|
||||
uint256 decreaseShares,
|
||||
uint256 totalShares
|
||||
);
|
||||
event SellShares(address payer, address to, uint256 decreaseShares, uint256 totalShares);
|
||||
|
||||
// ============ Buy & Sell Shares ============
|
||||
|
||||
@@ -51,7 +46,7 @@ contract DVMFunding is DVMVault {
|
||||
// 但有可能出现,reserve>0但totalSupply=0的场景
|
||||
if (totalSupply == 0) {
|
||||
shares = baseBalance.sub(10**3); // 以免出现balance很大但shares很小的情况
|
||||
_mint(address(0), 10**3);
|
||||
_mint(address(0), 10**3);
|
||||
} else if (baseReserve > 0 && quoteReserve == 0) {
|
||||
// case 2. supply when quote reserve is 0
|
||||
shares = baseInput.mul(totalSupply).div(baseReserve);
|
||||
@@ -62,7 +57,7 @@ contract DVMFunding is DVMVault {
|
||||
uint256 mintRatio = quoteInputRatio < baseInputRatio ? quoteInputRatio : baseInputRatio;
|
||||
shares = DecimalMath.mulFloor(totalSupply, mintRatio);
|
||||
}
|
||||
require(shares > 0, 'INSUFFICIENT_LIQUIDITY_MINED');
|
||||
require(shares > 0, "INSUFFICIENT_LIQUIDITY_MINED");
|
||||
_mint(to, shares);
|
||||
_sync();
|
||||
emit BuyShares(to, shares, _SHARES_[to]);
|
||||
@@ -95,7 +90,7 @@ contract DVMFunding is DVMVault {
|
||||
_transferBaseOut(to, baseAmount);
|
||||
_transferQuoteOut(to, quoteAmount);
|
||||
_sync();
|
||||
|
||||
|
||||
if (data.length > 0) {
|
||||
IDODOCallee(to).DVMSellShareCall(
|
||||
msg.sender,
|
||||
@@ -105,7 +100,7 @@ contract DVMFunding is DVMVault {
|
||||
data
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
emit SellShares(msg.sender, to, shareAmount, _SHARES_[msg.sender]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,15 +66,15 @@ contract DVMStorage is InitializableOwnable, ReentrancyGuard {
|
||||
|
||||
// ============ Events ============
|
||||
|
||||
event SetLpFeeRateModel(address indexed oldAddr, address indexed newAddr);
|
||||
event SetLpFeeRateModel(address oldAddr, address newAddr);
|
||||
|
||||
event SetMtFeeRateModel(address indexed oldAddr, address indexed newAddr);
|
||||
event SetMtFeeRateModel(address oldAddr, address newAddr);
|
||||
|
||||
event SetTradePermissionManager(address indexed oldAddr, address indexed newAddr);
|
||||
event SetTradePermissionManager(address oldAddr, address newAddr);
|
||||
|
||||
event SetMaintainer(address indexed oldAddr, address indexed newAddr);
|
||||
event SetMaintainer(address oldAddr, address newAddr);
|
||||
|
||||
event SetGasPriceSource(address indexed oldAddr, address indexed newAddr);
|
||||
event SetGasPriceSource(address oldAddr, address newAddr);
|
||||
|
||||
event SetBuy(bool allow);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ contract DVMTrader is DVMVault {
|
||||
// ============ Events ============
|
||||
|
||||
event DODOSwap(
|
||||
address indexed fromToken,
|
||||
address indexed toToken,
|
||||
address fromToken,
|
||||
address toToken,
|
||||
uint256 fromAmount,
|
||||
uint256 toAmount,
|
||||
address trader
|
||||
@@ -103,12 +103,7 @@ contract DVMTrader is DVMVault {
|
||||
uint256 quoteAmount,
|
||||
address assetTo,
|
||||
bytes calldata data
|
||||
)
|
||||
external
|
||||
preventReentrant
|
||||
isSellAllow(assetTo)
|
||||
isBuyAllow(assetTo)
|
||||
{
|
||||
) external preventReentrant isSellAllow(assetTo) isBuyAllow(assetTo) {
|
||||
_transferBaseOut(assetTo, baseAmount);
|
||||
_transferQuoteOut(assetTo, quoteAmount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user