Blockwell

FoodCoin

ERC20

This contract is an ERC20 token.

Name FoodCoin
Symbol FOOD
Decimals 8
Total Supply 400,903,136 FOOD

About

Stats

Public Functions 32
Event Types 6
Code Size 24,820 bytes

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

DescriptionPublished Event

Parameters help
_description
string help
_initiator
address help

FoodTokenEmissionEvent Event

Parameters help
initiator
address help
to
address help
value
uint256 help
result
bool help
newBalanceTo
uint256 help

FoodTransferEvent Event

Parameters help
from
address help
to
address help
value
uint256 help
initiator
address help
newBalanceFrom
uint256 help
newBalanceTo
uint256 help

FoodWithdrawEvent Event

Parameters help
initiator
address help
to
address help
withdrawOk
bool help
withdraw
uint256 help
withdrawReal
uint256 help
newBalancesValue
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

Functions Expand All Collapse All

ownerOn keyboard_arrow_up

Parameters help

Name Type
_onOwnerAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function ownerOn( address _onOwnerAddress ) external isOwner returns (bool retrnVal) {
		// Check if it's a non-zero address
		require( _onOwnerAddress != address(0) );
		// If the owner is already exist
		if ( ownerAddressNumberMap[ _onOwnerAddress ]>0 )
		{
			// If the owner is disablead, activate him again
			if ( !ownerAddressMap[ _onOwnerAddress ] )
			{
				ownerAddressMap[ _onOwnerAddress ] = true;
				retrnVal = true;
			}
			else
			{
				retrnVal = false;
			}
		}
		// If the owner is not exist
		else
		{
			ownerAddressMap[ _onOwnerAddress ] = true;
			ownerAddressNumberMap[ _onOwnerAddress ] = ownerCountInt;
			ownerListMap[ ownerCountInt ] = _onOwnerAddress;
			ownerCountInt++;
			retrnVal = true;
		}
	}

ownerOff keyboard_arrow_up

Parameters help

Name Type
_offOwnerAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function ownerOff( address _offOwnerAddress ) external isOwner returns (bool retrnVal) {
		// If owner exist and he is not 0 and active
		// 0 owner can`t be off
		if ( ownerAddressNumberMap[ _offOwnerAddress ]>0 && ownerAddressMap[ _offOwnerAddress ] )
		{
			ownerAddressMap[ _offOwnerAddress ] = false;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

contractNameUpdate keyboard_arrow_up

Parameters help

Name Type
_newName
string help
updateConfirmation
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
	function contractNameUpdate( string _newName, bool updateConfirmation ) external isOwner returns (bool retrnVal) {
		
		if ( updateConfirmation )
		{
			name = _newName;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

contractSymbolUpdate keyboard_arrow_up

Parameters help

Name Type
_newSymbol
string help
updateConfirmation
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
	function contractSymbolUpdate( string _newSymbol, bool updateConfirmation ) external isOwner returns (bool retrnVal) {

		if ( updateConfirmation )
		{
			symbol = _newSymbol;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

contractDecimalsUpdate keyboard_arrow_up

Parameters help

Name Type
_newDecimals
uint256 help
updateConfirmation
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
	function contractDecimalsUpdate( uint256 _newDecimals, bool updateConfirmation ) external isOwner returns (bool retrnVal) {
		
		if ( updateConfirmation && _newDecimals != decimals )
		{
			decimals = _newDecimals;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

emissionAddressUpdate keyboard_arrow_up

Parameters help

Name Type
_newEmissionAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function emissionAddressUpdate( address _newEmissionAddress ) external isOwner {
		emissionAddress = _newEmissionAddress;
	}

withdrawAddressUpdate keyboard_arrow_up

Parameters help

Name Type
_newWithdrawAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function withdrawAddressUpdate( address _newWithdrawAddress ) external isOwner {
		withdrawAddress = _newWithdrawAddress;
	}

specialManagerOn keyboard_arrow_up

Parameters help

Name Type
_onSpecialManagerAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function specialManagerOn( address _onSpecialManagerAddress ) external isOwner returns (bool retrnVal) {
		// Check if it's a non-zero address
		require( _onSpecialManagerAddress != address(0) );
		// If this special manager already exists
		if ( specialManagerAddressNumberMap[ _onSpecialManagerAddress ]>0 )
		{
			// If this special manager disabled, activate him again
			if ( !specialManagerAddressMap[ _onSpecialManagerAddress ] )
			{
				specialManagerAddressMap[ _onSpecialManagerAddress ] = true;
				retrnVal = true;
			}
			else
			{
				retrnVal = false;
			}
		}
		// If this special manager doesn`t exist
		else
		{
			specialManagerAddressMap[ _onSpecialManagerAddress ] = true;
			specialManagerAddressNumberMap[ _onSpecialManagerAddress ] = specialManagerCountInt;
			specialManagerListMap[ specialManagerCountInt ] = _onSpecialManagerAddress;
			specialManagerCountInt++;
			retrnVal = true;
		}
	}

specialManagerOff keyboard_arrow_up

Parameters help

Name Type
_offSpecialManagerAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function specialManagerOff( address _offSpecialManagerAddress ) external isOwner returns (bool retrnVal) {
		// If this special manager exists and he is non-zero and also active 
		// 0-number manager can`t be disactivated
		if ( specialManagerAddressNumberMap[ _offSpecialManagerAddress ]>0 && specialManagerAddressMap[ _offSpecialManagerAddress ] )
		{
			specialManagerAddressMap[ _offSpecialManagerAddress ] = false;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

managerOn keyboard_arrow_up

Parameters help

Name Type
_onManagerAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function managerOn( address _onManagerAddress ) external isOwner returns (bool retrnVal) {
		// Check if it's a non-zero address
		require( _onManagerAddress != address(0) );
		// If this special manager exists
		if ( managerAddressNumberMap[ _onManagerAddress ]>0 )
		{
			// If this special manager disabled, activate him again
			if ( !managerAddressMap[ _onManagerAddress ] )
			{
				managerAddressMap[ _onManagerAddress ] = true;
				retrnVal = true;
			}
			else
			{
				retrnVal = false;
			}
		}
		// If this special manager doesn`t exist
		else
		{
			managerAddressMap[ _onManagerAddress ] = true;
			managerAddressNumberMap[ _onManagerAddress ] = managerCountInt;
			managerListMap[ managerCountInt ] = _onManagerAddress;
			managerCountInt++;
			retrnVal = true;
		}
	}

managerOff keyboard_arrow_up

Parameters help

Name Type
_offManagerAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function managerOff( address _offManagerAddress ) external isOwner returns (bool retrnVal) {
		// if it's a non-zero manager and already exists and active
		// 0-number manager can`t be disactivated
		if ( managerAddressNumberMap[ _offManagerAddress ]>0 && managerAddressMap[ _offManagerAddress ] )
		{
			managerAddressMap[ _offManagerAddress ] = false;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

transactionsOnNowVal keyboard_arrow_up

Parameters help

Name Type
addressFrom
address help

Properties

Visibility help public
Mutability help view
Source Code
	function transactionsOnNowVal( address addressFrom ) public view returns( bool )
	{
		return ( transactionsOnForHolder[ addressFrom ]==0 && transactionsOn ) || transactionsOnForHolder[ addressFrom ]==2 ;
	}

transactionsOnForHolderUpdate keyboard_arrow_up

Parameters help

Name Type
_to
address help
_newValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
	function transactionsOnForHolderUpdate( address _to, uint256 _newValue ) external isOwner
	{
		if ( transactionsOnForHolder[ _to ] != _newValue )
		{
			transactionsOnForHolder[ _to ] = _newValue;
		}
	}

transactionsStatusUpdate keyboard_arrow_up

Parameters help

Name Type
_on
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
	function transactionsStatusUpdate( bool _on ) external isOwner
	{
		transactionsOn = _on;
	}

emissionStatusUpdate keyboard_arrow_up

Parameters help

Name Type
_on
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
	function emissionStatusUpdate( bool _on ) external isOwner
	{
		emissionOn = _on;
	}

tokenCreationCapUpdate keyboard_arrow_up

Parameters help

Name Type
_newVal
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
	function tokenCreationCapUpdate( uint256 _newVal ) external isOwner
	{
		tokenCreationCap = _newVal;
	}

balanceOfOnUpdate keyboard_arrow_up

Parameters help

Name Type
_on
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
	function balanceOfOnUpdate( bool _on ) external isOwner
	{
		balanceOfOn = _on;
	}

balanceOfOnForHolderUpdate keyboard_arrow_up

Parameters help

Name Type
_to
address help
_newValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
	function balanceOfOnForHolderUpdate( address _to, uint256 _newValue ) external isOwner
	{
		if ( balanceOfOnForHolder[ _to ] != _newValue )
		{
			balanceOfOnForHolder[ _to ] = _newValue;
		}
	}

verificationAddressOn keyboard_arrow_up

Parameters help

Name Type
_onVerificationAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function verificationAddressOn( address _onVerificationAddress ) external isOwner returns (bool retrnVal) {
		// Check if it's a non-zero address
		require( _onVerificationAddress != address(0) );
		// If this address is already exists
		if ( verificationAddressNumberMap[ _onVerificationAddress ]>0 )
		{
			// If address off, activate it again
			if ( !verificationAddressMap[ _onVerificationAddress ] )
			{
				verificationAddressMap[ _onVerificationAddress ] = true;
				retrnVal = true;
			}
			else
			{
				retrnVal = false;
			}
		}
		// If this address doesn`t exist
		else
		{
			verificationAddressMap[ _onVerificationAddress ] = true;
			verificationAddressNumberMap[ _onVerificationAddress ] = verificationCountInt;
			verificationListMap[ verificationCountInt ] = _onVerificationAddress;
			verificationCountInt++;
			retrnVal = true;
		}
	}

verificationOff keyboard_arrow_up

Parameters help

Name Type
_offVerificationAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function verificationOff( address _offVerificationAddress ) external isOwner returns (bool retrnVal) {
		// If this verification address exists and disabled
		if ( verificationAddressNumberMap[ _offVerificationAddress ]>0 && verificationAddressMap[ _offVerificationAddress ] )
		{
			verificationAddressMap[ _offVerificationAddress ] = false;
			retrnVal = true;
		}
		else
		{
			retrnVal = false;
		}
	}

descriptionUpdate keyboard_arrow_up

Parameters help

Name Type
_newVal
string help

Properties

Visibility help public
Mutability help transaction
Source Code
	function descriptionUpdate( string _newVal ) external isOwner
	{
		description = _newVal;
		DescriptionPublished( _newVal, msg.sender );
	}

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help view
Source Code
	function balanceOf( address _owner ) external view returns ( uint256 )
	{
		// If allows to display balance for all or definit holder
		if ( ( balanceOfOnForHolder[ _owner ]==0 && balanceOfOn ) || balanceOfOnForHolder[ _owner ]==2 )
		{
			return balances[ _owner ];
		}
		else
		{
			return 0;
		}
	}

balanceOfReal keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

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

allowance keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_initiator
address help

Properties

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

balancesQuantity keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
	function balancesQuantity() external view returns ( uint256 )
	{
		return balancesCountInt - 1;
	}

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
	function transfer(address _to, uint256 _value) external returns ( bool success )
	{
		// If it is transfer to verification address
		if ( verificationAddressNumberMap[ _to ]>0 )
		{
			_verification(msg.sender, _to, _value);
		}
		// Regular transfer
		else
		{
			// Call function transfer. 
			return _transfer( msg.sender, _to, _value );
		}
	}

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isTransactionsOn checks for the following:
null
Source Code
	function transferFrom(address _from, address _to, uint256 _value) external isTransactionsOn( _from ) returns ( bool success )
	{
		// Regular transfer. Not to verification address
		require( verificationAddressNumberMap[ _to ]==0 );
		// Check if the transfer initiator has permissions to move funds from the sender's account
		if ( allowed[_from][msg.sender] >= _value )
		{
			// If yes - perform transfer 
			if ( _transfer( _from, _to, _value ) )
			{
				// Decrease the total amount that initiator has permissions to access
				allowed[_from][msg.sender] = safeSubtract(allowed[_from][msg.sender], _value);
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}

approve keyboard_arrow_up

Parameters help

Name Type
_initiator
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

isTransactionsOn checks for the following:
null
Source Code
	function approve( address _initiator, uint256 _value ) external isTransactionsOn( msg.sender ) returns ( bool success )
	{
		// Grant the rights for a certain amount of tokens only
		allowed[ msg.sender ][ _initiator ] = _value;
		// Initiate the Approval event
		Approval( msg.sender, _initiator, _value );
		return true;
	}

tokenEmission keyboard_arrow_up

Parameters help

Name Type
_reciever
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
	function tokenEmission(address _reciever, uint256 _amount) external isManagerOrOwner isEmissionOn returns ( bool returnVal )
	{
		// Check if it's a non-zero address
		require( _reciever != address(0) );
		// emission in process
		returnVal = _emission( _reciever, _amount );
	}

tokenEmission5 keyboard_arrow_up

Parameters help

Name Type
_reciever_0
address help
_amount_0
uint256 help
_reciever_1
address help
_amount_1
uint256 help
_reciever_2
address help
_amount_2
uint256 help
_reciever_3
address help
_amount_3
uint256 help
_reciever_4
address help
_amount_4
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
	function tokenEmission5( address _reciever_0, uint256 _amount_0, address _reciever_1, uint256 _amount_1, address _reciever_2, uint256 _amount_2, address _reciever_3, uint256 _amount_3, address _reciever_4, uint256 _amount_4 ) external isManagerOrOwner isEmissionOn
	{
		_emission( _reciever_0, _amount_0 );
		_emission( _reciever_1, _amount_1 );
		_emission( _reciever_2, _amount_2 );
		_emission( _reciever_3, _amount_3 );
		_emission( _reciever_4, _amount_4 );
	}

withdraw keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
	function withdraw( address _to, uint256 _amount ) external isSpecialManagerOrOwner returns ( bool returnVal, uint256 withdrawValue, uint256 newBalancesValue )
	{
		// check if this is a valid account
		if ( balances[ _to ] > 0 )
		{
			// Withdraw amount
			uint256 amountTmp = _amount;
			// It is impossible to withdraw more than available on balance
			if ( balances[ _to ] < _amount )
			{
				amountTmp = balances[ _to ];
			}
			// Withdraw in process
			balances[ _to ] = safeSubtract( balances[ _to ], amountTmp );
			// Changing of current tokens amount
			totalSupply = safeSubtract( totalSupply, amountTmp );
			// Return reply
			returnVal = true;
			withdrawValue = amountTmp;
			newBalancesValue = balances[ _to ];
			FoodWithdrawEvent( msg.sender, _to, true, _amount, amountTmp, balances[ _to ] );
			// Event "Token transfer"
			Transfer( _to, withdrawAddress, amountTmp );
		}
		else
		{
			returnVal = false;
			withdrawValue = 0;
			newBalancesValue = 0;
			FoodWithdrawEvent( msg.sender, _to, false, _amount, 0, balances[ _to ] );
		}
	}

balancesAddressDescriptionUpdate keyboard_arrow_up

Parameters help

Name Type
_newDescription
string help

Properties

Visibility help public
Mutability help transaction
Source Code
	function balancesAddressDescriptionUpdate( string _newDescription ) external returns ( bool returnVal )
	{
		// If this address or contrat`s owher exists
		if ( balancesListNumberMap[ msg.sender ] > 0 || ownerAddressMap[msg.sender]==true )
		{
			balancesAddressDescription[ msg.sender ] = _newDescription;
			returnVal = true;
		}
		else
		{
			returnVal = false;
		}
	}