XinFin XDCE
ERC20
This contract is an ERC20 token.
Name
XinFin XDCE
Symbol
XDCE
Decimals
18
Total Supply
15,000,000,000 XDCE
About
Stats
Public Functions
34
Event Types
6
Code Size
17,570 bytes
Events (6) keyboard_arrow_up
State Variables (23) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address _newOwner) onlyOwner {
require(_newOwner != address(0));
newOwner = _newOwner;
}
acceptOwnership keyboard_arrow_up
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
transfer keyboard_arrow_up
Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
// SafMaths will automatically handle the overflow checks
balances[msg.sender] = safeSub(balances[msg.sender], _value);
balances[_to] = safeAdd(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
}
transferFrom keyboard_arrow_up
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) returns (bool success) {
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met
balances[_to] = safeAdd(balances[_to], _value);
balances[_from] = safeSub(balances[_from], _value);
allowed[_from][msg.sender] = safeSub(_allowance, _value);
Transfer(_from, _to, _value);
return true;
}
approve keyboard_arrow_up
Requirements help
UNKNOWN VALUE must not be true
Source Code
function approve(address _spender, uint256 _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)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
setReleaseAgent keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
inReleaseState checks for the following:
Source Code
function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
// 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
Modifiers help
onlyOwner checks for the following:
inReleaseState checks for the following:
Source Code
function setTransferAgent(address addr, bool state)
public
onlyOwner
inReleaseState(false)
{
transferAgents[addr] = state;
}
releaseTokenTransfer keyboard_arrow_up
safeMul keyboard_arrow_up
Requirements help
Source Code
function safeMul(uint256 a, uint256 b) returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
safeSub keyboard_arrow_up
safeAdd keyboard_arrow_up
upgrade keyboard_arrow_up
Requirements help
One or more of the following:
-
state
must be equal to
UpgradeState.Upgrading
- OR
state
must be equal to
UpgradeState.ReadyToUpgrade
Source Code
function upgrade(uint256 value) public {
UpgradeState state = getUpgradeState();
require(
state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading
);
// 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
Requirements help
null
Source Code
function setUpgradeAgent(address agent) external {
// The token is not yet in a state that we could think upgrading
require(canUpgrade());
require(agent != 0x0);
// Only a master can designate the next agent
require(msg.sender == upgradeMaster);
// Upgrade has already begun for an agent
require(getUpgradeState() != UpgradeState.Upgrading);
upgradeAgent = UpgradeAgent(agent);
// Bad interface
require(upgradeAgent.isUpgradeAgent());
// Make sure that token supplies match in source and target
require(upgradeAgent.originalSupply() == totalSupply);
UpgradeAgentSet(upgradeAgent);
}
getUpgradeState keyboard_arrow_up
Parameters help
This function has no parameters.
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
Requirements help
Source Code
function setUpgradeMaster(address master) public {
require(master != 0x0);
require(msg.sender == upgradeMaster);
upgradeMaster = master;
}
canUpgrade keyboard_arrow_up
updateTokenInformation keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function updateTokenInformation(string _name, string _symbol) onlyOwner {
name = _name;
symbol = _symbol;
UpdatedTokenInformation(name, symbol);
}
sendTokensToOwner keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function sendTokensToOwner(uint256 _tokens) onlyOwner returns (bool ok) {
require(balances[contractAddress] >= _tokens);
balances[contractAddress] = safeSub(balances[contractAddress], _tokens);
balances[owner] = safeAdd(balances[owner], _tokens);
return true;
}
sendTokensToInvestors keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function sendTokensToInvestors(address _investor, uint256 _tokens)
onlyOwner
returns (bool ok)
{
require(balances[contractAddress] >= _tokens);
onSaleTokens = safeSub(onSaleTokens, _tokens);
balances[contractAddress] = safeSub(balances[contractAddress], _tokens);
balances[_investor] = safeAdd(balances[_investor], _tokens);
return true;
}
dispenseTokensToInvestorAddressesByValue keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function dispenseTokensToInvestorAddressesByValue(
address[] _addresses,
uint256[] _value
) onlyOwner returns (bool ok) {
require(_addresses.length == _value.length);
for (uint256 i = 0; i < _addresses.length; i++) {
onSaleTokens = safeSub(onSaleTokens, _value[i]);
balances[_addresses[i]] = safeAdd(balances[_addresses[i]], _value[i]);
balances[contractAddress] = safeSub(balances[contractAddress], _value[i]);
}
return true;
}
startCrowdSale keyboard_arrow_up
stopCrowdSale keyboard_arrow_up
setPublicSaleParams keyboard_arrow_up
Parameters help
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function setPublicSaleParams(
uint256 _tokensForPublicSale,
uint256 _min,
uint256 _max,
bool _crowdsaleStatus
) onlyOwner {
require(_tokensForPublicSale != 0);
require(_tokensForPublicSale <= onSaleTokens);
tokensForPublicSale = _tokensForPublicSale;
isCrowdsaleOpen = _crowdsaleStatus;
require(_min >= 0);
require(_max > 0);
minETH = _min;
maxETH = _max;
}
setTotalTokensForPublicSale keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setTotalTokensForPublicSale(uint256 _value) onlyOwner {
require(_value != 0);
tokensForPublicSale = _value;
}
increaseSupply keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function increaseSupply(uint256 value) onlyOwner returns (bool) {
totalSupply = safeAdd(totalSupply, value);
balances[contractAddress] = safeAdd(balances[contractAddress], value);
Transfer(0x0, contractAddress, value);
return true;
}
decreaseSupply keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function decreaseSupply(uint256 value) onlyOwner returns (bool) {
balances[contractAddress] = safeSub(balances[contractAddress], value);
totalSupply = safeSub(totalSupply, value);
Transfer(contractAddress, 0x0, value);
return true;
}
setMinAndMaxEthersForPublicSale keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setMinAndMaxEthersForPublicSale(uint256 _min, uint256 _max) onlyOwner {
require(_min >= 0);
require(_max > 0);
minETH = _min;
maxETH = _max;
}
updateTokenPrice keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function updateTokenPrice(uint256 _value) onlyOwner {
require(_value != 0);
pricePerToken = _value;
}
updateOnSaleSupply keyboard_arrow_up
buyTokens keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
isCrowdsaleOpen must be true
Source Code
function buyTokens() public payable returns (uint256 tokenAmount) {
uint256 _tokenAmount;
uint256 multiplier = (10**decimals);
uint256 weiAmount = msg.value;
require(isCrowdsaleOpen);
//require(whitelistedAddress[msg.sender]);
require(weiAmount >= minETH);
require(weiAmount <= maxETH);
_tokenAmount = safeMul(weiAmount, multiplier) / pricePerToken;
require(_tokenAmount > 0);
//safe sub will automatically handle overflows
tokensForPublicSale = safeSub(tokensForPublicSale, _tokenAmount);
onSaleTokens = safeSub(onSaleTokens, _tokenAmount);
balances[contractAddress] = safeSub(balances[contractAddress], _tokenAmount);
//assign tokens
balances[msg.sender] = safeAdd(balances[msg.sender], _tokenAmount);
//send money to the owner
require(owner.send(weiAmount));
return _tokenAmount;
}
constructor keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
isCrowdsaleOpen must be true
Source Code
function() payable {
buyTokens();
}
destroyToken keyboard_arrow_up
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.