update v2.0 event
This commit is contained in:
@@ -34,6 +34,8 @@ contract DPPTrader is DPPVault {
|
|||||||
uint256 quoteAmount
|
uint256 quoteAmount
|
||||||
);
|
);
|
||||||
|
|
||||||
|
event RChange(PMMPricing.RState newRState);
|
||||||
|
|
||||||
// ============ Modifiers ============
|
// ============ Modifiers ============
|
||||||
|
|
||||||
modifier isBuyAllow(address trader) {
|
modifier isBuyAllow(address trader) {
|
||||||
@@ -77,6 +79,7 @@ contract DPPTrader is DPPVault {
|
|||||||
if (_RState_ != newRState) {
|
if (_RState_ != newRState) {
|
||||||
_RState_ = newRState;
|
_RState_ = newRState;
|
||||||
_BASE_TARGET_ = newBaseTarget;
|
_BASE_TARGET_ = newBaseTarget;
|
||||||
|
emit RChange(newRState);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit DODOSwap(
|
emit DODOSwap(
|
||||||
@@ -113,6 +116,7 @@ contract DPPTrader is DPPVault {
|
|||||||
if (_RState_ != newRState) {
|
if (_RState_ != newRState) {
|
||||||
_RState_ = newRState;
|
_RState_ = newRState;
|
||||||
_QUOTE_TARGET_ = newQuoteTarget;
|
_QUOTE_TARGET_ = newQuoteTarget;
|
||||||
|
emit RChange(newRState);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit DODOSwap(
|
emit DODOSwap(
|
||||||
@@ -161,6 +165,7 @@ contract DPPTrader is DPPVault {
|
|||||||
if (_RState_ != newRState) {
|
if (_RState_ != newRState) {
|
||||||
_RState_ = newRState;
|
_RState_ = newRState;
|
||||||
_QUOTE_TARGET_ = newQuoteTarget;
|
_QUOTE_TARGET_ = newQuoteTarget;
|
||||||
|
emit RChange(newRState);
|
||||||
}
|
}
|
||||||
emit DODOSwap(
|
emit DODOSwap(
|
||||||
address(_QUOTE_TOKEN_),
|
address(_QUOTE_TOKEN_),
|
||||||
@@ -187,6 +192,7 @@ contract DPPTrader is DPPVault {
|
|||||||
if (_RState_ != newRState) {
|
if (_RState_ != newRState) {
|
||||||
_RState_ = newRState;
|
_RState_ = newRState;
|
||||||
_BASE_TARGET_ = newBaseTarget;
|
_BASE_TARGET_ = newBaseTarget;
|
||||||
|
emit RChange(newRState);
|
||||||
}
|
}
|
||||||
emit DODOSwap(
|
emit DODOSwap(
|
||||||
address(_BASE_TOKEN_),
|
address(_BASE_TOKEN_),
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ import {IExternalValue} from "../../lib/ExternalValue.sol";
|
|||||||
contract DVMAdmin is InitializableOwnable {
|
contract DVMAdmin is InitializableOwnable {
|
||||||
address public _DVM_;
|
address public _DVM_;
|
||||||
|
|
||||||
// ============ Events ============
|
|
||||||
|
|
||||||
event SetLpFeeRate(uint256 newLpFeeRate);
|
|
||||||
|
|
||||||
event SetMtFeeRate(uint256 newMtFeeRate);
|
|
||||||
|
|
||||||
function init(address owner, address dvm) external {
|
function init(address owner, address dvm) external {
|
||||||
initOwner(owner);
|
initOwner(owner);
|
||||||
_DVM_ = dvm;
|
_DVM_ = dvm;
|
||||||
@@ -31,8 +25,7 @@ contract DVMAdmin is InitializableOwnable {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
function setLpFeeRateValue(uint256 newLpFeeRate) external onlyOwner {
|
function setLpFeeRateValue(uint256 newLpFeeRate) external onlyOwner {
|
||||||
IExternalValue(IDVM(_DVM_)._LP_FEE_RATE_MODEL_()).set(newLpFeeRate);
|
IDVM(_DVM_).setLpFeeRateValue(newLpFeeRate);
|
||||||
emit SetLpFeeRate(newLpFeeRate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// function setMtFeeRateModel(address newMtFeeRateModel) external onlyOwner {
|
// function setMtFeeRateModel(address newMtFeeRateModel) external onlyOwner {
|
||||||
@@ -40,8 +33,7 @@ contract DVMAdmin is InitializableOwnable {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
function setMtFeeRateValue(uint256 newMtFeeRate) external onlyOwner {
|
function setMtFeeRateValue(uint256 newMtFeeRate) external onlyOwner {
|
||||||
IExternalValue(IDVM(_DVM_)._MT_FEE_RATE_MODEL_()).set(newMtFeeRate);
|
IDVM(_DVM_).setMtFeeRateValue(newMtFeeRate);
|
||||||
emit SetMtFeeRate(newMtFeeRate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// function setTradePermissionManager(address newTradePermissionManager) external onlyOwner {
|
// function setTradePermissionManager(address newTradePermissionManager) external onlyOwner {
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ contract DVMStorage is InitializableOwnable, ReentrancyGuard {
|
|||||||
|
|
||||||
event SetSell(bool allow);
|
event SetSell(bool allow);
|
||||||
|
|
||||||
|
event SetLpFeeRate(uint256 newValue);
|
||||||
|
|
||||||
|
event SetMtFeeRate(uint256 newValue);
|
||||||
|
|
||||||
// ============ Setting Functions ============
|
// ============ Setting Functions ============
|
||||||
|
|
||||||
function setLpFeeRateModel(address newLpFeeRateModel) external onlyOwner {
|
function setLpFeeRateModel(address newLpFeeRateModel) external onlyOwner {
|
||||||
@@ -92,6 +96,16 @@ contract DVMStorage is InitializableOwnable, ReentrancyGuard {
|
|||||||
_MT_FEE_RATE_MODEL_ = IFeeRateModel(newMtFeeRateModel);
|
_MT_FEE_RATE_MODEL_ = IFeeRateModel(newMtFeeRateModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setLpFeeRateValue(uint256 newLpFeeRate) external onlyOwner {
|
||||||
|
_LP_FEE_RATE_MODEL_.setFeeRate(newLpFeeRate);
|
||||||
|
emit SetLpFeeRate(newLpFeeRate);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMtFeeRateValue(uint256 newMtFeeRate) external onlyOwner {
|
||||||
|
_MT_FEE_RATE_MODEL_.setFeeRate(newMtFeeRate);
|
||||||
|
emit SetMtFeeRate(newMtFeeRate);
|
||||||
|
}
|
||||||
|
|
||||||
function setTradePermissionManager(address newTradePermissionManager) external onlyOwner {
|
function setTradePermissionManager(address newTradePermissionManager) external onlyOwner {
|
||||||
emit SetTradePermissionManager(address(_TRADE_PERMISSION_), newTradePermissionManager);
|
emit SetTradePermissionManager(address(_TRADE_PERMISSION_), newTradePermissionManager);
|
||||||
_TRADE_PERMISSION_ = IPermissionManager(newTradePermissionManager);
|
_TRADE_PERMISSION_ = IPermissionManager(newTradePermissionManager);
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ interface IDVM {
|
|||||||
//=========== admin ==========
|
//=========== admin ==========
|
||||||
function setLpFeeRateModel(address newLpFeeRateModel) external;
|
function setLpFeeRateModel(address newLpFeeRateModel) external;
|
||||||
|
|
||||||
|
function setLpFeeRateValue(uint256 newLpFeeRate) external;
|
||||||
|
|
||||||
function setMtFeeRateModel(address newMtFeeRateModel) external;
|
function setMtFeeRateModel(address newMtFeeRateModel) external;
|
||||||
|
|
||||||
|
function setMtFeeRateValue(uint256 newMtFeeRate) external;
|
||||||
|
|
||||||
function setTradePermissionManager(address newTradePermissionManager) external;
|
function setTradePermissionManager(address newTradePermissionManager) external;
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ contract DPPFactory is InitializableOwnable {
|
|||||||
address baseToken,
|
address baseToken,
|
||||||
address quoteToken,
|
address quoteToken,
|
||||||
address creator,
|
address creator,
|
||||||
address dpp,
|
address dpp
|
||||||
uint256 lpFeeRate,
|
|
||||||
uint256 mtFeeRate
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// ============ Functions ============
|
// ============ Functions ============
|
||||||
@@ -106,7 +104,7 @@ contract DPPFactory is InitializableOwnable {
|
|||||||
|
|
||||||
_REGISTRY_[baseToken][quoteToken].push(dppAddress);
|
_REGISTRY_[baseToken][quoteToken].push(dppAddress);
|
||||||
_USER_REGISTRY_[creator].push(dppAddress);
|
_USER_REGISTRY_[creator].push(dppAddress);
|
||||||
emit NewDPP(baseToken, quoteToken, creator, dppAddress, lpFeeRate, mtFeeRate);
|
emit NewDPP(baseToken, quoteToken, creator, dppAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _createFeeRateModel(address owner, uint256 feeRate)
|
function _createFeeRateModel(address owner, uint256 feeRate)
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ contract DVMFactory is InitializableOwnable {
|
|||||||
address baseToken,
|
address baseToken,
|
||||||
address quoteToken,
|
address quoteToken,
|
||||||
address creator,
|
address creator,
|
||||||
address dvm,
|
address dvm
|
||||||
uint256 lpFeeRate,
|
|
||||||
uint256 mtFeeRate
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// ============ Functions ============
|
// ============ Functions ============
|
||||||
@@ -100,7 +98,7 @@ contract DVMFactory is InitializableOwnable {
|
|||||||
}
|
}
|
||||||
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
|
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
|
||||||
_USER_REGISTRY_[creator].push(newVendingMachine);
|
_USER_REGISTRY_[creator].push(newVendingMachine);
|
||||||
emit NewDVM(baseToken, quoteToken, creator, newVendingMachine, lpFeeRate, mtFeeRate);
|
emit NewDVM(baseToken, quoteToken, creator, newVendingMachine);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _createFeeRateModel(address owner, uint256 feeRate)
|
function _createFeeRateModel(address owner, uint256 feeRate)
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ contract UnownedDVMFactory {
|
|||||||
address baseToken,
|
address baseToken,
|
||||||
address quoteToken,
|
address quoteToken,
|
||||||
address creator,
|
address creator,
|
||||||
address dvm,
|
address dvm
|
||||||
uint256 lpFeeRate
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// ============ Functions ============
|
// ============ Functions ============
|
||||||
@@ -103,7 +102,7 @@ contract UnownedDVMFactory {
|
|||||||
}
|
}
|
||||||
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
|
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
|
||||||
_USER_REGISTRY_[creator].push(newVendingMachine);
|
_USER_REGISTRY_[creator].push(newVendingMachine);
|
||||||
emit NewUnOwnedDVM(baseToken, quoteToken, creator, newVendingMachine, lpFeeRate);
|
emit NewUnOwnedDVM(baseToken, quoteToken, creator, newVendingMachine);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _createFeeRateModel(address owner, uint256 feeRate)
|
function _createFeeRateModel(address owner, uint256 feeRate)
|
||||||
|
|||||||
Reference in New Issue
Block a user