Blockwell

Spectre.ai D-Token

ERC20

This contract is an ERC20 token.

Name Spectre.ai D-Token
Symbol SXDT
Decimals 18
Total Supply 140,270,691 SXDT

About link

SPECTRE is touted to be a broker-less financial trading platform with an embedded decentralized liquidity pool. The name SPECTRE is short for Speculative Tokenized Trading Exchange. Aiming to give control of client funds back to the clients, the dividend-token holders my be entitled to a percentage of trader’s wins or losses in the system, regardless of whether trades are performed on the system itself or other decentralized applications connected to their liquidity pool.

Stats

Public Functions 23
Event Types 6
Code Size 33,151 bytes

Approval Event

Parameters help
_owner
address help
_spender
address help
_amount
uint256 help

ClaimedTokens Event

Parameters help
_token
address help
_controller
address help
_amount
uint help

NewCloneToken Event

Parameters help
_cloneToken
address help
_snapshotBlock
uint help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_amount
uint256 help

WalletAddressesSet Event

Parameters help
_spectreTeam
address help
_managementLocked
address help
_optionPool
address help

Functions Expand All Collapse All

tokenFallback keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint help
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function tokenFallback(address _from, uint _value, bytes _data) public {
      require(walletAddressesSet);
      //First we generate tokens for user that is transferring
      generateTokens(_from, _value);
      //Then we generate Spectre team tokens
      generateSpectreTokens(_value);
    }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function transferOwnership(address newOwner) onlyOwner public {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

changeController keyboard_arrow_up

Parameters help

Name Type
_newController
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function changeController(address _newController) onlyController {
        controller = _newController;
    }

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transfer(address _to, uint256 _amount) returns (bool success) {
        require(transfersEnabled);
        return doTransfer(msg.sender, _to, _amount);
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
      require(checkLockedBalance(_from, _value));
      require(super.transferFrom(_from, _to, _value));
      return true;
    }

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 (uint256 balance) {
        return balanceOfAt(_owner, block.number);
    }

approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function approve(address _spender, uint256 _amount) returns (bool success) {
        require(transfersEnabled);

        // 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((_amount == 0) || (allowed[msg.sender][_spender] == 0));

        // Alerts the token controller of the approve function call
        if (isContract(controller)) {
            require(TokenController(controller).onApprove(msg.sender, _spender, _amount));
        }

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

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 (uint256 remaining) {
        return allowed[_owner][_spender];
    }

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_amount
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function approveAndCall(address _spender, uint256 _amount, bytes _extraData
    ) returns (bool success) {
        require(approve(_spender, _amount));

        ApproveAndCallFallBack(_spender).receiveApproval(
            msg.sender,
            _amount,
            this,
            _extraData
        );

        return true;
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function totalSupply() constant returns (uint) {
        return totalSupplyAt(block.number);
    }

balanceOfAt keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_blockNumber
uint help

Properties

Visibility help public
Mutability help constant
Source Code
    function balanceOfAt(address _owner, uint _blockNumber) constant
        returns (uint) {

        // These next few lines are used when the balance of the token is
        //  requested before a check point was ever created for this token, it
        //  requires that the `parentToken.balanceOfAt` be queried at the
        //  genesis block for that token as this contains initial balance of
        //  this token
        if ((balances[_owner].length == 0)
            || (balances[_owner][0].fromBlock > _blockNumber)) {
            if (address(parentToken) != 0) {
                return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock));
            } else {
                // Has no parent
                return 0;
            }

        // This will return the expected balance during normal situations
        } else {
            return getValueAt(balances[_owner], _blockNumber);
        }
    }

totalSupplyAt keyboard_arrow_up

Parameters help

Name Type
_blockNumber
uint help

Properties

Visibility help public
Mutability help constant
Source Code
    function totalSupplyAt(uint _blockNumber) constant returns(uint) {

        // These next few lines are used when the totalSupply of the token is
        //  requested before a check point was ever created for this token, it
        //  requires that the `parentToken.totalSupplyAt` be queried at the
        //  genesis block for this token as that contains totalSupply of this
        //  token at this block number.
        if ((totalSupplyHistory.length == 0)
            || (totalSupplyHistory[0].fromBlock > _blockNumber)) {
            if (address(parentToken) != 0) {
                return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock));
            } else {
                return 0;
            }

        // This will return the expected totalSupply during normal situations
        } else {
            return getValueAt(totalSupplyHistory, _blockNumber);
        }
    }

createCloneToken keyboard_arrow_up

Parameters help

Name Type
_cloneTokenName
string help
_cloneDecimalUnits
uint8 help
_cloneTokenSymbol
string help
_snapshotBlock
uint help
_transfersEnabled
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
    function createCloneToken(
        string _cloneTokenName,
        uint8 _cloneDecimalUnits,
        string _cloneTokenSymbol,
        uint _snapshotBlock,
        bool _transfersEnabled
        ) returns(address) {
        if (_snapshotBlock == 0) _snapshotBlock = block.number;
        MiniMeToken cloneToken = tokenFactory.createCloneToken(
            this,
            _snapshotBlock,
            _cloneTokenName,
            _cloneDecimalUnits,
            _cloneTokenSymbol,
            _transfersEnabled
            );

        cloneToken.changeController(msg.sender);

        // An event to make the token easy to find on the blockchain
        NewCloneToken(address(cloneToken), _snapshotBlock);
        return address(cloneToken);
    }

generateTokens keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function generateTokens(address _owner, uint _amount
    ) onlyController returns (bool) {
        uint curTotalSupply = totalSupply();
        require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow
        uint previousBalanceTo = balanceOf(_owner);
        require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
        updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
        updateValueAtNow(balances[_owner], previousBalanceTo + _amount);
        Transfer(0, _owner, _amount);
        return true;
    }

destroyTokens keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function destroyTokens(address _owner, uint _amount
    ) onlyController returns (bool) {
        uint curTotalSupply = totalSupply();
        require(curTotalSupply >= _amount);
        uint previousBalanceFrom = balanceOf(_owner);
        require(previousBalanceFrom >= _amount);
        updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);
        updateValueAtNow(balances[_owner], previousBalanceFrom - _amount);
        Transfer(_owner, 0, _amount);
        return true;
    }

enableTransfers keyboard_arrow_up

Parameters help

Name Type
_transfersEnabled
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
    function enableTransfers(bool _transfersEnabled) onlyController {
        transfersEnabled = _transfersEnabled;
    }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

null
Source Code
    function ()  payable {
        require(isContract(controller));
        require(TokenController(controller).proxyPayment.value(msg.value)(msg.sender));
    }

claimTokens keyboard_arrow_up

Parameters help

Name Type
_token
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function claimTokens(address _token) onlyController {
        if (_token == 0x0) {
            controller.transfer(this.balance);
            return;
        }

        MiniMeToken token = MiniMeToken(_token);
        uint balance = token.balanceOf(this);
        token.transfer(controller, balance);
        ClaimedTokens(_token, controller, balance);
    }

setTokenBurner keyboard_arrow_up

Parameters help

Name Type
_tokenBurner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setTokenBurner(address _tokenBurner) onlyOwner public {
      tokenBurner = TokenBurner(_tokenBurner);
    }

setWalletAddresses keyboard_arrow_up

Parameters help

Name Type
_spectreTeam
address help
_managementLocked
address help
_optionPool
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setWalletAddresses(address _spectreTeam, address _managementLocked, address _optionPool) onlyOwner public {
      require(!walletAddressesSet);
      require(_spectreTeam != address(0));
      require(_managementLocked != address(0));
      require(_optionPool != address(0));
      spectreTeam = _spectreTeam;
      managementLocked = _managementLocked;
      optionPool = _optionPool;
      walletAddressesSet = true;
      WalletAddressesSet(spectreTeam, managementLocked, optionPool);
    }

burn keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function burn(uint256 _amount) public {
      uint curTotalSupply = totalSupply();
      require(curTotalSupply >= _amount);
      uint previousBalanceFrom = balanceOf(msg.sender);
      require(previousBalanceFrom >= _amount);
      updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);
      updateValueAtNow(balances[msg.sender], previousBalanceFrom - _amount);
      assert(tokenBurner.burn(msg.sender, _amount));
      Transfer(msg.sender, 0, _amount);
    }

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function transfer(address _to, uint _value) returns (bool success) {
      require(checkLockedBalance(msg.sender, _value));
      require(super.transfer(_to, _value));
      return true;
    }

checkLockedBalance keyboard_arrow_up

Parameters help

Name Type
_holder
address help
_value
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
    function checkLockedBalance(address _holder, uint256 _value) public constant returns (bool success) {
      if ((_holder != managementLocked) && (_holder != optionPool)) {
        return true;
      }
      if ((_holder == managementLocked) && (getNow() > MANAGEMENT_LOCKED_PERIOD)) {
        return true;
      }
      if ((_holder == optionPool) && (getNow() > OPTION_POOL_PERIOD)) {
        return true;
      }
      return (SafeMath.sub(balanceOf(_holder), _value) >= lockedBalances[_holder]);
    }