Blockwell

Linker Coin

ERC20

This contract is an ERC20 token.

Name Linker Coin
Symbol LNC
Decimals 18
Total Supply 299,998,766 LNC

About link description

Linker Coin (LNC) is a cryptocurrency and operates on the Ethereum platform. Linker Coin has a current supply of 500,000,000 with 112,776,150.004 in circulation. The last known price of Linker Coin is 0.04347497 USD and is up 4.07 over the last 24 hours. It is currently trading on 2 active market(s) with $2,616.98 traded over the last 24 hours. More information can be found at https://www.linkercoin.com/en.

Stats

Public Functions 25
Event Types 11
Code Size 13,962 bytes

Events (11) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Burn Event

Parameters help
from
address help
value
uint256 help

FrozenFunds Event

Parameters help
target
address help
frozen
bool help

SetBurnStart Event

Parameters help
_isBurnStart
bool help

SetEdgePerPosition Event

Parameters help
_edgePerPosition
uint256 help

SetLPTargetPostion Event

Parameters help
_lpTargetPositionn
uint256 help

SetLpFee Event

Parameters help
_lpFeeBp
uint256 help

SetLpIsStart Event

Parameters help
_isLpStart
bool help

SetLpMaxVolume Event

Parameters help
_lpMaxVolume
uint256 help

SetPrices Event

Parameters help
_lpBidPrice
uint256 help
_lpAskPrice
uint256 help
_lpBidVolume
uint256 help
_lpAskVolume
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

decimalOfPrice Constant

uint8 help
10

multiplierOfPrice Constant

uint256 help
10000000000

multiplier Constant

uint256 help
1000000000000000000

symbol Constant

string help
LNC

name Constant

string help
Linker Coin

decimals Constant

uint8 help
18

lpAskPrice Variable

uint256 help

lpBidPrice Variable

uint256 help

lpAskVolume Variable

uint256 help

lpBidVolume Variable

uint256 help

lpMaxVolume Variable

uint256 help

edgePerPosition Variable

uint256 help

lpTargetPosition Variable

uint256 help

lpFeeBp Variable

uint256 help

isLpStart Variable

bool help

isBurn Variable

bool help

owner Variable

address help

frozenAccount Variable

mapping(address => bool) help

_totalSupply Variable

uint256 help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function totalSupply() public constant returns (uint256 supply) {
  supply = _totalSupply;
}

Parameters help

Name Type
_owner
address help

Properties

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

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) public returns (bool success) {
  if (
    _to != 0x0 && // Prevent transfer to 0x0 address.
    IsFreezedAccount(msg.sender) == false &&
    balances[msg.sender] >= _value &&
    _value > 0 &&
    balances[_to] + _value > balances[_to]
  ) {
    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    Transfer(msg.sender, _to, _value);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public returns (bool success) {
  if (
    _to != 0x0 && // Prevent transfer to 0x0 address.
    IsFreezedAccount(_from) == false &&
    balances[_from] >= _value &&
    allowed[_from][msg.sender] >= _value &&
    _value > 0 &&
    balances[_to] + _value > balances[_to]
  ) {
    balances[_from] = balances[_from].sub(_value);
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    Transfer(_from, _to, _value);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value)
  public
  returns (bool success)
{
  allowed[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

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

IsFreezedAccount keyboard_arrow_up

Parameters help

Name Type
_addr
address help

Properties

Visibility help public
Mutability help constant
Source Code
function IsFreezedAccount(address _addr) public constant returns (bool) {
  return frozenAccount[_addr];
}

FreezeAccount keyboard_arrow_up

Parameters help

Name Type
target
address help
freeze
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function FreezeAccount(address target, bool freeze) public onlyOwner {
  frozenAccount[target] = freeze;
  FrozenFunds(target, freeze);
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) public onlyOwner returns (bool success) {
  if (isBurn == true) {
    balances[msg.sender] = balances[msg.sender].sub(_value);
    _totalSupply = _totalSupply.sub(_value);
    Burn(msg.sender, _value);
    return true;
  } else {
    return false;
  }
}

setBurnStart keyboard_arrow_up

Parameters help

Name Type
_isBurnStart
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function setBurnStart(bool _isBurnStart) public onlyOwner {
  isBurn = _isBurnStart;
}

setPrices keyboard_arrow_up

Parameters help

Name Type
_lpBidPrice
uint256 help
_lpAskPrice
uint256 help
_lpBidVolume
uint256 help
_lpAskVolume
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setPrices(
  uint256 _lpBidPrice,
  uint256 _lpAskPrice,
  uint256 _lpBidVolume,
  uint256 _lpAskVolume
) public onlyOwner {
  require(_lpBidPrice < _lpAskPrice);
  require(_lpBidVolume <= lpMaxVolume);
  require(_lpAskVolume <= lpMaxVolume);
  lpBidPrice = _lpBidPrice;
  lpAskPrice = _lpAskPrice;
  lpBidVolume = _lpBidVolume;
  lpAskVolume = _lpAskVolume;
  SetPrices(_lpBidPrice, _lpAskPrice, _lpBidVolume, _lpAskVolume);
}

setLpMaxVolume keyboard_arrow_up

Parameters help

Name Type
_lpMaxVolume
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setLpMaxVolume(uint256 _lpMaxVolume) public onlyOwner {
  require(_lpMaxVolume < 1000000000000000000000000);
  lpMaxVolume = _lpMaxVolume;
  if (lpMaxVolume < lpBidVolume) {
    lpBidVolume = lpMaxVolume;
  }
  if (lpMaxVolume < lpAskVolume) {
    lpAskVolume = lpMaxVolume;
  }
  SetLpMaxVolume(_lpMaxVolume);
}

setEdgePerPosition keyboard_arrow_up

Parameters help

Name Type
_edgePerPosition
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setEdgePerPosition(uint256 _edgePerPosition) public onlyOwner {
  //require(_edgePerPosition < 100000000000000000000000000000);
  edgePerPosition = _edgePerPosition;
  SetEdgePerPosition(_edgePerPosition);
}

setLPTargetPostion keyboard_arrow_up

Parameters help

Name Type
_lpTargetPosition
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setLPTargetPostion(uint256 _lpTargetPosition) public onlyOwner {
  require(_lpTargetPosition < totalSupply());
  lpTargetPosition = _lpTargetPosition;
  SetLPTargetPostion(_lpTargetPosition);
}

setLpFee keyboard_arrow_up

Parameters help

Name Type
_lpFeeBp
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setLpFee(uint256 _lpFeeBp) public onlyOwner {
  require(_lpFeeBp <= 100);
  lpFeeBp = _lpFeeBp;
  SetLpFee(lpFeeBp);
}

setLpIsStart keyboard_arrow_up

Parameters help

Name Type
_isLpStart
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function setLpIsStart(bool _isLpStart) public onlyOwner {
  isLpStart = _isLpStart;
}

getLpBidPrice keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function getLpBidPrice() public constant returns (uint256) {
  uint256 lpPosition = balanceOf(owner);

  if (lpTargetPosition >= lpPosition) {
    return lpBidPrice;
  } else {
    return
      lpBidPrice.sub(
        (
          ((lpPosition.sub(lpTargetPosition)).div(multiplier)).mul(
            edgePerPosition
          )
        )
          .div(multiplierOfPrice)
      );
  }
}

getLpAskPrice keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function getLpAskPrice() public constant returns (uint256) {
  uint256 lpPosition = balanceOf(owner);

  if (lpTargetPosition <= lpPosition) {
    return lpAskPrice;
  } else {
    return
      lpAskPrice.add(
        (
          ((lpTargetPosition.sub(lpPosition)).div(multiplier)).mul(
            edgePerPosition
          )
        )
          .div(multiplierOfPrice)
      );
  }
}

getLpIsWorking keyboard_arrow_up

Parameters help

Name Type
minSpeadBp
int help

Properties

Visibility help public
Mutability help constant
Source Code
function getLpIsWorking(int256 minSpeadBp) public constant returns (bool) {
  if (isLpStart == false) return false;

  if (lpAskVolume == 0 || lpBidVolume == 0) {
    return false;
  }

  int256 bidPrice = int256(getLpBidPrice());
  int256 askPrice = int256(getLpAskPrice());

  if (askPrice - bidPrice > (minSpeadBp * (bidPrice + askPrice)) / 2 / 10000) {
    return false;
  }

  return true;
}

getAmountOfLinkerBuy keyboard_arrow_up

Parameters help

Name Type
etherAmountOfSell
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
function getAmountOfLinkerBuy(uint256 etherAmountOfSell)
  public
  constant
  returns (uint256)
{
  return
    (
      ((multiplierOfPrice.mul(etherAmountOfSell)).div(getLpAskPrice())).mul(
        uint256(10000).sub(lpFeeBp)
      )
    )
      .div(uint256(10000));
}

getAmountOfEtherSell keyboard_arrow_up

Parameters help

Name Type
linkerAmountOfBuy
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
function getAmountOfEtherSell(uint256 linkerAmountOfBuy)
  public
  constant
  returns (uint256)
{
  return
    (
      ((getLpBidPrice().mul(linkerAmountOfBuy)).div(multiplierOfPrice)).mul(
        uint256(10000).sub(lpFeeBp)
      )
    )
      .div(uint256(10000));
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() public payable {}

buy keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function buy() public payable returns (uint256) {
  require(getLpIsWorking(500)); // Check Whether Lp Bid and Ask spread is less than 5%
  uint256 amount = getAmountOfLinkerBuy(msg.value); // calculates the amount of buy from customer
  require(balances[owner] >= amount); // checks if it has enough to sell
  balances[msg.sender] = balances[msg.sender].add(amount); // adds the amount to buyer's balance
  balances[owner] = balances[owner].sub(amount); // subtracts amount from seller's balance
  lpAskVolume = lpAskVolume.sub(amount);
  Transfer(owner, msg.sender, amount); // execute an event reflecting the chang               // ends function and returns
  return amount;
}

sell keyboard_arrow_up

Parameters help

Name Type
amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function sell(uint256 amount) public returns (uint256) {
  require(getLpIsWorking(500));
  require(balances[msg.sender] >= amount); // checks if the sender has enough to sell
  balances[owner] = balances[owner].add(amount); // adds the amount to owner's balance
  balances[msg.sender] = balances[msg.sender].sub(amount); // subtracts the amount from seller's balance
  lpBidVolume = lpBidVolume.sub(amount);
  uint256 linkerSendAmount = getAmountOfEtherSell(amount);

  msg.sender.transfer(linkerSendAmount); // sends ether to the seller: it's important to do this last to prevent recursion attacks
  Transfer(msg.sender, this, linkerSendAmount); // executes an event reflecting on the change
  return linkerSendAmount; // ends function and returns
}

transferEther keyboard_arrow_up

Parameters help

Name Type
amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferEther(uint256 amount) public onlyOwner {
  msg.sender.transfer(amount);
  Transfer(msg.sender, this, amount);
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.