annotation && v2proxy add gasreturn and trade incentive && proxyV2 incentive test

This commit is contained in:
owen05
2021-01-08 17:19:23 +08:00
parent 267ad24edc
commit 34d9ccf668
33 changed files with 537 additions and 90 deletions

View File

@@ -15,6 +15,12 @@ import {SafeMath} from "../lib/SafeMath.sol";
import {IERC20} from "../intf/IERC20.sol";
import {DecimalMath} from "../lib/DecimalMath.sol";
/**
* @title CrowdPoolingFacotry
* @author DODO Breeder
*
* @notice Create And Register CP Pools
*/
contract CrowdPoolingFactory is InitializableOwnable {
using SafeMath for uint256;
// ============ Templates ============
@@ -27,6 +33,7 @@ contract CrowdPoolingFactory is InitializableOwnable {
address public _CP_TEMPLATE_;
// ============ Settings =============
uint256 public _CAP_RATIO_ = 50;
uint256 public _FREEZE_DURATION_ = 30 days;
uint256 public _CALM_DURATION_ = 0;
@@ -43,6 +50,7 @@ contract CrowdPoolingFactory is InitializableOwnable {
mapping(address => address[]) public _USER_REGISTRY_;
// ============ modifiers ===========
modifier valueCheck(
address cpAddress,
address baseToken,
@@ -69,8 +77,6 @@ contract CrowdPoolingFactory is InitializableOwnable {
address cp
);
// ============ Functions ============
constructor(
address cloneFactory,
address cpTemplate,
@@ -87,6 +93,8 @@ contract CrowdPoolingFactory is InitializableOwnable {
_DEFAULT_PERMISSION_MANAGER_ = defaultPermissionManager;
}
// ============ Functions ============
function createCrowdPooling() external returns (address newCrowdPooling) {
newCrowdPooling = ICloneFactory(_CLONE_FACTORY_).clone(_CP_TEMPLATE_);
}
@@ -149,6 +157,7 @@ contract CrowdPoolingFactory is InitializableOwnable {
}
// ============ Owner Functions ============
function updateCPTemplate(address _newCPTemplate) external onlyOwner {
_CP_TEMPLATE_ = _newCPTemplate;
}

View File

@@ -14,6 +14,12 @@ import {IFeeRateModel} from "../lib/FeeRateModel.sol";
import {IDPP} from "../DODOPrivatePool/intf/IDPP.sol";
import {IDPPAdmin} from "../DODOPrivatePool/intf/IDPPAdmin.sol";
/**
* @title DODO PrivatePool Factory
* @author DODO Breeder
*
* @notice Create And Register DPP Pools
*/
contract DPPFactory is InitializableOwnable {
// ============ Templates ============
@@ -43,8 +49,6 @@ contract DPPFactory is InitializableOwnable {
event RemoveDPP(address dpp);
// ============ Functions ============
constructor(
address cloneFactory,
address dppTemplate,
@@ -61,6 +65,8 @@ contract DPPFactory is InitializableOwnable {
_DODO_APPROVE_ = dodoApprove;
}
// ============ Functions ============
function createDODOPrivatePool() external returns (address newPrivatePool) {
newPrivatePool = ICloneFactory(_CLONE_FACTORY_).clone(_DPP_TEMPLATE_);
}

View File

@@ -22,6 +22,13 @@ interface IDVMFactory {
) external returns (address newVendingMachine);
}
/**
* @title DODO VendingMachine Factory
* @author DODO Breeder
*
* @notice Create And Register DVM Pools
*/
contract DVMFactory is InitializableOwnable {
// ============ Templates ============

View File

@@ -12,6 +12,13 @@ import {ICloneFactory} from "../lib/CloneFactory.sol";
import {InitializableERC20} from "../external/ERC20/InitializableERC20.sol";
import {InitializableMintableERC20} from "../external/ERC20/InitializableMintableERC20.sol";
/**
* @title DODO ERC20Factory
* @author DODO Breeder
*
* @notice Help user to create erc20 token
*/
contract ERC20Factory {
// ============ Templates ============