pragmasolidity^0.8.19;libraryAddress{/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/functionisContract(addressaccount)internalviewreturns(bool){// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256size;// solhint-disable-next-line no-inline-assembly
assembly{size:=extcodesize(account)}returnsize>0;}}abstractcontractIERC223Recipient{/**
* @dev Standard ERC-223 receiving function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/functiontokenReceived(address_from,uint_value,bytesmemory_data)publicvirtualreturns(bytes4);}/**
* @title Reference implementation of the ERC223 standard token.
*/contractERC223Token{/**
* @dev Event that is fired on successful transfer.
*/eventTransfer(addressindexedfrom,addressindexedto,uintvalue,bytesdata);stringprivate_name;stringprivate_symbol;uint8private_decimals;uint256private_totalSupply;mapping(address=>uint256)privatebalances;// List of user balances.
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/constructor(stringmemorynew_name,stringmemorynew_symbol,uint8new_decimals){_name=new_name;_symbol=new_symbol;_decimals=new_decimals;}/**
* @dev Returns the name of the token.
*/functionname()publicviewreturns(stringmemory){return_name;}/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/functionsymbol()publicviewreturns(stringmemory){return_symbol;}/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC223} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC223-balanceOf} and {IERC223-transfer}.
*/functiondecimals()publicviewreturns(uint8){return_decimals;}/**
* @dev See {IERC223-totalSupply}.
*/functiontotalSupply()publicviewreturns(uint256){return_totalSupply;}/**
* @dev See {IERC223-standard}.
*/functionstandard()publicviewreturns(stringmemory){return"223";}/**
* @dev Returns balance of the `_owner`.
*
* @param _owner The address whose balance will be returned.
* @return balance Balance of the `_owner`.
*/functionbalanceOf(address_owner)publicviewreturns(uint256){returnbalances[_owner];}/**
* @dev Transfer the specified amount of tokens to the specified address.
* Invokes the `tokenFallback` function if the recipient is a contract.
* The token transfer fails if the recipient is a contract
* but does not implement the `tokenFallback` function
* or the fallback function to receive funds.
*
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
* @param _data Transaction metadata.
*/functiontransfer(address_to,uint_value,bytescalldata_data)publicreturns(boolsuccess){// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
balances[msg.sender]=balances[msg.sender]-_value;balances[_to]=balances[_to]+_value;if(Address.isContract(_to)){IERC223Recipient(_to).tokenReceived(msg.sender,_value,_data);}emitTransfer(msg.sender,_to,_value,_data);returntrue;}/**
* @dev Transfer the specified amount of tokens to the specified address.
* This function works the same with the previous one
* but doesn't contain `_data` param.
* Added due to backwards compatibility reasons.
*
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
*/functiontransfer(address_to,uint_value)publicreturns(boolsuccess){bytesmemory_empty=hex"00000000";balances[msg.sender]=balances[msg.sender]-_value;balances[_to]=balances[_to]+_value;if(Address.isContract(_to)){IERC223Recipient(_to).tokenReceived(msg.sender,_value,_empty);}emitTransfer(msg.sender,_to,_value,_empty);returntrue;}}