diff --git a/contracts/impl/Admin.sol b/contracts/impl/Admin.sol index 9e0a7a1..fd89052 100644 --- a/contracts/impl/Admin.sol +++ b/contracts/impl/Admin.sol @@ -19,7 +19,16 @@ import {Storage} from "./Storage.sol"; contract Admin is Storage { // ============ Events ============ - event UpdateGasPriceLimit(uint256 newGasPriceLimit); + event UpdateGasPriceLimit(uint256 oldGasPriceLimit, uint256 newGasPriceLimit); + + event UpdateLiquidityProviderFeeRate( + uint256 oldLiquidityProviderFeeRate, + uint256 newLiquidityProviderFeeRate + ); + + event UpdateMaintainerFeeRate(uint256 oldMaintainerFeeRate, uint256 newMaintainerFeeRate); + + event UpdateK(uint256 oldK, uint256 newK); // ============ Params Setting Functions ============ @@ -36,23 +45,26 @@ contract Admin is Storage { } function setLiquidityProviderFeeRate(uint256 newLiquidityPorviderFeeRate) external onlyOwner { + emit UpdateLiquidityProviderFeeRate(_LP_FEE_RATE_, newLiquidityPorviderFeeRate); _LP_FEE_RATE_ = newLiquidityPorviderFeeRate; _checkDODOParameters(); } function setMaintainerFeeRate(uint256 newMaintainerFeeRate) external onlyOwner { + emit UpdateMaintainerFeeRate(_MT_FEE_RATE_, newMaintainerFeeRate); _MT_FEE_RATE_ = newMaintainerFeeRate; _checkDODOParameters(); } function setK(uint256 newK) external onlyOwner { + emit UpdateK(_K_, newK); _K_ = newK; _checkDODOParameters(); } function setGasPriceLimit(uint256 newGasPriceLimit) external onlySupervisorOrOwner { + emit UpdateGasPriceLimit(_GAS_PRICE_LIMIT_, newGasPriceLimit); _GAS_PRICE_LIMIT_ = newGasPriceLimit; - emit UpdateGasPriceLimit(newGasPriceLimit); } // ============ System Control Functions ============ diff --git a/contracts/impl/Trader.sol b/contracts/impl/Trader.sol index 65b3060..ecb8c1e 100644 --- a/contracts/impl/Trader.sol +++ b/contracts/impl/Trader.sol @@ -30,7 +30,9 @@ contract Trader is Storage, Pricing, Settlement { event BuyBaseToken(address indexed buyer, uint256 receiveBase, uint256 payQuote); - event MaintainerFee(bool isBaseToken, uint256 amount); + event ChargeMaintainerFeeBase(address indexed maintainer, uint256 amount); + + event ChargeMaintainerFeeQuote(address indexed maintainer, uint256 amount); // ============ Modifiers ============ @@ -82,7 +84,9 @@ contract Trader is Storage, Pricing, Settlement { _donateQuoteToken(lpFeeQuote); emit SellBaseToken(msg.sender, amount, receiveQuote); - emit MaintainerFee(false, mtFeeQuote); + if (mtFeeQuote != 0) { + emit ChargeMaintainerFeeQuote(_MAINTAINER_, mtFeeQuote); + } return receiveQuote; } @@ -123,7 +127,9 @@ contract Trader is Storage, Pricing, Settlement { _donateBaseToken(lpFeeBase); emit BuyBaseToken(msg.sender, amount, payQuote); - emit MaintainerFee(true, mtFeeBase); + if (mtFeeBase != 0) { + emit ChargeMaintainerFeeBase(_MAINTAINER_, mtFeeBase); + } return payQuote; }