Add test context

This commit is contained in:
杨新刚
2021-02-01 17:27:44 +08:00
parent 348b3e0e54
commit 368749aa03
6 changed files with 230 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ contract DODOCirculationHelper is Ownable {
function getCirculation() public view returns (uint256 circulation) {
circulation = 10**9;
//TODO circulation 需要乘以decimals吗?
for (uint256 i = 0; i < _LOCKED_CONTRACT_ADDRESS_.length; i++) {
circulation -= IERC20(_DODO_TOKEN_).balanceOf(_LOCKED_CONTRACT_ADDRESS_[i]);
}
@@ -54,7 +55,7 @@ contract DODOCirculationHelper is Ownable {
uint256 x =
DecimalMath.divCeil(
dodoCirculationAmout,
IERC20(_DODO_TOKEN_).balanceOf(address(this))
IERC20(_DODO_TOKEN_).balanceOf(address(this))// TODO 这里应该是vdodo的值吧
);
if (x <= 10**18) {

View File

@@ -0,0 +1,24 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
contract Governance is InitializableOwnable {
// ============ Storage ============
address immutable _DODO_TOKEN_;
constructor(address dodoToken) public {
_DODO_TOKEN_ = dodoToken;
}
function getLockedvDODO(address account) external pure returns (uint256 lockedvDODO) {
lockedvDODO = 0;//DOTO,0 for test
}
}

View File

@@ -90,18 +90,19 @@ contract vDODOToken is InitializableOwnable, ReentrancyGuard {
// ============ Constructor ============
constructor(
address _dodoGov,
// address _dodoGov,
address _dodoToken,
address _dodoCirculationHelper,
address _dodoApproveProxy,
string memory _name,
string memory _symbol
) public {
initOwner(msg.sender);
name = _name;
symbol = _symbol;
decimals = 18;
_DODO_APPROVE_PROXY_ = _dodoApproveProxy;
_DOOD_GOV_ = _dodoGov;
// _DOOD_GOV_ = _dodoGov;
_DODO_CIRCULATION_HELPER_ = _dodoCirculationHelper;
_DODO_TOKEN_ = _dodoToken;
lastRewardBlock = block.number;
@@ -128,6 +129,9 @@ contract vDODOToken is InitializableOwnable, ReentrancyGuard {
function updateDODOCirculationHelper(address _helper) public onlyOwner {
_DODO_CIRCULATION_HELPER_ = _helper;
}
function updateGovernance(address _governance) public onlyOwner {
_DOOD_GOV_ = _governance;
}
// ============ Functions ============