Skip to content

Commit

Permalink
Update DigiwillToken.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
digiwills committed Jun 18, 2019
1 parent 832f0ff commit e64c0a8
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions DigiwillToken.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.21;
pragma solidity ^0.4.24;


contract Ownable {
Expand Down Expand Up @@ -80,22 +80,20 @@ library SafeMath {
}
}


interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}

contract DigiWillToken is Ownable {
contract DigiWill is Ownable {
using SafeMath for uint256;

string public name = "Digiwill"; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals = 18; //Number of decimals of the smallest unit
string public symbol = "DGW"; //An identifier: e.g. REP
string public name = "Digiwill";
uint8 public decimals = 18;
string public symbol = "DGW";
uint public totalSupply;
bool public enabledTokenTransfer = false;

mapping (address => uint256) public balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) public allowed;

mapping (address => bool) public allowedToTransfer;
Expand All @@ -108,7 +106,6 @@ contract DigiWillToken is Ownable {
// @notice Constructor to create a DigiWillToken
constructor() public {
totalSupply = 2000000000 * 10**18;
// Give the creator all initial tokens
balances[msg.sender] = totalSupply;
allowedToTransfer[msg.sender] = true;
}
Expand Down Expand Up @@ -160,7 +157,6 @@ contract DigiWillToken is Ownable {
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);

}

// @return The balance of `_owner`
Expand Down Expand Up @@ -226,14 +222,17 @@ contract DigiWillToken is Ownable {
return totalSupply;
}

// @dev This function set the lock status
function setTokenTransferLock(bool lockStatus) public onlyOwner {
enabledTokenTransfer = lockStatus;
}


// @dev This function set an address to allow transfer tokens
function setAddressTransferAllowance(address targetAddress, bool lockStatus) public onlyOwner {
allowedToTransfer[targetAddress] = lockStatus;
}


// @dev This function block an address to receive and send tokens
function setAddressBlockState(address targetAddress, bool lockStatus) public onlyOwner {
require(targetAddress != owner);
blockedAddress[targetAddress] = lockStatus;
Expand All @@ -255,5 +254,4 @@ contract DigiWillToken is Ownable {
address indexed _burner,
uint256 _amount
);

}

0 comments on commit e64c0a8

Please sign in to comment.