ERC20
This contract is an ERC20 token.
Name
Civic
Symbol
CVC
Decimals
8
Total Supply
1,000,000,000 CVC
About link description
Civic (CVC) is a cryptocurrency and operates on the Ethereum platform. Civic has a current supply of 1,000,000,000 with 670,000,000 in circulation. The last known price of Civic is 0.214842 USD and is down -2.30 over the last 24 hours. It is currently trading on 63 active market(s) with $22,913,724.97 traded over the last 24 hours. More information can be found at https://www.civic.com/.
Stats
Public Functions
12
Event Types
6
Code Size
10,909 bytes
Events (6) keyboard_arrow_up
State Variables (9) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
transfer keyboard_arrow_up
Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
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];
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
One or more of the following:
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
if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
isToken keyboard_arrow_up
upgrade keyboard_arrow_up
Source Code
function upgrade(uint256 value) public {
UpgradeState state = getUpgradeState();
if (
!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)
) {
// Called in a bad state
throw;
}
// Validate input value.
if (value == 0) throw;
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
Source Code
function setUpgradeAgent(address agent) external {
if (!canUpgrade()) {
// The token is not yet in a state that we could think upgrading
throw;
}
if (agent == 0x0) throw;
// Only a master can designate the next agent
if (msg.sender != upgradeMaster) throw;
// Upgrade has already begun for an agent
if (getUpgradeState() == UpgradeState.Upgrading) throw;
upgradeAgent = UpgradeAgent(agent);
// Bad interface
if (!upgradeAgent.isUpgradeAgent()) throw;
// Make sure that token supplies match in source and target
if (upgradeAgent.originalSupply() != totalSupply) throw;
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 {
if (master == 0x0) throw;
if (msg.sender != upgradeMaster) throw;
upgradeMaster = master;
NewUpgradeMaster(upgradeMaster);
}
canUpgrade keyboard_arrow_up
setTokenInformation keyboard_arrow_up
Requirements help
Source Code
function setTokenInformation(string _name, string _symbol) {
if (msg.sender != upgradeMaster) {
throw;
}
if (bytes(name).length > 0 || bytes(symbol).length > 0) {
// Information already set
// Allow owner to set this information only once
throw;
}
name = _name;
symbol = _symbol;
UpdatedTokenInformation(name, symbol);
}
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.safeMul keyboard_arrow_up
Requirements help
Source Code
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
internal SafeMath.safeDiv keyboard_arrow_up
Source Code
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + (a % b));
return c;
}
internal SafeMath.safeSub keyboard_arrow_up
internal SafeMath.safeAdd keyboard_arrow_up
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a && c >= b);
return c;
}