¡El código fuente de este contrato está verificado!
Metadatos del Contrato
Compilador
0.4.23+commit.124ca40d
Idioma
Solidity
Código Fuente del Contrato
Archivo 1 de 10: BasicToken.sol
pragmasolidity ^0.4.23;import"./ERC20Basic.sol";
import"./SafeMath.sol";
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/contractBasicTokenisERC20Basic{
usingSafeMathforuint256;
mapping(address=>uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/functiontotalSupply() publicviewreturns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/functiontransfer(address _to, uint256 _value) publicreturns (bool) {
require(_to !=address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
returntrue;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/functionbalanceOf(address _owner) publicviewreturns (uint256 balance) {
return balances[_owner];
}
}
Código Fuente del Contrato
Archivo 2 de 10: Blacklisted.sol
pragmasolidity ^0.4.23;import"./MultiOwnable.sol";
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/contractBlacklistedisMultiOwnable{
mapping(address=>bool) public blacklist;
/**
* @dev Throws if called by any account other than the owner.
*/modifiernotBlacklisted() {
require(blacklist[msg.sender] ==false);
_;
}
/**
* @dev Adds single address to blacklist.
* @param _villain Address to be added to the blacklist
*/functionaddToBlacklist(address _villain) externalonlyOwner{
blacklist[_villain] =true;
}
/**
* @dev Adds list of addresses to blacklist. Not overloaded due to limitations with truffle testing.
* @param _villains Addresses to be added to the blacklist
*/functionaddManyToBlacklist(address[] _villains) externalonlyOwner{
for (uint256 i =0; i < _villains.length; i++) {
blacklist[_villains[i]] =true;
}
}
/**
* @dev Removes single address from blacklist.
* @param _villain Address to be removed to the blacklist
*/functionremoveFromBlacklist(address _villain) externalonlyOwner{
blacklist[_villain] =false;
}
}
Código Fuente del Contrato
Archivo 3 de 10: BurnableToken.sol
pragmasolidity ^0.4.23;import"./BasicToken.sol";
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/contractBurnableTokenisBasicToken{
eventBurn(addressindexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/functionburn(uint256 _value) public{
_burn(msg.sender, _value);
}
function_burn(address _who, uint256 _value) internal{
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
pragmasolidity ^0.4.23;/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/contractERC20Basic{
functiontotalSupply() publicviewreturns (uint256);
functionbalanceOf(address who) publicviewreturns (uint256);
functiontransfer(address to, uint256 value) publicreturns (bool);
eventTransfer(addressindexedfrom, addressindexed to, uint256 value);
}
Código Fuente del Contrato
Archivo 6 de 10: HUMToken.sol
pragmasolidity ^0.4.23;import"./MintableToken.sol";
import"./BurnableToken.sol";
import"./Blacklisted.sol";
/**
* @title HUMToken
* @dev ERC20 HUMToken.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/contractHUMTokenisMintableToken, BurnableToken, Blacklisted{
stringpublicconstant name ="Humanscape"; // solium-disable-line uppercasestringpublicconstant symbol ="HUM"; // solium-disable-line uppercaseuint8publicconstant decimals =18; // solium-disable-line uppercase, // 18 decimals is the strongly suggested default, avoid changing ituint256publicconstant INITIAL_SUPPLY =1250*1000*1000* (10**uint256(decimals)); // 1,250,000,000 HUMboolpublic isUnlocked =false;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/constructor(address _wallet) public{
totalSupply_ = INITIAL_SUPPLY;
balances[_wallet] = INITIAL_SUPPLY;
emit Transfer(address(0), _wallet, INITIAL_SUPPLY);
}
modifieronlyTransferable() {
require(isUnlocked || owners[msg.sender] !=0);
_;
}
functiontransferFrom(address _from, address _to, uint256 _value) publiconlyTransferablenotBlacklistedreturns (bool) {
returnsuper.transferFrom(_from, _to, _value);
}
functiontransfer(address _to, uint256 _value) publiconlyTransferablenotBlacklistedreturns (bool) {
returnsuper.transfer(_to, _value);
}
functionunlockTransfer() publiconlyOwner{
isUnlocked =true;
}
functionlockTransfer() publiconlyOwner{
isUnlocked =false;
}
}
Código Fuente del Contrato
Archivo 7 de 10: MintableToken.sol
pragmasolidity ^0.4.23;import"./StandardToken.sol";
import"./MultiOwnable.sol";
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/contractMintableTokenisStandardToken, MultiOwnable{
eventMint(addressindexed to, uint256 amount);
eventMintFinished();
boolpublic mintingFinished =false;
modifiercanMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/functionmint(address _to, uint256 _amount) onlyOwnercanMintpublicreturns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
returntrue;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/functionfinishMinting() onlyOwnercanMintpublicreturns (bool) {
mintingFinished =true;
emit MintFinished();
returntrue;
}
}
Código Fuente del Contrato
Archivo 8 de 10: MultiOwnable.sol
pragmasolidity ^0.4.23;/**
* @title MultiOwnable
*/contractMultiOwnable{
addresspublic root;
mapping (address=>address) public owners; // owner => parent of owner/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/constructor() public{
root =msg.sender;
owners[root] = root;
}
/**
* @dev Throws if called by any account other than the owner.
*/modifieronlyOwner() {
require(owners[msg.sender] !=0);
_;
}
/**
* @dev Adding new owners
*/functionnewOwner(address _owner) onlyOwnerexternalreturns (bool) {
require(_owner !=0);
require(owners[_owner] ==0);
owners[_owner] =msg.sender;
returntrue;
}
/**
* @dev Deleting owners
*/functiondeleteOwner(address _owner) onlyOwnerexternalreturns (bool) {
require(owners[_owner] ==msg.sender|| (owners[_owner] !=0&&msg.sender== root));
owners[_owner] =0;
returntrue;
}
}
Código Fuente del Contrato
Archivo 9 de 10: SafeMath.sol
pragmasolidity ^0.4.23;/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/librarySafeMath{
/**
* @dev Multiplies two numbers, throws on overflow.
*/functionmul(uint256 a, uint256 b) internalpurereturns (uint256) {
if (a ==0) {
return0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/functiondiv(uint256 a, uint256 b) internalpurereturns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0// uint256 c = a / b;// assert(a == b * c + a % b); // There is no case in which this doesn't holdreturn a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/functionsub(uint256 a, uint256 b) internalpurereturns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/functionadd(uint256 a, uint256 b) internalpurereturns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
Código Fuente del Contrato
Archivo 10 de 10: StandardToken.sol
pragmasolidity ^0.4.23;import"./BasicToken.sol";
import"./ERC20.sol";
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/contractStandardTokenisERC20, BasicToken{
mapping (address=>mapping (address=>uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/functiontransferFrom(address _from, address _to, uint256 _value) publicreturns (bool) {
require(_to !=address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
returntrue;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/functionapprove(address _spender, uint256 _value) publicreturns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
returntrue;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/functionallowance(address _owner, address _spender) publicviewreturns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/functionincreaseApproval(address _spender, uint _addedValue) publicreturns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
returntrue;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/functiondecreaseApproval(address _spender, uint _subtractedValue) publicreturns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] =0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
returntrue;
}
}