add deploy script && update vdodo

This commit is contained in:
owen05
2021-02-04 17:21:18 +08:00
parent 4ebe28fb06
commit 7287fde9b3
9 changed files with 160 additions and 33 deletions

View File

@@ -72,7 +72,7 @@ contract DODOBscToken is InitializableOwnable {
return allowed[owner][spender];
}
function redeem(uint256 amount, uint256 value, address redeemToEthAccount) external {
function redeem(uint256 value, address redeemToEthAccount) external {
require(balances[msg.sender] >= value, "DODOBscToken: NOT_ENOUGH");
balances[msg.sender] = balances[msg.sender].sub(value);
totalSupply = totalSupply.sub(value);

View File

@@ -30,9 +30,9 @@ contract vDODOToken is InitializableOwnable {
// ============ Storage(ERC20) ============
string public name;
string public symbol;
uint8 public decimals;
string public name = "vDODO Token";
string public symbol = "vDODO";
uint8 public decimals = 18;
uint256 public totalSupply;
mapping(address => mapping(address => uint256)) internal _ALLOWED_;
@@ -91,18 +91,11 @@ contract vDODOToken is InitializableOwnable {
constructor(
address dodoGov,
address dodoToken,
address dodoCirculationHelper,
address dodoApproveProxy,
string memory _name,
string memory _symbol
address dodoApproveProxy
) public {
name = _name;
symbol = _symbol;
decimals = 18;
_DODO_APPROVE_PROXY_ = dodoApproveProxy;
_DOOD_GOV_ = dodoGov;
_DODO_CIRCULATION_HELPER_ = dodoCirculationHelper;
_DODO_TOKEN_ = dodoToken;
_DODO_APPROVE_PROXY_ = dodoApproveProxy;
lastRewardBlock = uint128(block.number);
}
@@ -216,8 +209,12 @@ contract vDODOToken is InitializableOwnable {
}
function availableBalanceOf(address account) public view returns (uint256 balance) {
uint256 lockedBalance = IGovernance(_DOOD_GOV_).getLockedvDODO(account);
balance = balanceOf(account).sub(lockedBalance);
if(_DOOD_GOV_ == address(0)){
balance = balanceOf(account);
}else {
uint256 lockedBalance = IGovernance(_DOOD_GOV_).getLockedvDODO(account);
balance = balanceOf(account).sub(lockedBalance);
}
}
function transfer(address to, uint256 amount) public returns (bool) {