cp audit-fix && update event

This commit is contained in:
owen05
2020-12-18 01:11:33 +08:00
parent 610baa6d0e
commit 83c8bbaa85
15 changed files with 116 additions and 62 deletions

View File

@@ -35,9 +35,9 @@ contract CrowdPoolingFactory {
// ============ Events ============
event NewCP(
address indexed baseToken,
address indexed quoteToken,
address indexed creator,
address baseToken,
address quoteToken,
address creator,
address cp
);

View File

@@ -38,10 +38,12 @@ contract DPPFactory is InitializableOwnable {
// ============ Events ============
event NewDPP(
address indexed baseToken,
address indexed quoteToken,
address indexed creator,
address dpp
address baseToken,
address quoteToken,
address creator,
address dpp,
uint256 lpFeeRate,
uint256 mtFeeRate
);
// ============ Functions ============
@@ -104,7 +106,7 @@ contract DPPFactory is InitializableOwnable {
_REGISTRY_[baseToken][quoteToken].push(dppAddress);
_USER_REGISTRY_[creator].push(dppAddress);
emit NewDPP(baseToken, quoteToken, creator, dppAddress);
emit NewDPP(baseToken, quoteToken, creator, dppAddress, lpFeeRate, mtFeeRate);
}
function _createFeeRateModel(address owner, uint256 feeRate)

View File

@@ -10,7 +10,7 @@ pragma experimental ABIEncoderV2;
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
import {ICloneFactory} from "../lib/CloneFactory.sol";
import {IConstFeeRateModel} from "../lib/ConstFeeRateModel.sol";
import {IFeeRateModel} from "../lib/FeeRateModel.sol";
import {IDVM} from "../DODOVendingMachine/intf/IDVM.sol";
import {IDVMAdmin} from "../DODOVendingMachine/intf/IDVMAdmin.sol";
import {IPermissionManager} from "../lib/PermissionManager.sol";
@@ -47,10 +47,12 @@ contract DVMFactory is InitializableOwnable {
// ============ Events ============
event NewDVM(
address indexed baseToken,
address indexed quoteToken,
address indexed creator,
address dvm
address baseToken,
address quoteToken,
address creator,
address dvm,
uint256 lpFeeRate,
uint256 mtFeeRate
);
// ============ Functions ============
@@ -98,7 +100,7 @@ contract DVMFactory is InitializableOwnable {
}
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
_USER_REGISTRY_[creator].push(newVendingMachine);
emit NewDVM(baseToken, quoteToken, creator, newVendingMachine);
emit NewDVM(baseToken, quoteToken, creator, newVendingMachine, lpFeeRate, mtFeeRate);
}
function _createFeeRateModel(address owner, uint256 feeRate)
@@ -106,7 +108,7 @@ contract DVMFactory is InitializableOwnable {
returns (address feeRateModel)
{
feeRateModel = ICloneFactory(_CLONE_FACTORY_).clone(_FEE_RATE_MODEL_TEMPLATE_);
IConstFeeRateModel(feeRateModel).init(owner, feeRate);
IFeeRateModel(feeRateModel).init(owner, feeRate);
}
function _createPermissionManager(address owner) internal returns (address permissionManager) {

View File

@@ -9,10 +9,6 @@ pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {ICloneFactory} from "../lib/CloneFactory.sol";
import {IConstFeeRateModel} from "../lib/ConstFeeRateModel.sol";
import {IDVM} from "../DODOVendingMachine/intf/IDVM.sol";
import {IDVMAdmin} from "../DODOVendingMachine/intf/IDVMAdmin.sol";
import {IPermissionManager} from "../lib/PermissionManager.sol";
import {InitializableERC20} from "../external/ERC20/InitializableERC20.sol";
import {InitializableMintableERC20} from "../external/ERC20/InitializableMintableERC20.sol";
@@ -25,7 +21,7 @@ contract ERC20Factory {
// ============ Events ============
event NewERC20(address indexed erc20, address indexed creator, bool isMintable);
event NewERC20(address erc20, address creator, bool isMintable);
// ============ Functions ============

View File

@@ -10,7 +10,7 @@ pragma experimental ABIEncoderV2;
import {Ownable} from "../lib/Ownable.sol";
import {ICloneFactory} from "../lib/CloneFactory.sol";
import {IConstFeeRateModel} from "../lib/ConstFeeRateModel.sol";
import {IFeeRateModel} from "../lib/FeeRateModel.sol";
import {IDVM} from "../DODOVendingMachine/intf/IDVM.sol";
import {IDVMAdmin} from "../DODOVendingMachine/intf/IDVMAdmin.sol";
import {IPermissionManager} from "../lib/PermissionManager.sol";
@@ -49,11 +49,12 @@ contract UnownedDVMFactory {
// ============ Events ============
event NewDVM(
address indexed baseToken,
address indexed quoteToken,
address indexed creator,
address dvm
event NewUnOwnedDVM(
address baseToken,
address quoteToken,
address creator,
address dvm,
uint256 lpFeeRate
);
// ============ Functions ============
@@ -102,7 +103,7 @@ contract UnownedDVMFactory {
}
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
_USER_REGISTRY_[creator].push(newVendingMachine);
emit NewDVM(baseToken, quoteToken, creator, newVendingMachine);
emit NewUnOwnedDVM(baseToken, quoteToken, creator, newVendingMachine, lpFeeRate);
}
function _createFeeRateModel(address owner, uint256 feeRate)
@@ -110,7 +111,7 @@ contract UnownedDVMFactory {
returns (address feeRateModel)
{
feeRateModel = ICloneFactory(_CLONE_FACTORY_).clone(_FEE_RATE_MODEL_TEMPLATE_);
IConstFeeRateModel(feeRateModel).init(owner, feeRate);
IFeeRateModel(feeRateModel).init(owner, feeRate);
}
// ============ View Functions ============