Skip to content

Commit

Permalink
[enhance] emit Transfer in constructor, add more conditions, name ret…
Browse files Browse the repository at this point in the history
…urn param
  • Loading branch information
mvlchaindev committed May 30, 2018
1 parent c51e3b5 commit e0b7bf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/token/MVLToken.sol
Expand Up @@ -124,7 +124,7 @@ contract TokenLock is Ownable {
}

// calculate the amount of tokens an address can use
function getMinLockedAmount(address _addr) view public returns (uint256) {
function getMinLockedAmount(address _addr) view public returns (uint256 locked) {
uint256 i;
uint256 a;
uint256 t;
Expand Down Expand Up @@ -181,6 +181,7 @@ contract MVLToken is BurnableToken, DetailedERC20, ERC20Token, TokenLock {

// initial supply belongs to owner
balances[owner] = _totalSupply;
emit Transfer(address(0x0), msg.sender, _totalSupply);
}

// modifiers
Expand Down Expand Up @@ -216,7 +217,7 @@ contract MVLToken is BurnableToken, DetailedERC20, ERC20Token, TokenLock {
}

function canTransferBefore(address _sender) public view returns(bool) {
return _sender == owner || _sender == admin;
return _sender != address(0) && (_sender == owner || _sender == admin);
}

function canTransferIfLocked(address _sender, uint256 _value) public view returns(bool) {
Expand Down

0 comments on commit e0b7bf2

Please sign in to comment.