{"sources":{"FiatTokenV1.sol":{"content":"// File: openzeppelin-solidity/contracts/math/SafeMath.sol\r\n\r\npragma solidity ^0.4.24;\r\n\r\n\r\n/**\r\n * @title SafeMath\r\n * @dev Math operations with safety checks that throw on error\r\n */\r\nlibrary SafeMath {\r\n\r\n  /**\r\n  * @dev Multiplies two numbers, throws on overflow.\r\n  */\r\n  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {\r\n    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the\r\n    // benefit is lost if 'b' is also tested.\r\n    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\r\n    if (a == 0) {\r\n      return 0;\r\n    }\r\n\r\n    c = a * b;\r\n    assert(c / a == b);\r\n    return c;\r\n  }\r\n\r\n  /**\r\n  * @dev Integer division of two numbers, truncating the quotient.\r\n  */\r\n  function div(uint256 a, uint256 b) internal pure returns (uint256) {\r\n    // assert(b > 0); // Solidity automatically throws when dividing by 0\r\n    // uint256 c = a / b;\r\n    // assert(a == b * c + a % b); // There is no case in which this doesn't hold\r\n    return a / b;\r\n  }\r\n\r\n  /**\r\n  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).\r\n  */\r\n  function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n    assert(b <= a);\r\n    return a - b;\r\n  }\r\n\r\n  /**\r\n  * @dev Adds two numbers, throws on overflow.\r\n  */\r\n  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {\r\n    c = a + b;\r\n    assert(c >= a);\r\n    return c;\r\n  }\r\n}\r\n\r\n// File: contracts/Ownable.sol\r\n\r\n/**\r\n* Copyright CENTRE SECZ 2018\r\n* Copyright (c) 2020 Xfers Pte. Ltd.\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy\r\n* of this software and associated documentation files (the \"Software\"), to deal\r\n* in the Software without restriction, including without limitation the rights\r\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n* copies of the Software, and to permit persons to whom the Software is furnished to\r\n* do so, subject to the following conditions:\r\n*\r\n* The above copyright notice and this permission notice shall be included in all\r\n* copies or substantial portions of the Software.\r\n*\r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\npragma solidity ^0.4.24;\r\n\r\ncontract Ownable {\r\n\r\n  address private _owner;\r\n\r\n  /**\r\n  * @dev Event to show ownership has been transferred\r\n  * @param previousOwner representing the address of the previous owner\r\n  * @param newOwner representing the address of the new owner\r\n  */\r\n  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n  /**\r\n  * @dev The constructor sets the original owner of the contract to the sender account.\r\n  */\r\n  constructor() internal {\r\n    setOwner(msg.sender);\r\n    emit OwnershipTransferred(address(0), _owner);\r\n  }\r\n\r\n  /**\r\n   * @dev Sets a new owner address\r\n   */\r\n  function setOwner(address newOwner) internal {\r\n    _owner = newOwner;\r\n  }\r\n\r\n  /**\r\n   * @dev Tells the address of the owner\r\n   * @return the address of the owner\r\n   */\r\n  function owner() public view returns (address) {\r\n    return _owner;\r\n  }\r\n\r\n  /**\r\n  * @dev Throws if called by any account other than the owner.\r\n  */\r\n  modifier onlyOwner() {\r\n    require(msg.sender == owner(), \"onlyOwner: not owner\");\r\n    _;\r\n  }\r\n\r\n  /**\r\n   * @dev Allows the current owner to transfer control of the contract to a newOwner.\r\n   * @param newOwner The address to transfer ownership to.\r\n   */\r\n  function transferOwnership(address newOwner) public onlyOwner {\r\n    require(newOwner != address(0), \"transferOwnership: 0x0 invalid\");\r\n    require(newOwner != owner(), \"transferOwnership: same address\");\r\n    emit OwnershipTransferred(owner(), newOwner);\r\n    setOwner(newOwner);\r\n  }\r\n}\r\n\r\n// File: contracts/Blacklistable.sol\r\n\r\n/**\r\n* Copyright CENTRE SECZ 2018\r\n* Copyright (c) 2020 Xfers Pte. Ltd.\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy\r\n* of this software and associated documentation files (the \"Software\"), to deal\r\n* in the Software without restriction, including without limitation the rights\r\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n* copies of the Software, and to permit persons to whom the Software is furnished to\r\n* do so, subject to the following conditions:\r\n*\r\n* The above copyright notice and this permission notice shall be included in all\r\n* copies or substantial portions of the Software.\r\n*\r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\npragma solidity ^0.4.24;\r\n\r\n\r\n/**\r\n * @title Blacklistable Token\r\n * @dev Allows accounts to be blacklisted by a \"blacklister\" role\r\n*/\r\ncontract Blacklistable is Ownable {\r\n\r\n    address public blacklister;\r\n    mapping(address => bool) internal blacklisted;\r\n\r\n    event Blacklisted(address indexed _account);\r\n    event UnBlacklisted(address indexed _account);\r\n    event BlacklisterChanged(address indexed newBlacklister);\r\n\r\n    /**\r\n     * @dev Throws if called by any account other than the blacklister\r\n    */\r\n    modifier onlyBlacklister() {\r\n        require(msg.sender == blacklister, \"not blacklister\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Throws if argument account is blacklisted\r\n     * @param _account The address to check\r\n    */\r\n    modifier notBlacklisted(address _account) {\r\n        require(blacklisted[_account] == false, \"notBlacklisted: is blacklisted\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Checks if account is blacklisted\r\n     * @param _account The address to check\r\n    */\r\n    function isBlacklisted(address _account) public view returns (bool) {\r\n        return blacklisted[_account];\r\n    }\r\n\r\n    /**\r\n     * @dev Adds account to blacklist\r\n     * @param _account The address to blacklist\r\n    */\r\n    function blacklist(address _account) public onlyBlacklister {\r\n        require(_account != address(0), \"blacklist: 0x0 invalid\");\r\n        require(!isBlacklisted(_account), \"blacklist: already blacklisted\");\r\n        blacklisted[_account] = true;\r\n        emit Blacklisted(_account);\r\n    }\r\n\r\n    /**\r\n     * @dev Removes account from blacklist\r\n     * @param _account The address to remove from the blacklist\r\n    */\r\n    function unBlacklist(address _account) public onlyBlacklister {\r\n        require(_account != address(0), \"unBlacklist: 0x0 invalid\");\r\n        require(isBlacklisted(_account), \"unBlacklist: not blacklisted\");\r\n        blacklisted[_account] = false;\r\n        emit UnBlacklisted(_account);\r\n    }\r\n\r\n    function updateBlacklister(address _newBlacklister) public onlyOwner {\r\n        require(_newBlacklister != address(0), \"updateBlacklister: 0x0 invalid\");\r\n        require(_newBlacklister != blacklister, \"updateBlacklister: same address\");\r\n        blacklister = _newBlacklister;\r\n        emit BlacklisterChanged(blacklister);\r\n    }\r\n}\r\n\r\n// File: contracts/Pausable.sol\r\n\r\n/**\r\n* Copyright CENTRE SECZ 2018\r\n* Copyright (c) 2020 Xfers Pte. Ltd.\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy\r\n* of this software and associated documentation files (the \"Software\"), to deal\r\n* in the Software without restriction, including without limitation the rights\r\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n* copies of the Software, and to permit persons to whom the Software is furnished to\r\n* do so, subject to the following conditions:\r\n*\r\n* The above copyright notice and this permission notice shall be included in all\r\n* copies or substantial portions of the Software.\r\n*\r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\npragma solidity ^0.4.24;\r\n\r\n\r\n/**\r\n * @title Pausable\r\n * @dev Base contract which allows children to implement an emergency stop mechanism.\r\n * Based on openzeppelin tag v1.10.0 commit: feb665136c0dae9912e08397c1a21c4af3651ef3\r\n * Modifications:\r\n * 1) Added pauser role, switched pause/unpause to be onlyPauser (6/14/2018)\r\n * 2) Removed whenNotPause/whenPaused from pause/unpause (6/14/2018)\r\n * 3) Removed whenPaused (6/14/2018)\r\n * 4) Switches ownable library to use zeppelinos (7/12/18)\r\n * 5) Remove constructor (7/13/18)\r\n */\r\ncontract Pausable is Ownable {\r\n  event Pause();\r\n  event Unpause();\r\n  event PauserChanged(address indexed newAddress);\r\n\r\n\r\n  address public pauser;\r\n  bool public paused = false;\r\n\r\n  /**\r\n   * @dev Modifier to make a function callable only when the contract is not paused.\r\n   */\r\n  modifier whenNotPaused() {\r\n    require(!paused, \"whenNotPaused: contract paused\");\r\n    _;\r\n  }\r\n\r\n  /**\r\n   * @dev throws if called by any account other than the pauser\r\n   */\r\n  modifier onlyPauser() {\r\n    require(msg.sender == pauser, \"pauser only\");\r\n    _;\r\n  }\r\n\r\n  /**\r\n   * @dev called by the owner to pause, triggers stopped state\r\n   */\r\n  function pause() public onlyPauser {\r\n    paused = true;\r\n    emit Pause();\r\n  }\r\n\r\n  /**\r\n   * @dev called by the owner to unpause, returns to normal state\r\n   */\r\n  function unpause() public onlyPauser {\r\n    paused = false;\r\n    emit Unpause();\r\n  }\r\n\r\n  /**\r\n   * @dev update the pauser role\r\n   */\r\n  function updatePauser(address _newPauser) public onlyOwner {\r\n    require(_newPauser != address(0), \"updatePauser: 0x0 invalid\");\r\n    require(_newPauser != pauser, \"updatePauser: same address\");\r\n    pauser = _newPauser;\r\n    emit PauserChanged(pauser);\r\n  }\r\n\r\n}\r\n\r\n// File: contracts/ERC20Recovery.sol\r\n\r\n/**\r\n* Copyright (c) 2020 Xfers Pte. Ltd.\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy\r\n* of this software and associated documentation files (the \"Software\"), to deal\r\n* in the Software without restriction, including without limitation the rights\r\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n* copies of the Software, and to permit persons to whom the Software is furnished to\r\n* do so, subject to the following conditions:\r\n*\r\n* The above copyright notice and this permission notice shall be included in all\r\n* copies or substantial portions of the Software.\r\n*\r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\npragma solidity ^0.4.24;\r\n\r\n/**\r\n * @title ERC20Recovery\r\n * @dev Minimal version of ERC20 interface required to allow ERC20 locked tokens recovery\r\n */\r\n\r\ncontract ERC20Recovery {\r\n  function balanceOf(address account) public view returns (uint256);\r\n  function transfer(address to, uint256 value) public returns (bool);\r\n}\r\n\r\n// File: contracts/FiatTokenV1.sol\r\n\r\n/**\r\n* Copyright CENTRE SECZ 2018\r\n* Copyright (c) 2020 Xfers Pte. Ltd.\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy\r\n* of this software and associated documentation files (the \"Software\"), to deal\r\n* in the Software without restriction, including without limitation the rights\r\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n* copies of the Software, and to permit persons to whom the Software is furnished to\r\n* do so, subject to the following conditions:\r\n*\r\n* The above copyright notice and this permission notice shall be included in all\r\n* copies or substantial portions of the Software.\r\n*\r\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\n* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n*/\r\n\r\npragma solidity ^0.4.24;\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @title FiatToken\r\n * @dev Token backed by fiat reserves\r\n */\r\ncontract FiatTokenV1 is Ownable, Pausable, Blacklistable {\r\n    using SafeMath for uint256;\r\n\r\n    string public name;\r\n    string public symbol;\r\n    uint8 public decimals;\r\n    address public masterMinter;\r\n\r\n    bool internal initialized;\r\n    mapping(address => uint256) internal balances;\r\n    mapping(address => mapping(address => uint256)) internal allowed;\r\n    uint256 internal totalSupply_ = 0;\r\n    mapping(address => bool) internal minters;\r\n    mapping(address => uint256) internal minterAllowed;\r\n\r\n    event Mint(address indexed minter, address indexed to, uint256 amount);\r\n    event Transfer(address indexed from, address indexed to, uint256 amount);\r\n    event Burn(address indexed burner, uint256 amount);\r\n    event Approval(\r\n        address indexed owner,\r\n        address indexed spender,\r\n        uint256 amount\r\n    );\r\n    event MinterConfigured(address indexed minter, uint256 minterAllowedAmount);\r\n    event MinterRemoved(address indexed oldMinter);\r\n    event MasterMinterChanged(address indexed newMasterMinter);\r\n\r\n    /**\r\n     * @dev Throws if called by any account other than a minter\r\n    */\r\n    modifier onlyMinters() {\r\n        require(minters[msg.sender] == true, \"minters only\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Throws if called by any account other than the masterMinter\r\n    */\r\n    modifier onlyMasterMinter() {\r\n        require(msg.sender == masterMinter, \"master minter only\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to initialise contract\r\n     * @param _name string Token name\r\n     * @param _symbol string Token symbol\r\n     * @param _decimals uint8 Token decimals\r\n     * @param _masterMinter address Address of the master minter\r\n     * @param _pauser address Address of the pauser\r\n     * @param _blacklister address Address of the blacklister\r\n     * @param _owner address Address of the owner\r\n    */\r\n    function initialize(\r\n        string _name,\r\n        string _symbol,\r\n        uint8 _decimals,\r\n        address _masterMinter,\r\n        address _pauser,\r\n        address _blacklister,\r\n        address _owner\r\n    ) public {\r\n        require(!initialized, \"already initialized!\");\r\n        require(_masterMinter != address(0), \"master minter can't be 0x0\");\r\n        require(_pauser != address(0), \"pauser can't be 0x0\");\r\n        require(_blacklister != address(0), \"blacklister can't be 0x0\");\r\n        require(_owner != address(0), \"owner can't be 0x0\");\r\n\r\n        name = _name;\r\n        symbol = _symbol;\r\n        decimals = _decimals;\r\n        masterMinter = _masterMinter;\r\n        pauser = _pauser;\r\n        blacklister = _blacklister;\r\n        setOwner(_owner);\r\n        initialized = true;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to mint tokens\r\n     * Validates that the contract is not paused\r\n     * only minters can call this function\r\n     * minter and the address that will received the minted tokens are not blacklisted\r\n     * @param _to address The address that will receive the minted tokens.\r\n     * @param _amount uint256 The amount of tokens to mint. Must be less than or equal to the minterAllowance of the caller.\r\n     * @return True if the operation was successful.\r\n    */\r\n    function mint(address _to, uint256 _amount)\r\n        public\r\n        whenNotPaused\r\n        onlyMinters\r\n        notBlacklisted(msg.sender)\r\n        notBlacklisted(_to)\r\n        returns (bool)\r\n    {\r\n        require(_to != address(0), \"can't mint to 0x0\");\r\n        require(_amount > 0, \"amount to mint has to be > 0\");\r\n\r\n        uint256 mintingAllowedAmount = minterAllowance(msg.sender);\r\n        require(_amount <= mintingAllowedAmount, \"minter allowance too low\");\r\n\r\n        totalSupply_ = totalSupply_.add(_amount);\r\n        balances[_to] = balances[_to].add(_amount);\r\n        minterAllowed[msg.sender] = mintingAllowedAmount.sub(_amount);\r\n        if (minterAllowance(msg.sender) == 0) {\r\n            minters[msg.sender] = false;\r\n            emit MinterRemoved(msg.sender);\r\n        }\r\n        emit Mint(msg.sender, _to, _amount);\r\n        emit Transfer(0x0, _to, _amount);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to get minter allowance of an address\r\n     * @param _minter address The address of check minter allowance of\r\n     * @return The minter allowance of the address\r\n    */\r\n    function minterAllowance(address _minter) public view returns (uint256) {\r\n        return minterAllowed[_minter];\r\n    }\r\n\r\n    /**\r\n     * @dev Function to check if an address is a minter\r\n     * @param _address The address to check\r\n     * @return A boolean value to indicates if an address is a minter\r\n    */\r\n    function isMinter(address _address) public view returns (bool) {\r\n        return minters[_address];\r\n    }\r\n\r\n    /**\r\n     * @dev Function to get total supply of token\r\n     * @return The total supply of the token\r\n    */\r\n    function totalSupply() public view returns (uint256) {\r\n        return totalSupply_;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to get token balance of an address\r\n     * @param _address address The account\r\n     * @return The token balance of an address\r\n    */\r\n    function balanceOf(address _address) public view returns (uint256) {\r\n        return balances[_address];\r\n    }\r\n\r\n    /**\r\n     * @dev Function to approves a spender to spend up to a certain amount of tokens\r\n     * Validates that the contract is not paused\r\n     * the owner and spender are not blacklisted\r\n     * Avoid calling this function if possible (https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729)\r\n     * @param _spender address The Address of the spender\r\n     * @param _amount uint256 The amount of tokens that the spender is approved to spend\r\n     * @return True if the operation was successful.\r\n    */\r\n    function approve(address _spender, uint256 _amount)\r\n        public\r\n        whenNotPaused\r\n        notBlacklisted(msg.sender)\r\n        notBlacklisted(_spender)\r\n        returns (bool)\r\n    {\r\n        return _approve(_spender, _amount);\r\n    }\r\n\r\n    /**\r\n     * @dev Alternative function to the approve function\r\n     * Increases the allowance of the spender\r\n     * Validates that the contract is not paused\r\n     * the owner and spender are not blacklisted\r\n     * @param _spender address The Address of the spender\r\n     * @param _addedValue uint256 The amount of tokens to be added to a spender's allowance\r\n     * @return True if the operation was successful.\r\n    */\r\n    function increaseAllowance(address _spender, uint256 _addedValue)\r\n        public\r\n        whenNotPaused\r\n        notBlacklisted(msg.sender)\r\n        notBlacklisted(_spender)\r\n        returns (bool)\r\n    {\r\n        uint256 updatedAllowance = allowed[msg.sender][_spender].add(\r\n            _addedValue\r\n        );\r\n        return _approve(_spender, updatedAllowance);\r\n    }\r\n\r\n    /**\r\n     * @dev Alternative function to the approve function\r\n     * Decreases the allowance of the spender\r\n     * Validates that the contract is not paused\r\n     * the owner and spender are not blacklisted\r\n     * @param _spender address The Address of the spender\r\n     * @param _subtractedValue uint256 The amount of tokens to be subtracted from a spender's allowance\r\n     * @return True if the operation was successful.\r\n    */\r\n    function decreaseAllowance(address _spender, uint256 _subtractedValue)\r\n        public\r\n        whenNotPaused\r\n        notBlacklisted(msg.sender)\r\n        notBlacklisted(_spender)\r\n        returns (bool)\r\n    {\r\n        uint256 updatedAllowance = allowed[msg.sender][_spender].sub(\r\n            _subtractedValue\r\n        );\r\n        return _approve(_spender, updatedAllowance);\r\n    }\r\n\r\n    /**\r\n     * @dev Function to approves a spender to spend up to a certain amount of tokens\r\n     * @param _spender address The Address of the spender\r\n     * @param _amount uint256 The amount of tokens that the spender is approved to spend\r\n    */\r\n    function _approve(address _spender, uint256 _amount)\r\n        internal\r\n        returns (bool)\r\n    {\r\n        allowed[msg.sender][_spender] = _amount;\r\n        emit Approval(msg.sender, _spender, _amount);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to get token allowance given to a spender by the owner\r\n     * @param _owner address The address of the owner\r\n     * @param _spender address The address of the spender\r\n     * @return The number of tokens that a spender can spend on behalf of the owner\r\n    */\r\n    function allowance(address _owner, address _spender)\r\n        public\r\n        view\r\n        returns (uint256)\r\n    {\r\n        return allowed[_owner][_spender];\r\n    }\r\n\r\n    /**\r\n     * @dev Function to transfer tokens from one address to another.\r\n     * Validates that the contract is not paused\r\n     * the caller, sender and receiver of the tokens are not blacklisted\r\n     * @param _from address The address which you want to send tokens from\r\n     * @param _to address The address which you want to transfer to\r\n     * @param _amount uint256 the amount of tokens to be transferred\r\n     * @return True if the operation was successful.\r\n    */\r\n    function transferFrom(address _from, address _to, uint256 _amount)\r\n        public\r\n        whenNotPaused\r\n        notBlacklisted(_to)\r\n        notBlacklisted(msg.sender)\r\n        notBlacklisted(_from)\r\n        returns (bool)\r\n    {\r\n        require(_to != address(0), \"can't transfer to 0x0\");\r\n        require(_amount <= balances[_from], \"insufficient balance\");\r\n        require(\r\n            _amount <= allowed[_from][msg.sender],\r\n            \"token allowance is too low\"\r\n        );\r\n\r\n        balances[_from] = balances[_from].sub(_amount);\r\n        balances[_to] = balances[_to].add(_amount);\r\n        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);\r\n        emit Transfer(_from, _to, _amount);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to transfer token to a specified address\r\n     * Validates that the contract is not paused\r\n     * The sender and receiver are not blacklisted\r\n     * @param _to The address to transfer to.\r\n     * @param _amount The amount of tokens to be transferred.\r\n     * @return True if the operation is successful\r\n    */\r\n    function transfer(address _to, uint256 _amount)\r\n        public\r\n        whenNotPaused\r\n        notBlacklisted(msg.sender)\r\n        notBlacklisted(_to)\r\n        returns (bool)\r\n    {\r\n        require(_to != address(0), \"can't transfer to 0x0\");\r\n        require(_amount <= balances[msg.sender], \"insufficient balance\");\r\n\r\n        balances[msg.sender] = balances[msg.sender].sub(_amount);\r\n        balances[_to] = balances[_to].add(_amount);\r\n        emit Transfer(msg.sender, _to, _amount);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n    * @dev Function to increase minter allowance of a minter\r\n    * Validates that only the master minter can call this function\r\n    * @param _minter address The address of the minter\r\n    * @param _increasedAmount uint256 The amount of to be added to a minter's allowance\r\n    */\r\n    function increaseMinterAllowance(address _minter, uint256 _increasedAmount)\r\n        public\r\n        onlyMasterMinter\r\n    {\r\n        require(_minter != address(0), \"minter can't be 0x0\");\r\n        uint256 updatedAllowance = minterAllowance(_minter).add(\r\n            _increasedAmount\r\n        );\r\n        minterAllowed[_minter] = updatedAllowance;\r\n        minters[_minter] = true;\r\n        emit MinterConfigured(_minter, updatedAllowance);\r\n    }\r\n\r\n    /**\r\n    * @dev Function to decrease minter allowance of a minter\r\n    * Validates that only the master minter can call this function\r\n    * @param _minter address The address of the minter\r\n    * @param _decreasedAmount uint256 The amount of allowance to be subtracted from a minter's allowance\r\n    */\r\n    function decreaseMinterAllowance(address _minter, uint256 _decreasedAmount)\r\n        public\r\n        onlyMasterMinter\r\n    {\r\n        require(_minter != address(0), \"minter can't be 0x0\");\r\n        require(minters[_minter], \"not a minter\");\r\n\r\n        uint256 updatedAllowance = minterAllowance(_minter).sub(\r\n            _decreasedAmount\r\n        );\r\n        minterAllowed[_minter] = updatedAllowance;\r\n        if (minterAllowance(_minter) > 0) {\r\n            emit MinterConfigured(_minter, updatedAllowance);\r\n        } else {\r\n            minters[_minter] = false;\r\n            emit MinterRemoved(_minter);\r\n\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Function to allow a minter to burn some of its own tokens\r\n     * Validates that the contract is not paused\r\n     * caller is a minter and is not blacklisted\r\n     * amount is less than or equal to the minter's mint allowance balance\r\n     * @param _amount uint256 the amount of tokens to be burned\r\n    */\r\n    function burn(uint256 _amount)\r\n        public\r\n        whenNotPaused\r\n        onlyMinters\r\n        notBlacklisted(msg.sender)\r\n    {\r\n        uint256 balance = balances[msg.sender];\r\n        require(_amount > 0, \"burn amount has to be > 0\");\r\n        require(balance >= _amount, \"balance in minter is < amount to burn\");\r\n\r\n        totalSupply_ = totalSupply_.sub(_amount);\r\n        balances[msg.sender] = balance.sub(_amount);\r\n        emit Burn(msg.sender, _amount);\r\n        emit Transfer(msg.sender, address(0), _amount);\r\n    }\r\n\r\n    /**\r\n     * @dev Function to allow the blacklister to burn entire balance of tokens from a blacklisted address\r\n     * Validates that contract is not paused\r\n     * caller is the blacklister\r\n     * address to burn tokens from is a blacklisted address\r\n     * @param _from address the address to burn tokens from\r\n    */\r\n    function lawEnforcementWipingBurn(address _from)\r\n        public\r\n        whenNotPaused\r\n        onlyBlacklister\r\n    {\r\n        require(\r\n            isBlacklisted(_from),\r\n            \"Can't wipe balances of a non blacklisted address\"\r\n        );\r\n        uint256 balance = balances[_from];\r\n        totalSupply_ = totalSupply_.sub(balance);\r\n        balances[_from] = 0;\r\n        emit Burn(_from, balance);\r\n        emit Transfer(_from, address(0), balance);\r\n    }\r\n\r\n    /**\r\n     * @dev Function to update the masterMinter role\r\n     * Validates that the caller is the owner\r\n     */\r\n    function updateMasterMinter(address _newMasterMinter) public onlyOwner {\r\n        require(_newMasterMinter != address(0), \"master minter can't be 0x0\");\r\n        require(_newMasterMinter != masterMinter, \"master minter is the same\");\r\n        masterMinter = _newMasterMinter;\r\n        emit MasterMinterChanged(masterMinter);\r\n    }\r\n\r\n    /**\r\n      * @dev Function to reject all EIP223 compatible tokens\r\n      * @param _from address The address that is transferring the tokens\r\n      * @param _value uint256 the amount of the specified token\r\n      * @param _data bytes The data passed from the caller\r\n      */\r\n    function tokenFallback(address _from, uint256 _value, bytes _data)\r\n        external\r\n        pure\r\n    {\r\n        revert(\"reject EIP223 token transfers\");\r\n    }\r\n\r\n    /**\r\n     * @dev Function to reclaim all ERC20Recovery compatible tokens\r\n     * Validates that the caller is the owner\r\n     * @param _tokenAddress address The address of the token contract\r\n     */\r\n    function reclaimToken(address _tokenAddress) external onlyOwner {\r\n        require(_tokenAddress != address(0), \"token can't be 0x0\");\r\n        ERC20Recovery token = ERC20Recovery(_tokenAddress);\r\n        uint256 balance = token.balanceOf(this);\r\n        require(token.transfer(owner(), balance), \"reclaim token failed\");\r\n    }\r\n}"}},"matchId":"5459282","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2024-10-02T12:09:16Z","match":"match","chainId":"1","address":"0x78fe13802Ba4E487F69c87850eA557CfC292b472"}