ERC20
This contract is an ERC20 token.
Name
LockChain
Symbol
LOC
Decimals
18
Total Supply
18,585,933 LOC
About link description
LockTrip (LOC) is a cryptocurrency and operates on the Ethereum platform. LockTrip has a current supply of 18,579,040.57192072 with 0 in circulation. The last known price of LockTrip is 6.48999056 USD and is up 0.16 over the last 24 hours. It is currently trading on 4 active market(s) with $103,631.03 traded over the last 24 hours. More information can be found at https://locktrip.com/.
Stats
Public Functions
8
Event Types
3
Code Size
7,899 bytes
State Variables (15) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else {
return false;
}
}
transferFrom keyboard_arrow_up
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) returns (bool success) {
if (
balances[_from] >= _value &&
allowed[_from][msg.sender] >= _value &&
_value > 0
) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else {
return false;
}
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
allowance keyboard_arrow_up
constructor keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
One or more of the following:
-isMainSale must not be true - ORisPreSale must not be true - ORisPrePreSale must not be true
Source Code
function() payable {
if (isFinalized) throw;
if (!isPrePreSale && !isPreSale && !isMainSale) throw;
//if (!saleStarted) throw;
if (msg.value == 0) throw;
//create tokens
uint256 tokens = safeMult(msg.value, tokenExchangeRate); // check that we're not over totals
uint256 checkedSupply = safeAdd(totalSupply, tokens);
if (!isMainSale) {
if (tokenPreSaleCap < checkedSupply) throw;
}
// return money if something goes wrong
if (tokenSaleCap < checkedSupply) throw; // odd fractions won't be found
totalSupply = checkedSupply;
//All good. start the transfer
balances[msg.sender] += tokens; // safeAdd not needed
CreateLOK(msg.sender, tokens); // logs token creation
}
finalize keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function finalize() external {
if (isFinalized) throw;
if (msg.sender != LockChainFundDeposit) throw; // locks finalize to the ultimate ETH owner
uint256 newTokens = totalSupply;
uint256 account1Tokens;
uint256 account2Tokens;
uint256 creatorTokens = 10000 * 10**decimals;
uint256 LOKFundTokens;
uint256 checkedSupply = safeAdd(totalSupply, newTokens);
totalSupply = checkedSupply;
if (newTokens % 2 == 0) {
LOKFundTokens = newTokens / 2;
account2Tokens = newTokens / 2;
account1Tokens = LOKFundTokens - creatorTokens;
balances[account1Address] += account1Tokens;
balances[account2Address] += account2Tokens;
} else {
uint256 makeEven = newTokens - 1;
uint256 halfTokens = makeEven / 2;
LOKFundTokens = halfTokens;
account2Tokens = halfTokens + 1;
account1Tokens = LOKFundTokens - creatorTokens;
balances[account1Address] += account1Tokens;
balances[account2Address] += account2Tokens;
}
balances[creatorAddress] += creatorTokens;
CreateLOK(creatorAddress, creatorTokens);
CreateLOK(account1Address, account1Tokens);
CreateLOK(account2Address, account2Tokens);
// move to operational
if (!LockChainFundDeposit.send(this.balance)) throw;
isFinalized = true; // send the eth to LockChain
}
switchSaleStage keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function switchSaleStage() external {
if (msg.sender != LockChainFundDeposit) throw; // locks finalize to the ultimate ETH owner
if (isMainSale) throw;
if (!isPrePreSale) {
isPrePreSale = true;
tokenExchangeRate = 1150;
} else if (!isPreSale) {
isPreSale = true;
tokenExchangeRate = 1000;
} else if (!isMainSale) {
isMainSale = true;
if (totalSupply < 10 * (10**6) * 10**decimals) {
tokenExchangeRate = 750;
} else if (
totalSupply >= 10 * (10**6) * 10**decimals &&
totalSupply < 20 * (10**6) * 10**decimals
) {
tokenExchangeRate = 700;
} else if (
totalSupply >= 20 * (10**6) * 10**decimals &&
totalSupply < 30 * (10**6) * 10**decimals
) {
tokenExchangeRate = 650;
} else if (
totalSupply >= 30 * (10**6) * 10**decimals &&
totalSupply < 40 * (10**6) * 10**decimals
) {
tokenExchangeRate = 620;
} else if (
totalSupply >= 40 * (10**6) * 10**decimals &&
totalSupply <= 50 * (10**6) * 10**decimals
) {
tokenExchangeRate = 600;
}
}
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.
internal SafeMath.safeAdd keyboard_arrow_up
internal SafeMath.safeSubtract keyboard_arrow_up
Source Code
function safeSubtract(uint256 x, uint256 y) internal returns (uint256) {
assert(x >= y);
uint256 z = x - y;
return z;
}
internal SafeMath.safeMult keyboard_arrow_up
Requirements help
One or more of the following:
Source Code
function safeMult(uint256 x, uint256 y) internal returns (uint256) {
uint256 z = x * y;
assert((x == 0) || (z / x == y));
return z;
}