Stoken Main Contract (Deprecated in Aug 2019)¶
This is the MAIN CONTRACT of stoken.
- Contract address is 0x82070415FEe803f94Ce5617Be1878503e58F0a6a
- Deployed at Tx Hash 0x92f717e0385ec5505aac0e3a093c1f03e2bdffbb4a48d620a62cc80735ff1c83
- Block height 7635415
- Open-sourced under the GNU General Public License v3.0
- 在github仓库中查看合约代码
View on Etherscan.io:
Understand Stoken Contract¶
If you want to learn more about stoken contracts, this can help you.
Meta¶
// solidity
string private _name = "Beyou.Network 100G Token";
string private _symbol = "Stoken";
uint8 private _decimals = 6; // 6 decimals
uint256 private _cap = 35000000000000000; // 35 billion
uint256 private _totalSupply;
- Full Name
- Beyou.Network 100G Token
- Symbol
- Stoken
- Decimals
- 6
- Capped TotalSupply
- 35 billion
Stoken-Sale Whitelist Registration trigger¶
// solidity
function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
if (_allowWhitelistRegistration && value == _whitelistRegistrationValue
&& inWhitelist(to) && !inWhitelist(msg.sender) && isNotContract(msg.sender)) {
// Register whitelist for Stoken-Sale
_regWhitelist(msg.sender, to);
return true;
} else {
// Normal Transfer
_transfer(msg.sender, to, value);
return true;
}
}
Whitelist registration trigger conditions:
_allowWhitelistRegistrationistrue, when registration is allowed.value=_whitelistRegistrationValue, that is 1,001 Stokens.inWhitelist(to), receiver address is in whitelist.!inWhitelist(msg.sender), sender address is not in whitelist.isNotContract(msg.sender), sender address is not a contract, to avoid any “Coincidental accident” transfer from a contract, such as “any type of batch transfer”, “from an exchange” or any other contracts.
Transfers other than those under this special conditions are considered NORMAL TRANSFERS.
Stoken-Sale Whitelist Registration and Referral Reward¶
// solidity
uint256 private _whitelistRegistrationValue = 1001000000; // 1001 Stoken
uint256[15] private _whitelistRefRewards = [ // 100% Reward
301000000, // 301 Stoken for Level.1
200000000, // 200 Stoken for Level.2
100000000, // 100 Stoken for Level.3
100000000, // 100 Stoken for Level.4
100000000, // 100 Stoken for Level.5
50000000, // 50 Stoken for Level.6
40000000, // 40 Stoken for Level.7
30000000, // 30 Stoken for Level.8
20000000, // 20 Stoken for Level.9
10000000, // 10 Stoken for Level.10
10000000, // 10 Stoken for Level.11
10000000, // 10 Stoken for Level.12
10000000, // 10 Stoken for Level.13
10000000, // 10 Stoken for Level.14
10000000 // 10 Stoken for Level.15
];
// solidity
function _regWhitelist(address account, address refAccount) internal {
_refCount[refAccount] = _refCount[refAccount].add(1);
_referrer[account] = refAccount;
emit StokenSaleWhitelistRegistered(account, refAccount);
// Whitelist Registration Referral Reward
_transfer(msg.sender, address(this), _whitelistRegistrationValue);
address cur = account;
uint256 remain = _whitelistRegistrationValue;
for(uint i = 0; i < _whitelistRefRewards.length; i++) {
address rcv = _referrer[cur];
if (cur != rcv) {
if (_refCount[rcv] > i) {
_transfer(address(this), rcv, _whitelistRefRewards[i]);
remain = remain.sub(_whitelistRefRewards[i]);
}
} else {
_transfer(address(this), refAccount, remain);
break;
}
cur = _referrer[cur];
}
}
- Transfer 1,001 Stokens to a whitelisted address
- Will trigger Stoken-Sale whitelist registration.
- 100% of the 1,001 Stokens will be rewarded
- Up to 15 levels: 301 + 200 + 100 + …
Check whether a ETH wallet address is whitelisted¶
// solidity
function inWhitelist(address account) public view returns (bool) {
return _referrer[account] != address(0);
}
- Check whether a ETH wallet address is whitelisted
- Call function
inWhitelist(address account), if the given address was whitelisted, it will returnstrue.
Check whether the Stoken-Sale whitelist registration is in process¶
// solidity
function allowWhitelistRegistration() public view returns (bool) {
return _allowWhitelistRegistration;
}
// solidity
function disableStokenSaleWhitelistRegistration() external onlyOwner {
_allowWhitelistRegistration = false;
emit StokenSaleWhitelistRegistrationDisabled();
}
- Check whether the whitelisting is in process
Call function
allowWhitelistRegistration(), if it returnstrue, registration is allowed.Whenever it returns
false, that means registration was disabled, and it’s unrecoverable.
Whitelist qualification transfer is supported¶
// solidity
function transferWhitelist(address account) external onlyInWhitelist {
require(isNotContract(account));
_refCount[account] = _refCount[msg.sender];
_refCount[msg.sender] = 0;
_referrer[account] = _referrer[msg.sender];
_referrer[msg.sender] = address(0);
emit StokenSaleWhitelistTransferred(msg.sender, account);
}
- Whitelist qualification transfer is supported
- Just call function
transferWhitelist(address account)if you need.