fix admin control && update proxy test framework

This commit is contained in:
owen05
2020-11-25 17:08:28 +08:00
parent 8a4da4b525
commit 8da583d5a8
25 changed files with 383 additions and 177 deletions

View File

@@ -17,10 +17,6 @@ import {DVMFunding} from "./DVMFunding.sol";
import {DVMVault} from "./DVMVault.sol";
contract DVM is DVMTrader, DVMFunding {
constructor() public {
_FACTORY_ = msg.sender;
}
function init(
address owner,
address maintainer,
@@ -33,7 +29,6 @@ contract DVM is DVMTrader, DVMFunding {
uint256 i,
uint256 k
) external {
require(msg.sender == _FACTORY_, 'INIT FORBIDDEN');
initOwner(owner);
_ADMIN_ = owner;
_BASE_TOKEN_ = IERC20(baseTokenAddress);

View File

@@ -47,4 +47,9 @@ contract DVMAdmin is InitializableOwnable {
function setSell(bool open) external onlyOwner {
IDVM(dvm).setSell(open);
}
// ============ Admin Version Control ============
function version() external pure returns (uint256) {
return 100; // 1.0.0
}
}

View File

@@ -21,7 +21,6 @@ import {IERC20} from "../../intf/IERC20.sol";
contract DVMStorage is InitializableOwnable, ReentrancyGuard {
using SafeMath for uint256;
address public _FACTORY_;
address public _ADMIN_;
// ============ Variables for Control ============
@@ -63,8 +62,6 @@ contract DVMStorage is InitializableOwnable, ReentrancyGuard {
uint256 public _I_;
// ============ Setting Functions ============
//TODO: owner权限问题论证
function setLpFeeRateModel(address newLpFeeRateModel) external onlyOwner {
_LP_FEE_RATE_MODEL_ = IFeeRateModel(newLpFeeRateModel);
}