Blockwell

Niobium

ERC20

This contract is an ERC20 token.

Name Niobium
Symbol NBC
Decimals 18
Total Supply 102,289,706 NBC

About link

Niobium Coin (NBC) is a cryptocurrency token and operates on the Ethereum platform. Niobium Coin has a current supply of 102,289,706.278 with 61,927,667.574 in circulation. The last known price of Niobium Coin is $0.015497 USD and is up 0.17% over the last 24 hours. It is currently trading on 5 active market(s) with $139.06 traded over the last 24 hours. More information can be found at https://niobiumcoin.io/.

Stats

Public Functions 24
Event Types 10
Code Size 47,740 bytes

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

Minted Event

Parameters help
receiver
address help
amount
uint help

MintingAgentChanged Event

Parameters help
addr
address help
state
bool help

OwnershipTransferred Event

Parameters help
_from
address help
_to
address help

ProfitDelivered Event

Parameters help
fetcher
address help
profit
uint help

ProfitLoaded Event

Parameters help
owner
address help
profit
uint help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

UpdatedTokenInformation Event

Parameters help
newName
string help
newSymbol
string help

Upgrade Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

UpgradeAgentSet Event

Parameters help
agent
address help

Functions Expand All Collapse All

safeMul keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
  function safeMul(uint a, uint b) returns (uint) {
    uint c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function safeSub(uint a, uint b) returns (uint) {
    assert(b <= a);
    return a - b;
  }

safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function safeAdd(uint a, uint b) returns (uint) {
    uint c = a + b;
    assert(c>=a);
    return c;
  }

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
  function balanceOf(address _owner) constant returns (uint balance) {
    return balances[_owner];
  }

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canTransfer checks for the following:
Source Code
  function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) {
    // Call StandardToken.transfer()
   return super.transfer(_to, _value);
  }

allowance keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

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

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canTransfer checks for the following:
Source Code
  function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) {
    // Call StandardToken.transferForm()
    return super.transferFrom(_from, _to, _value);
  }

approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

UNKNOWN VALUE must not be true
Source Code
  function approve(address _spender, uint _value) returns (bool success) {

    // To change the approve amount you first have to reduce the addresses`
    //  allowance to zero by calling `approve(_spender, 0)` if it is not
    //  already 0 to mitigate the race condition described here:
    //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
    //if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;

    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

upgrade keyboard_arrow_up

Parameters help

Name Type
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function upgrade(uint256 value) public {
    UpgradeState state = getUpgradeState();
    require((state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading));
    // if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) {
    //   // Called in a bad state
    //   throw;
    // }

    // Validate input value.
    require(value != 0);

    balances[msg.sender] = safeSub(balances[msg.sender],value);

    // Take tokens out from circulation
    totalSupply = safeSub(totalSupply,value);
    totalUpgraded = safeAdd(totalUpgraded,value);

    // Upgrade agent reissues the tokens
    upgradeAgent.upgradeFrom(msg.sender, value);
    Upgrade(msg.sender, upgradeAgent, value);
  }

setUpgradeAgent keyboard_arrow_up

Parameters help

Name Type
agent
address help

Properties

Visibility help public
Mutability help transaction
Source Code
  function setUpgradeAgent(address agent) external {
    require(canUpgrade());
    // if(!canUpgrade()) {
    //   // The token is not yet in a state that we could think upgrading
    //   throw;
    // }

    require(agent != 0x0);
    //if (agent == 0x0) throw;
    // Only a master can designate the next agent
    require(msg.sender == upgradeMaster);
    //if (msg.sender != upgradeMaster) throw;
    // Upgrade has already begun for an agent
    require(getUpgradeState() != UpgradeState.Upgrading);
    //if (getUpgradeState() == UpgradeState.Upgrading) throw;

    upgradeAgent = UpgradeAgent(agent);

    // Bad interface
    require(upgradeAgent.isUpgradeAgent());
    //if(!upgradeAgent.isUpgradeAgent()) throw;
    // Make sure that token supplies match in source and target
    require(upgradeAgent.originalSupply() == totalSupply);
    //if (upgradeAgent.originalSupply() != totalSupply) throw;

    UpgradeAgentSet(upgradeAgent);
  }

getUpgradeState keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
  function getUpgradeState() public constant returns(UpgradeState) {
    if(!canUpgrade()) return UpgradeState.NotAllowed;
    else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent;
    else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade;
    else return UpgradeState.Upgrading;
  }

setUpgradeMaster keyboard_arrow_up

Parameters help

Name Type
master
address help

Properties

Visibility help public
Mutability help transaction
Source Code
  function setUpgradeMaster(address master) public {
    require(master != 0x0);
    //if (master == 0x0) throw;
    require(msg.sender == upgradeMaster);
    //if (msg.sender != upgradeMaster) throw;
    upgradeMaster = master;
  }

canUpgrade keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
  function canUpgrade() public constant returns(bool) {
    return released && super.canUpgrade();
  }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
  function transferOwnership(address _newOwner) onlyOwner {
    newOwner = _newOwner;
  }

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
  function acceptOwnership() {
    require(msg.sender == newOwner);
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

mint keyboard_arrow_up

Parameters help

Name Type
receiver
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
  function mint(address receiver, uint amount) onlyMintAgent canMint public {
    totalSupply = safeAdd(totalSupply, amount);
    balances[receiver] = safeAdd(balances[receiver], amount);

    // This will make the mint transaction apper in EtherScan.io
    // We can remove this after there is a standardized minting event
    Transfer(0, receiver, amount);
  }

setMintAgent keyboard_arrow_up

Parameters help

Name Type
addr
address help
state
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
  function setMintAgent(address addr, bool state) onlyOwner canMint public {
    mintAgents[addr] = state;
    MintingAgentChanged(addr, state);
  }

setReleaseAgent keyboard_arrow_up

Parameters help

Name Type
addr
address help

Properties

Visibility help public
Mutability help transaction
Source Code
  function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public {

    // We don't do interface check here as we might want to a normal wallet address to act as a release agent
    releaseAgent = addr;
  }

setTransferAgent keyboard_arrow_up

Parameters help

Name Type
addr
address help
state
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
  function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public {
    transferAgents[addr] = state;
  }

releaseTokenTransfer keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
  function releaseTokenTransfer() public onlyReleaseAgent {
    mintingFinished = true;
    super.releaseTokenTransfer();
  }

setTokenInformation keyboard_arrow_up

Parameters help

Name Type
_name
string help
_symbol
string help

Properties

Visibility help public
Mutability help transaction
Source Code
  function setTokenInformation(string _name, string _symbol) onlyOwner {
    name = _name;
    symbol = _symbol;
    UpdatedTokenInformation(name, symbol);
  }

loadProfit keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
  function loadProfit() public payable onlyOwner {
    require(released);
    require(!ditributingProfit);
    require(msg.value != 0);
    loadedProfit = msg.value;
    loadedProfitAvailable = loadedProfit;
    ditributingProfit = true;
    ProfitLoaded(msg.sender, loadedProfit);
  }

fetchProfit keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
  function fetchProfit() public returns(bool) {
    require(ditributingProfit);
    require(!hasFetchedProfit[msg.sender]);
    uint NBCBalanceOfFetcher = balanceOf(msg.sender);
    require(NBCBalanceOfFetcher != 0);

    uint weiValue = safeMul(loadedProfit,NBCBalanceOfFetcher)/totalSupply;
    require(weiValue >= msg.gas);

    loadedProfitAvailable = safeSub(loadedProfitAvailable, weiValue);
    hasFetchedProfit[msg.sender] = true;

    profitDistributed = safeAdd(profitDistributed, weiValue);

      if(loadedProfitAvailable <= 0) { 
       ditributingProfit = false;
        loadedProfit = 0;
    }

    require(msg.sender.send(weiValue)); 
    // require(msg.sender.call.value(weiValue) == true);
    ProfitDelivered(msg.sender, weiValue);
    
  }

fetchUndistributedProfit keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function fetchUndistributedProfit() public onlyOwner {
    require(loadedProfitAvailable != 0);
    require(msg.sender.send(loadedProfitAvailable));
    loadedProfitAvailable = 0;
    ditributingProfit = false;
    loadedProfit = 0;
  }