Blockwell

XSGD

ERC20

This contract is an ERC20 token.

Name XSGD
Symbol XSGD
Decimals 6
Total Supply 17,322,556 XSGD

About link

XSGD (XSGD) is a cryptocurrency and operates on the Ethereum platform. XSGD has a current supply of 46,739,090.03 with 38,294,099.450558 in circulation. The last known price of XSGD is 0.73482788 USD and is up 0.90 over the last 24 hours. It is currently trading on 7 active market(s) with $71,709.64 traded over the last 24 hours. More information can be found at https://www.xfers.com/sg/stablecoin.

Stats

Public Functions 28
Event Types 14
Code Size 28,936 bytes

Library Use

Uses SafeMath for uint256.

Events (14) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
amount
uint256 help

Blacklisted Event

Parameters help
_account
address help

BlacklisterChanged Event

Parameters help
newBlacklister
address help

Burn Event

Parameters help
burner
address help
amount
uint256 help

MasterMinterChanged Event

Parameters help
newMasterMinter
address help

Mint Event

Parameters help
minter
address help
to
address help
amount
uint256 help

MinterConfigured Event

Parameters help
minter
address help
minterAllowedAmount
uint256 help

MinterRemoved Event

Parameters help
oldMinter
address help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Pause Event

Parameters help

PauserChanged Event

Parameters help
newAddress
address help

Transfer Event

Parameters help
from
address help
to
address help
amount
uint256 help

UnBlacklisted Event

Parameters help
_account
address help

Unpause Event

Parameters help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

masterMinter Variable

address help

pauser Variable

address help

paused Variable

bool help

blacklister Variable

address help

initialized Variable

bool help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

totalSupply_ Variable

uint256 help
Internal Variable

minters Variable

mapping(address => bool) help
Internal Variable

minterAllowed Variable

mapping(address => uint256) help
Internal Variable

_owner Variable

address help
Internal Variable

blacklisted Variable

mapping(address => bool) help
Internal Variable

Functions Expand All Collapse All

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function owner() public view returns (address) {
  return _owner;
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferOwnership(address newOwner) public onlyOwner {
  require(newOwner != address(0), "transferOwnership: 0x0 invalid");
  require(newOwner != owner(), "transferOwnership: same address");
  emit OwnershipTransferred(owner(), newOwner);
  setOwner(newOwner);
}

isBlacklisted keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help view
Source Code
function isBlacklisted(address _account) public view returns (bool) {
  return blacklisted[_account];
}

blacklist keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function blacklist(address _account) public onlyBlacklister {
  require(_account != address(0), "blacklist: 0x0 invalid");
  require(!isBlacklisted(_account), "blacklist: already blacklisted");
  blacklisted[_account] = true;
  emit Blacklisted(_account);
}

unBlacklist keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function unBlacklist(address _account) public onlyBlacklister {
  require(_account != address(0), "unBlacklist: 0x0 invalid");
  require(isBlacklisted(_account), "unBlacklist: not blacklisted");
  blacklisted[_account] = false;
  emit UnBlacklisted(_account);
}

updateBlacklister keyboard_arrow_up

Parameters help

Name Type
_newBlacklister
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateBlacklister(address _newBlacklister) public onlyOwner {
  require(_newBlacklister != address(0), "updateBlacklister: 0x0 invalid");
  require(_newBlacklister != blacklister, "updateBlacklister: same address");
  blacklister = _newBlacklister;
  emit BlacklisterChanged(blacklister);
}

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function pause() public onlyPauser {
  paused = true;
  emit Pause();
}

unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unpause() public onlyPauser {
  paused = false;
  emit Unpause();
}

updatePauser keyboard_arrow_up

Parameters help

Name Type
_newPauser
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updatePauser(address _newPauser) public onlyOwner {
  require(_newPauser != address(0), "updatePauser: 0x0 invalid");
  require(_newPauser != pauser, "updatePauser: same address");
  pauser = _newPauser;
  emit PauserChanged(pauser);
}

initialize keyboard_arrow_up

Parameters help

Name Type
_name
string help
_symbol
string help
_decimals
uint8 help
_masterMinter
address help
_pauser
address help
_blacklister
address help
_owner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function initialize(
  string _name,
  string _symbol,
  uint8 _decimals,
  address _masterMinter,
  address _pauser,
  address _blacklister,
  address _owner
) public {
  require(!initialized, "already initialized!");
  require(_masterMinter != address(0), "master minter can't be 0x0");
  require(_pauser != address(0), "pauser can't be 0x0");
  require(_blacklister != address(0), "blacklister can't be 0x0");
  require(_owner != address(0), "owner can't be 0x0");

  name = _name;
  symbol = _symbol;
  decimals = _decimals;
  masterMinter = _masterMinter;
  pauser = _pauser;
  blacklister = _blacklister;
  setOwner(_owner);
  initialized = true;
}

mint keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(address _to, uint256 _amount)
  public
  whenNotPaused
  onlyMinters
  notBlacklisted(msg.sender)
  notBlacklisted(_to)
  returns (bool)
{
  require(_to != address(0), "can't mint to 0x0");
  require(_amount > 0, "amount to mint has to be > 0");

  uint256 mintingAllowedAmount = minterAllowance(msg.sender);
  require(_amount <= mintingAllowedAmount, "minter allowance too low");

  totalSupply_ = totalSupply_.add(_amount);
  balances[_to] = balances[_to].add(_amount);
  minterAllowed[msg.sender] = mintingAllowedAmount.sub(_amount);
  if (minterAllowance(msg.sender) == 0) {
    minters[msg.sender] = false;
    emit MinterRemoved(msg.sender);
  }
  emit Mint(msg.sender, _to, _amount);
  emit Transfer(0x0, _to, _amount);
  return true;
}

minterAllowance keyboard_arrow_up

Parameters help

Name Type
_minter
address help

Properties

Visibility help public
Mutability help view
Source Code
function minterAllowance(address _minter) public view returns (uint256) {
  return minterAllowed[_minter];
}

isMinter keyboard_arrow_up

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help view
Source Code
function isMinter(address _address) public view returns (bool) {
  return minters[_address];
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() public view returns (uint256) {
  return totalSupply_;
}

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address _address) public view returns (uint256) {
  return balances[_address];
}

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _amount)
  public
  whenNotPaused
  notBlacklisted(msg.sender)
  notBlacklisted(_spender)
  returns (bool)
{
  return _approve(_spender, _amount);
}

Parameters help

Name Type
_spender
address help
_addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function increaseAllowance(address _spender, uint256 _addedValue)
  public
  whenNotPaused
  notBlacklisted(msg.sender)
  notBlacklisted(_spender)
  returns (bool)
{
  uint256 updatedAllowance = allowed[msg.sender][_spender].add(_addedValue);
  return _approve(_spender, updatedAllowance);
}

Parameters help

Name Type
_spender
address help
_subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function decreaseAllowance(address _spender, uint256 _subtractedValue)
  public
  whenNotPaused
  notBlacklisted(msg.sender)
  notBlacklisted(_spender)
  returns (bool)
{
  uint256 updatedAllowance = allowed[msg.sender][_spender].sub(
    _subtractedValue
  );
  return _approve(_spender, updatedAllowance);
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address _owner, address _spender)
  public
  view
  returns (uint256)
{
  return allowed[_owner][_spender];
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount
)
  public
  whenNotPaused
  notBlacklisted(_to)
  notBlacklisted(msg.sender)
  notBlacklisted(_from)
  returns (bool)
{
  require(_to != address(0), "can't transfer to 0x0");
  require(_amount <= balances[_from], "insufficient balance");
  require(_amount <= allowed[_from][msg.sender], "token allowance is too low");

  balances[_from] = balances[_from].sub(_amount);
  balances[_to] = balances[_to].add(_amount);
  allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
  emit Transfer(_from, _to, _amount);
  return true;
}

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _amount)
  public
  whenNotPaused
  notBlacklisted(msg.sender)
  notBlacklisted(_to)
  returns (bool)
{
  require(_to != address(0), "can't transfer to 0x0");
  require(_amount <= balances[msg.sender], "insufficient balance");

  balances[msg.sender] = balances[msg.sender].sub(_amount);
  balances[_to] = balances[_to].add(_amount);
  emit Transfer(msg.sender, _to, _amount);
  return true;
}

increaseMinterAllowance keyboard_arrow_up

Parameters help

Name Type
_minter
address help
_increasedAmount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function increaseMinterAllowance(address _minter, uint256 _increasedAmount)
  public
  onlyMasterMinter
{
  require(_minter != address(0), "minter can't be 0x0");
  uint256 updatedAllowance = minterAllowance(_minter).add(_increasedAmount);
  minterAllowed[_minter] = updatedAllowance;
  minters[_minter] = true;
  emit MinterConfigured(_minter, updatedAllowance);
}

decreaseMinterAllowance keyboard_arrow_up

Parameters help

Name Type
_minter
address help
_decreasedAmount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function decreaseMinterAllowance(address _minter, uint256 _decreasedAmount)
  public
  onlyMasterMinter
{
  require(_minter != address(0), "minter can't be 0x0");
  require(minters[_minter], "not a minter");

  uint256 updatedAllowance = minterAllowance(_minter).sub(_decreasedAmount);
  minterAllowed[_minter] = updatedAllowance;
  if (minterAllowance(_minter) > 0) {
    emit MinterConfigured(_minter, updatedAllowance);
  } else {
    minters[_minter] = false;
    emit MinterRemoved(_minter);
  }
}

burn keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _amount)
  public
  whenNotPaused
  onlyMinters
  notBlacklisted(msg.sender)
{
  uint256 balance = balances[msg.sender];
  require(_amount > 0, "burn amount has to be > 0");
  require(balance >= _amount, "balance in minter is < amount to burn");

  totalSupply_ = totalSupply_.sub(_amount);
  balances[msg.sender] = balance.sub(_amount);
  emit Burn(msg.sender, _amount);
  emit Transfer(msg.sender, address(0), _amount);
}

lawEnforcementWipingBurn keyboard_arrow_up

Parameters help

Name Type
_from
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
function lawEnforcementWipingBurn(address _from)
  public
  whenNotPaused
  onlyBlacklister
{
  require(
    isBlacklisted(_from),
    "Can't wipe balances of a non blacklisted address"
  );
  uint256 balance = balances[_from];
  totalSupply_ = totalSupply_.sub(balance);
  balances[_from] = 0;
  emit Burn(_from, balance);
  emit Transfer(_from, address(0), balance);
}

updateMasterMinter keyboard_arrow_up

Parameters help

Name Type
_newMasterMinter
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function updateMasterMinter(address _newMasterMinter) public onlyOwner {
  require(_newMasterMinter != address(0), "master minter can't be 0x0");
  require(_newMasterMinter != masterMinter, "master minter is the same");
  masterMinter = _newMasterMinter;
  emit MasterMinterChanged(masterMinter);
}

tokenFallback keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help pure
Source Code
function tokenFallback(
  address _from,
  uint256 _value,
  bytes _data
) external pure {
  revert("reject EIP223 token transfers");
}

reclaimToken keyboard_arrow_up

Parameters help

Name Type
_tokenAddress
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function reclaimToken(address _tokenAddress) external onlyOwner {
  require(_tokenAddress != address(0), "token can't be 0x0");
  ERC20Recovery token = ERC20Recovery(_tokenAddress);
  uint256 balance = token.balanceOf(this);
  require(token.transfer(owner(), balance), "reclaim token failed");
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal FiatTokenV1._approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _approve(address _spender, uint256 _amount) internal returns (bool) {
  allowed[msg.sender][_spender] = _amount;
  emit Approval(msg.sender, _spender, _amount);
  return true;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  setOwner(msg.sender);
  emit OwnershipTransferred(address(0), _owner);
}

internal Ownable.setOwner keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function setOwner(address newOwner) internal {
  _owner = newOwner;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  setOwner(msg.sender);
  emit OwnershipTransferred(address(0), _owner);
}

internal Ownable.setOwner keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function setOwner(address newOwner) internal {
  _owner = newOwner;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  setOwner(msg.sender);
  emit OwnershipTransferred(address(0), _owner);
}

internal Ownable.setOwner keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function setOwner(address newOwner) internal {
  _owner = newOwner;
}