contract_name
stringlengths 1
61
| file_path
stringlengths 5
50.4k
| contract_address
stringlengths 42
42
| language
stringclasses 1
value | class_name
stringlengths 1
61
| class_code
stringlengths 4
330k
| class_documentation
stringlengths 0
29.1k
| class_documentation_type
stringclasses 6
values | func_name
stringlengths 0
62
| func_code
stringlengths 1
303k
| func_documentation
stringlengths 2
14.9k
| func_documentation_type
stringclasses 4
values | compiler_version
stringlengths 15
42
| license_type
stringclasses 14
values | swarm_source
stringlengths 0
71
| meta
dict | __index_level_0__
int64 0
60.4k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DecentrEx | DecentrEx.sol | 0x728974844947e09b77f01ba1ef115230ddc8a9a0 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint public decimals;
string public name;
} | transfer | function transfer(address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.8+commit.60cc1668 | bzzr://68b8d75990c02744ad9b01451030f1a0ac004ffbf0f66ffe65bfdeb81512b5c9 | {
"func_code_index": [
526,
601
]
} | 55,661 |
|||
DecentrEx | DecentrEx.sol | 0x728974844947e09b77f01ba1ef115230ddc8a9a0 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint public decimals;
string public name;
} | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.8+commit.60cc1668 | bzzr://68b8d75990c02744ad9b01451030f1a0ac004ffbf0f66ffe65bfdeb81512b5c9 | {
"func_code_index": [
914,
1008
]
} | 55,662 |
|||
DecentrEx | DecentrEx.sol | 0x728974844947e09b77f01ba1ef115230ddc8a9a0 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint public decimals;
string public name;
} | approve | function approve(address _spender, uint256 _value) returns (bool success) {}
| /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not | NatSpecSingleLine | v0.4.8+commit.60cc1668 | bzzr://68b8d75990c02744ad9b01451030f1a0ac004ffbf0f66ffe65bfdeb81512b5c9 | {
"func_code_index": [
1284,
1363
]
} | 55,663 |
|||
DecentrEx | DecentrEx.sol | 0x728974844947e09b77f01ba1ef115230ddc8a9a0 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint public decimals;
string public name;
} | allowance | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
| /// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent | NatSpecSingleLine | v0.4.8+commit.60cc1668 | bzzr://68b8d75990c02744ad9b01451030f1a0ac004ffbf0f66ffe65bfdeb81512b5c9 | {
"func_code_index": [
1565,
1660
]
} | 55,664 |
|||
DecentrEx | DecentrEx.sol | 0x728974844947e09b77f01ba1ef115230ddc8a9a0 | Solidity | AccountLevels | contract AccountLevels {
//given a user, returns an account level
//0 = regular user (pays take fee and make fee)
//1 = market maker silver (pays take fee, no make fee, gets rebate)
//2 = market maker gold (pays take fee, no make fee, gets entire counterparty's take fee as rebate)
function accountLevel(address user) constant returns(uint) {}
} | accountLevel | function accountLevel(address user) constant returns(uint) {}
| //given a user, returns an account level
//0 = regular user (pays take fee and make fee)
//1 = market maker silver (pays take fee, no make fee, gets rebate)
//2 = market maker gold (pays take fee, no make fee, gets entire counterparty's take fee as rebate) | LineComment | v0.4.8+commit.60cc1668 | bzzr://68b8d75990c02744ad9b01451030f1a0ac004ffbf0f66ffe65bfdeb81512b5c9 | {
"func_code_index": [
295,
359
]
} | 55,665 |
|||
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* */ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
78,
410
]
} | 55,666 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* */ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
484,
738
]
} | 55,667 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* */ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
841,
941
]
} | 55,668 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* */ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
996,
1105
]
} | 55,669 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
* */
function totalSupply() public view returns (uint256){
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
/**
* @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. */
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances. */ | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256){
return totalSupply_;
}
| /**
* @dev total number of tokens in existence
* */ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
177,
253
]
} | 55,670 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
* */
function totalSupply() public view returns (uint256){
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
/**
* @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. */
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances. */ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
| /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
395,
715
]
} | 55,671 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
* */
function totalSupply() public view returns (uint256){
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
/**
* @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. */
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances. */ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
| /**
* @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. */ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
906,
999
]
} | 55,672 |
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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. */
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
} | transferFrom | function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
| /**
* @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
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
370,
807
]
} | 55,673 |
||
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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. */
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
} | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
1398,
1572
]
} | 55,674 |
||
PrtToken | prt.sol | 0xe144b04c2690ea958fa63268aa975e685df7c23e | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true; //AUDIT// 返回值符合 EIP20 规范
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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. */
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
} | allowance | function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
| /**
* @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. */ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | None | bzzr://9e6fc479c539177d4570056a2bfb57c864a0e854ce60bb96571ab58f76f84320 | {
"func_code_index": [
1872,
1994
]
} | 55,675 |
||
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
89,
476
]
} | 55,676 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
560,
840
]
} | 55,677 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
954,
1070
]
} | 55,678 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (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 hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
1134,
1264
]
} | 55,679 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | function () external payable {
buyTokens(msg.sender);
}
| /**
* @dev fallback function ***DO NOT OVERRIDE***
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
1548,
1614
]
} | 55,680 |
||
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | buyTokens | function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
| /**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
1753,
2356
]
} | 55,681 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _preValidatePurchase | function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
| /**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
2788,
2974
]
} | 55,682 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _postValidatePurchase | function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
| /**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
3256,
3396
]
} | 55,683 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _deliverTokens | function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
| /**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
3663,
3821
]
} | 55,684 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _processPurchase | function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
| /**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
4072,
4232
]
} | 55,685 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _updatePurchasingState | function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
| /**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
4489,
4630
]
} | 55,686 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _getTokenAmount | function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
| /**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
4872,
5000
]
} | 55,687 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Crowdsale | contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
} | /**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/ | NatSpecMultiLine | _forwardFunds | function _forwardFunds() internal {
wallet.transfer(msg.value);
}
| /**
* @dev Determines how ETH is stored/forwarded on purchases.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
5081,
5157
]
} | 55,688 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
} | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | renounceOwnership | function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
| /**
* @dev Allows the current owner to relinquish control of the contract.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
638,
755
]
} | 55,689 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
} | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
920,
1028
]
} | 55,690 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
} | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | _transferOwnership | function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| /**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
1166,
1344
]
} | 55,691 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (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);
return true;
}
/**
* @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.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| /**
* @dev total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
199,
287
]
} | 55,692 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (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);
return true;
}
/**
* @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.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (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);
return true;
}
| /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
445,
777
]
} | 55,693 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (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);
return true;
}
/**
* @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.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
983,
1087
]
} | 55,694 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | BurnableToken | contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(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);
}
} | /**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/ | NatSpecMultiLine | burn | function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
| /**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
212,
290
]
} | 55,695 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (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]);
return true;
}
} | /**
* @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
*/ | NatSpecMultiLine | transferFrom | function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true;
}
| /**
* @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
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
401,
891
]
} | 55,696 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (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]);
return true;
}
} | /**
* @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
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
1523,
1718
]
} | 55,697 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (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]);
return true;
}
} | /**
* @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
*/ | NatSpecMultiLine | allowance | function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
2042,
2207
]
} | 55,698 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (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]);
return true;
}
} | /**
* @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
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
2673,
2980
]
} | 55,699 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (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]);
return true;
}
} | /**
* @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
*/ | NatSpecMultiLine | decreaseApproval | function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (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]);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
3451,
3894
]
} | 55,700 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | StandardBurnableToken | contract StandardBurnableToken is BurnableToken, StandardToken {
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
} | /**
* @title Standard Burnable Token
* @dev Adds burnFrom method to ERC20 implementations
*/ | NatSpecMultiLine | burnFrom | function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
| /**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
311,
690
]
} | 55,701 |
|
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | ExposureCrowdSale | contract ExposureCrowdSale is Crowdsale, Ownable {
constructor(uint256 rate_, address wallet_, ExposureToken token_) public
Crowdsale(rate_, wallet_, token_)
{
}
/**
* @dev Allows the owner to withdraw any Exposure in the crowdsale contract
* @param _amount Exposure to withdraw
*/
function withdraw(uint256 _amount)
onlyOwner
external
{
token.transfer(owner, _amount);
}
/**
* @dev Allows the owner to change the funds wallet address
* @param _wallet The new funds wallet address
*/
function updateWallet(address _wallet)
onlyOwner
external
{
wallet = _wallet;
}
/**
* @dev Allows the owner to change the exchange rate
* @param _rate The new rate of the crowdsale
*/
function updateRate(uint256 _rate)
onlyOwner
external
{
rate = _rate;
}
/**
* @dev Allows a participant to ensure they receive a specfic rate when purchasing to prevent front-running by the owner
* @param _beneficiary The recipient of all that sweet sweet Exposure.
* @param _guaranteedRate The rate the recipient wants to ensure they receive.
*/
function buyTokensAtRate(address _beneficiary, uint256 _guaranteedRate)
external
payable
{
// Ensure the rate we're providing is the one the user asks for or revert the transaction.
require(rate == _guaranteedRate);
// Ok, we're good to execute the buy.
return buyTokens(_beneficiary);
}
} | withdraw | function withdraw(uint256 _amount)
onlyOwner
external
{
token.transfer(owner, _amount);
}
| /**
* @dev Allows the owner to withdraw any Exposure in the crowdsale contract
* @param _amount Exposure to withdraw
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
330,
461
]
} | 55,702 |
|||
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | ExposureCrowdSale | contract ExposureCrowdSale is Crowdsale, Ownable {
constructor(uint256 rate_, address wallet_, ExposureToken token_) public
Crowdsale(rate_, wallet_, token_)
{
}
/**
* @dev Allows the owner to withdraw any Exposure in the crowdsale contract
* @param _amount Exposure to withdraw
*/
function withdraw(uint256 _amount)
onlyOwner
external
{
token.transfer(owner, _amount);
}
/**
* @dev Allows the owner to change the funds wallet address
* @param _wallet The new funds wallet address
*/
function updateWallet(address _wallet)
onlyOwner
external
{
wallet = _wallet;
}
/**
* @dev Allows the owner to change the exchange rate
* @param _rate The new rate of the crowdsale
*/
function updateRate(uint256 _rate)
onlyOwner
external
{
rate = _rate;
}
/**
* @dev Allows a participant to ensure they receive a specfic rate when purchasing to prevent front-running by the owner
* @param _beneficiary The recipient of all that sweet sweet Exposure.
* @param _guaranteedRate The rate the recipient wants to ensure they receive.
*/
function buyTokensAtRate(address _beneficiary, uint256 _guaranteedRate)
external
payable
{
// Ensure the rate we're providing is the one the user asks for or revert the transaction.
require(rate == _guaranteedRate);
// Ok, we're good to execute the buy.
return buyTokens(_beneficiary);
}
} | updateWallet | function updateWallet(address _wallet)
onlyOwner
external
{
wallet = _wallet;
}
| /**
* @dev Allows the owner to change the funds wallet address
* @param _wallet The new funds wallet address
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
596,
717
]
} | 55,703 |
|||
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | ExposureCrowdSale | contract ExposureCrowdSale is Crowdsale, Ownable {
constructor(uint256 rate_, address wallet_, ExposureToken token_) public
Crowdsale(rate_, wallet_, token_)
{
}
/**
* @dev Allows the owner to withdraw any Exposure in the crowdsale contract
* @param _amount Exposure to withdraw
*/
function withdraw(uint256 _amount)
onlyOwner
external
{
token.transfer(owner, _amount);
}
/**
* @dev Allows the owner to change the funds wallet address
* @param _wallet The new funds wallet address
*/
function updateWallet(address _wallet)
onlyOwner
external
{
wallet = _wallet;
}
/**
* @dev Allows the owner to change the exchange rate
* @param _rate The new rate of the crowdsale
*/
function updateRate(uint256 _rate)
onlyOwner
external
{
rate = _rate;
}
/**
* @dev Allows a participant to ensure they receive a specfic rate when purchasing to prevent front-running by the owner
* @param _beneficiary The recipient of all that sweet sweet Exposure.
* @param _guaranteedRate The rate the recipient wants to ensure they receive.
*/
function buyTokensAtRate(address _beneficiary, uint256 _guaranteedRate)
external
payable
{
// Ensure the rate we're providing is the one the user asks for or revert the transaction.
require(rate == _guaranteedRate);
// Ok, we're good to execute the buy.
return buyTokens(_beneficiary);
}
} | updateRate | function updateRate(uint256 _rate)
onlyOwner
external
{
rate = _rate;
}
| /**
* @dev Allows the owner to change the exchange rate
* @param _rate The new rate of the crowdsale
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
844,
957
]
} | 55,704 |
|||
ExposureCrowdSale | ExposureCrowdSale.sol | 0xb7d9372dbcedffd7b58a15516e0b156204b764a8 | Solidity | ExposureCrowdSale | contract ExposureCrowdSale is Crowdsale, Ownable {
constructor(uint256 rate_, address wallet_, ExposureToken token_) public
Crowdsale(rate_, wallet_, token_)
{
}
/**
* @dev Allows the owner to withdraw any Exposure in the crowdsale contract
* @param _amount Exposure to withdraw
*/
function withdraw(uint256 _amount)
onlyOwner
external
{
token.transfer(owner, _amount);
}
/**
* @dev Allows the owner to change the funds wallet address
* @param _wallet The new funds wallet address
*/
function updateWallet(address _wallet)
onlyOwner
external
{
wallet = _wallet;
}
/**
* @dev Allows the owner to change the exchange rate
* @param _rate The new rate of the crowdsale
*/
function updateRate(uint256 _rate)
onlyOwner
external
{
rate = _rate;
}
/**
* @dev Allows a participant to ensure they receive a specfic rate when purchasing to prevent front-running by the owner
* @param _beneficiary The recipient of all that sweet sweet Exposure.
* @param _guaranteedRate The rate the recipient wants to ensure they receive.
*/
function buyTokensAtRate(address _beneficiary, uint256 _guaranteedRate)
external
payable
{
// Ensure the rate we're providing is the one the user asks for or revert the transaction.
require(rate == _guaranteedRate);
// Ok, we're good to execute the buy.
return buyTokens(_beneficiary);
}
} | buyTokensAtRate | function buyTokensAtRate(address _beneficiary, uint256 _guaranteedRate)
external
payable
{
// Ensure the rate we're providing is the one the user asks for or revert the transaction.
require(rate == _guaranteedRate);
// Ok, we're good to execute the buy.
return buyTokens(_beneficiary);
}
| /**
* @dev Allows a participant to ensure they receive a specfic rate when purchasing to prevent front-running by the owner
* @param _beneficiary The recipient of all that sweet sweet Exposure.
* @param _guaranteedRate The rate the recipient wants to ensure they receive.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://b082760f03a8e3ee9a34f5284ad5e9c1f16c006eb503eddfac8eaedbadcc80f9 | {
"func_code_index": [
1260,
1618
]
} | 55,705 |
|||
AWG | contracts/roles/BurnerRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | BurnerRole | contract BurnerRole {
using Roles for Roles.Role;
Roles.Role private _burners;
/**
* @notice Fired when a new role is added.
*/
event BurnerAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event BurnerRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addBurner(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyBurner() {
require(isBurner(msg.sender), "BurnerRole: caller does not have the Burner role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceBurner() public {
_removeBurner(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isBurner(address account) public view returns (bool) {
return _burners.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addBurner(address account) internal {
_burners.add(account);
emit BurnerAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeBurner(address account) internal {
_burners.remove(account);
emit BurnerRemoved(account);
}
} | /**
* @title Burner Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addBurner` and the `removeBurner` functions.
*/ | NatSpecMultiLine | renounceBurner | function renounceBurner() public {
_removeBurner(msg.sender);
}
| /**
* @dev The role is removed for the caller.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
745,
827
]
} | 55,706 |
AWG | contracts/roles/BurnerRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | BurnerRole | contract BurnerRole {
using Roles for Roles.Role;
Roles.Role private _burners;
/**
* @notice Fired when a new role is added.
*/
event BurnerAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event BurnerRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addBurner(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyBurner() {
require(isBurner(msg.sender), "BurnerRole: caller does not have the Burner role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceBurner() public {
_removeBurner(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isBurner(address account) public view returns (bool) {
return _burners.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addBurner(address account) internal {
_burners.add(account);
emit BurnerAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeBurner(address account) internal {
_burners.remove(account);
emit BurnerRemoved(account);
}
} | /**
* @title Burner Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addBurner` and the `removeBurner` functions.
*/ | NatSpecMultiLine | isBurner | function isBurner(address account) public view returns (bool) {
return _burners.has(account);
}
| /**
* @dev Checks if @param account has the role.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
900,
1014
]
} | 55,707 |
AWG | contracts/roles/BurnerRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | BurnerRole | contract BurnerRole {
using Roles for Roles.Role;
Roles.Role private _burners;
/**
* @notice Fired when a new role is added.
*/
event BurnerAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event BurnerRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addBurner(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyBurner() {
require(isBurner(msg.sender), "BurnerRole: caller does not have the Burner role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceBurner() public {
_removeBurner(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isBurner(address account) public view returns (bool) {
return _burners.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addBurner(address account) internal {
_burners.add(account);
emit BurnerAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeBurner(address account) internal {
_burners.remove(account);
emit BurnerRemoved(account);
}
} | /**
* @title Burner Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addBurner` and the `removeBurner` functions.
*/ | NatSpecMultiLine | _addBurner | function _addBurner(address account) internal {
_burners.add(account);
emit BurnerAdded(account);
}
| /**
* @dev Assigns the role to @param account.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
1084,
1211
]
} | 55,708 |
AWG | contracts/roles/BurnerRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | BurnerRole | contract BurnerRole {
using Roles for Roles.Role;
Roles.Role private _burners;
/**
* @notice Fired when a new role is added.
*/
event BurnerAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event BurnerRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addBurner(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyBurner() {
require(isBurner(msg.sender), "BurnerRole: caller does not have the Burner role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceBurner() public {
_removeBurner(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isBurner(address account) public view returns (bool) {
return _burners.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addBurner(address account) internal {
_burners.add(account);
emit BurnerAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeBurner(address account) internal {
_burners.remove(account);
emit BurnerRemoved(account);
}
} | /**
* @title Burner Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addBurner` and the `removeBurner` functions.
*/ | NatSpecMultiLine | _removeBurner | function _removeBurner(address account) internal {
_burners.remove(account);
emit BurnerRemoved(account);
}
| /**
* @dev Removes the role from @param account.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
1283,
1418
]
} | 55,709 |
AWG | contracts/roles/MinterRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | MinterRole | contract MinterRole {
using Roles for Roles.Role;
Roles.Role private _minters;
/**
* @notice Fired when a new role is added.
*/
event MinterAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event MinterRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addMinter(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyMinter() {
require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceMinter() public {
_removeMinter(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
} | /**
* @title Minter Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addMinter` and the `removeMinter` functions.
*/ | NatSpecMultiLine | renounceMinter | function renounceMinter() public {
_removeMinter(msg.sender);
}
| /**
* @dev The role is removed for the caller.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
749,
831
]
} | 55,710 |
AWG | contracts/roles/MinterRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | MinterRole | contract MinterRole {
using Roles for Roles.Role;
Roles.Role private _minters;
/**
* @notice Fired when a new role is added.
*/
event MinterAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event MinterRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addMinter(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyMinter() {
require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceMinter() public {
_removeMinter(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
} | /**
* @title Minter Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addMinter` and the `removeMinter` functions.
*/ | NatSpecMultiLine | isMinter | function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
| /**
* @dev Checks if @param account has the role.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
904,
1018
]
} | 55,711 |
AWG | contracts/roles/MinterRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | MinterRole | contract MinterRole {
using Roles for Roles.Role;
Roles.Role private _minters;
/**
* @notice Fired when a new role is added.
*/
event MinterAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event MinterRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addMinter(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyMinter() {
require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceMinter() public {
_removeMinter(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
} | /**
* @title Minter Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addMinter` and the `removeMinter` functions.
*/ | NatSpecMultiLine | _addMinter | function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
| /**
* @dev Assigns the role to @param account.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
1088,
1215
]
} | 55,712 |
AWG | contracts/roles/MinterRole.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | MinterRole | contract MinterRole {
using Roles for Roles.Role;
Roles.Role private _minters;
/**
* @notice Fired when a new role is added.
*/
event MinterAdded(address indexed account);
/**
* @notice Fired when a new role is added.
*/
event MinterRemoved(address indexed account);
/**
* @dev The role is granted to the deployer.
*/
constructor () internal {
_addMinter(msg.sender);
}
/**
* @dev Callers must have the role.
*/
modifier onlyMinter() {
require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role");
_;
}
/**
* @dev The role is removed for the caller.
*/
function renounceMinter() public {
_removeMinter(msg.sender);
}
/**
* @dev Checks if @param account has the role.
*/
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
/**
* @dev Assigns the role to @param account.
*/
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
/**
* @dev Removes the role from @param account.
*/
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
} | /**
* @title Minter Role
* @dev Follows the openzeppelin's guidelines of working with roles.
* @dev Derived contracts must implement the `addMinter` and the `removeMinter` functions.
*/ | NatSpecMultiLine | _removeMinter | function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
| /**
* @dev Removes the role from @param account.
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
1287,
1422
]
} | 55,713 |
AWG | contracts/token/ECRecovery.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | ECRecovery | library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes memory sig)
internal
pure
returns (address)
{
bytes32 r;
bytes32 s;
uint8 v;
// Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
// solium-disable-next-line arg-overflow
return ecrecover(hash, v, r, s);
}
}
/**
* toEthSignedMessageHash
* @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
* and hash the result
*/
function toEthSignedMessageHash(bytes32 hash)
internal
pure
returns (bytes32)
{
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
}
} | /**
* @title Eliptic curve signature operations
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*/ | NatSpecMultiLine | recover | function recover(bytes32 hash, bytes memory sig)
internal
pure
returns (address)
{
bytes32 r;
bytes32 s;
uint8 v;
// Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
// solium-disable-next-line arg-overflow
return ecrecover(hash, v, r, s);
}
}
| /**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
313,
1433
]
} | 55,714 |
AWG | contracts/token/ECRecovery.sol | 0x696acc2de564b48682d71d0847b3632f87c9a402 | Solidity | ECRecovery | library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes memory sig)
internal
pure
returns (address)
{
bytes32 r;
bytes32 s;
uint8 v;
// Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
// solium-disable-next-line arg-overflow
return ecrecover(hash, v, r, s);
}
}
/**
* toEthSignedMessageHash
* @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
* and hash the result
*/
function toEthSignedMessageHash(bytes32 hash)
internal
pure
returns (bytes32)
{
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
}
} | /**
* @title Eliptic curve signature operations
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*/ | NatSpecMultiLine | toEthSignedMessageHash | function toEthSignedMessageHash(bytes32 hash)
internal
pure
returns (bytes32)
{
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
}
| /**
* toEthSignedMessageHash
* @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
* and hash the result
*/ | NatSpecMultiLine | v0.5.4+commit.9549d8ff | MIT | bzzr://9ce91c89b7de19f2f5221b1c3deead8577a2d45162c687c0054fc1889b0c61c8 | {
"func_code_index": [
1585,
1915
]
} | 55,715 |
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (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 hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
89,
483
]
} | 55,716 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (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 hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 _a, uint256 _b) internal pure returns (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 hold
return _a / _b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
567,
858
]
} | 55,717 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (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 hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
972,
1094
]
} | 55,718 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (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 hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
} | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1158,
1293
]
} | 55,719 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @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.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| /**
* @dev Total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
217,
305
]
} | 55,720 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @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.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
| /**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
463,
795
]
} | 55,721 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @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.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
} | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1001,
1105
]
} | 55,722 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 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]);
return true;
}
} | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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);
return true;
}
| /**
* @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
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
401,
891
]
} | 55,723 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 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]);
return true;
}
} | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1517,
1712
]
} | 55,724 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 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]);
return true;
}
} | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
2036,
2201
]
} | 55,725 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 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]);
return true;
}
} | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
2661,
2971
]
} | 55,726 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | StandardToken | contract StandardToken is ERC20, 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
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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);
return true;
}
/**
* @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.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (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.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @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.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 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]);
return true;
}
} | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | decreaseApproval | function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 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]);
return true;
}
| /**
* @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.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
3436,
3886
]
} | 55,727 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | BurnableToken | contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(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);
}
} | /**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/ | NatSpecMultiLine | burn | function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
| /**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
212,
290
]
} | 55,728 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
} | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | renounceOwnership | function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
| /**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
815,
932
]
} | 55,729 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
} | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1097,
1205
]
} | 55,730 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
} | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | _transferOwnership | function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| /**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1343,
1521
]
} | 55,731 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | CustomAdmin | contract CustomAdmin is Ownable {
///@notice List of administrators.
mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
///@notice Validates if the sender is actually an administrator.
modifier onlyAdmin() {
require(admins[msg.sender] || msg.sender == owner);
_;
}
///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list.
function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list.
function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list.
function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
function isAdmin(address _account) view public returns(bool) {
return admins[_account] || _account == owner;
}
///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list.
function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
} | ///@title This contract enables to create multiple contract administrators. | NatSpecSingleLine | addAdmin | function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
| ///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
522,
816
]
} | 55,732 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | CustomAdmin | contract CustomAdmin is Ownable {
///@notice List of administrators.
mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
///@notice Validates if the sender is actually an administrator.
modifier onlyAdmin() {
require(admins[msg.sender] || msg.sender == owner);
_;
}
///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list.
function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list.
function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list.
function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
function isAdmin(address _account) view public returns(bool) {
return admins[_account] || _account == owner;
}
///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list.
function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
} | ///@title This contract enables to create multiple contract administrators. | NatSpecSingleLine | addManyAdmins | function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
| ///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
962,
1445
]
} | 55,733 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | CustomAdmin | contract CustomAdmin is Ownable {
///@notice List of administrators.
mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
///@notice Validates if the sender is actually an administrator.
modifier onlyAdmin() {
require(admins[msg.sender] || msg.sender == owner);
_;
}
///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list.
function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list.
function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list.
function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
function isAdmin(address _account) view public returns(bool) {
return admins[_account] || _account == owner;
}
///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list.
function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
} | ///@title This contract enables to create multiple contract administrators. | NatSpecSingleLine | removeAdmin | function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
| ///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1598,
1882
]
} | 55,734 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | CustomAdmin | contract CustomAdmin is Ownable {
///@notice List of administrators.
mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
///@notice Validates if the sender is actually an administrator.
modifier onlyAdmin() {
require(admins[msg.sender] || msg.sender == owner);
_;
}
///@notice Adds the specified address to the list of administrators.
///@param _address The address to add to the administrator list.
function addAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(!admins[_address]);
//The owner is already an admin and cannot be added.
require(_address != owner);
admins[_address] = true;
emit AdminAdded(_address);
}
///@notice Adds multiple addresses to the administrator list.
///@param _accounts The wallet addresses to add to the administrator list.
function addManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address cannot be an admin.
///The owner is already an admin and cannot be assigned.
///The address cannot be an existing admin.
if(account != address(0) && !admins[account] && account != owner){
admins[account] = true;
emit AdminAdded(_accounts[i]);
}
}
}
///@notice Removes the specified address from the list of administrators.
///@param _address The address to remove from the administrator list.
function removeAdmin(address _address) external onlyAdmin {
require(_address != address(0));
require(admins[_address]);
//The owner cannot be removed as admin.
require(_address != owner);
admins[_address] = false;
emit AdminRemoved(_address);
}
function isAdmin(address _account) view public returns(bool) {
return admins[_account] || _account == owner;
}
///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list.
function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
} | ///@title This contract enables to create multiple contract administrators. | NatSpecSingleLine | removeManyAdmins | function removeManyAdmins(address[] _accounts) external onlyAdmin {
for(uint8 i=0; i<_accounts.length; i++) {
address account = _accounts[i];
///Zero address can neither be added or removed from this list.
///The owner is the super admin and cannot be removed.
///The address must be an existing admin in order for it to be removed.
if(account != address(0) && admins[account] && account != owner){
admins[account] = false;
emit AdminRemoved(_accounts[i]);
}
}
}
| ///@notice Removes multiple addresses to the administrator list.
///@param _accounts The wallet addresses to remove from the administrator list. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
2162,
2704
]
} | 55,735 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | CustomPausable | contract CustomPausable is CustomAdmin {
event Paused();
event Unpaused();
bool public paused = false;
///@notice Verifies whether the contract is not paused.
modifier whenNotPaused() {
require(!paused);
_;
}
///@notice Verifies whether the contract is paused.
modifier whenPaused() {
require(paused);
_;
}
///@notice Pauses the contract.
function pause() external onlyAdmin whenNotPaused {
paused = true;
emit Paused();
}
///@notice Unpauses the contract and returns to normal state.
function unpause() external onlyAdmin whenPaused {
paused = false;
emit Unpaused();
}
} | ///@title This contract enables you to create pausable mechanism to stop in case of emergency. | NatSpecSingleLine | pause | function pause() external onlyAdmin whenNotPaused {
paused = true;
emit Paused();
}
| ///@notice Pauses the contract. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
398,
497
]
} | 55,736 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | CustomPausable | contract CustomPausable is CustomAdmin {
event Paused();
event Unpaused();
bool public paused = false;
///@notice Verifies whether the contract is not paused.
modifier whenNotPaused() {
require(!paused);
_;
}
///@notice Verifies whether the contract is paused.
modifier whenPaused() {
require(paused);
_;
}
///@notice Pauses the contract.
function pause() external onlyAdmin whenNotPaused {
paused = true;
emit Paused();
}
///@notice Unpauses the contract and returns to normal state.
function unpause() external onlyAdmin whenPaused {
paused = false;
emit Unpaused();
}
} | ///@title This contract enables you to create pausable mechanism to stop in case of emergency. | NatSpecSingleLine | unpause | function unpause() external onlyAdmin whenPaused {
paused = false;
emit Unpaused();
}
| ///@notice Unpauses the contract and returns to normal state. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
565,
666
]
} | 55,737 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | computeHash | function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
| ///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1136,
1255
]
} | 55,738 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | releaseTokenForTransfer | function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
| ///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1717,
1878
]
} | 55,739 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | disableTokenTransfers | function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
| ///@notice This function disables token transfers for everyone. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
1948,
2107
]
} | 55,740 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | setICOEndDate | function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
| ///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
2304,
2484
]
} | 55,741 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | mintTokens | function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
| ///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
2851,
3173
]
} | 55,742 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | mintOnce | function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
| ///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
3447,
3686
]
} | 55,743 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | mintTokensForAdvisors | function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
| //The tokens are only available to the advisors after 1 year of the ICO end. | LineComment | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
3867,
4052
]
} | 55,744 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | mintTokensForFounders | function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
| //The tokens are only available to the founders after 2 year of the ICO end. | LineComment | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
4233,
4419
]
} | 55,745 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | mintTokensForServices | function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
| //The tokens are only available to the services after 1 year of the ICO end. | LineComment | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
4596,
4781
]
} | 55,746 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | transfer | function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
| ///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
5155,
5331
]
} | 55,747 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
| ///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
5632,
5833
]
} | 55,748 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | approve | function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
| ///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
6129,
6318
]
} | 55,749 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | increaseApproval | function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
| ///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
6607,
6823
]
} | 55,750 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | decreaseApproval | function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
| ///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
7128,
7355
]
} | 55,751 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | sumOf | function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
| ///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
7478,
7695
]
} | 55,752 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | bulkTransfer | function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
| ///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
7969,
8495
]
} | 55,753 |
|
VRHToken | VRHToken.sol | 0x3c03e8b1c939bafe0b95ccc6efb2921a4fe289ac | Solidity | VRHToken | contract VRHToken is StandardToken, CustomPausable, BurnableToken {
uint8 public constant decimals = 18;
string public constant name = "VirtualRehab";
string public constant symbol = "VRH";
uint public constant MAX_SUPPLY = 400000000 * (10 ** uint256(decimals));
uint public constant INITIAL_SUPPLY = (400000000 - 1650000 - 2085000 - 60000000) * (10 ** uint256(decimals));
bool public released = false;
uint public ICOEndDate;
mapping(bytes32 => bool) private mintingList;
event Mint(address indexed to, uint256 amount);
event BulkTransferPerformed(address[] _destinations, uint256[] _amounts);
event TokenReleased(bool _state);
event ICOEndDateSet(uint256 _date);
///@notice Checks if the supplied address is able to perform transfers.
///@param _from The address to check against if the transfer is allowed.
modifier canTransfer(address _from) {
if(paused || !released) {
if(!isAdmin(_from)) {
revert();
}
}
_;
}
///@notice Computes keccak256 hash of the supplied value.
///@param _key The string value to compute hash from.
function computeHash(string _key) private pure returns(bytes32){
return keccak256(abi.encodePacked(_key));
}
///@notice Checks if the minting for the supplied key was already performed.
///@param _key The key or category name of minting.
modifier whenNotMinted(string _key) {
if(mintingList[computeHash(_key)]) {
revert();
}
_;
}
constructor() public {
mintTokens(msg.sender, INITIAL_SUPPLY);
}
///@notice This function enables token transfers for everyone.
///Can only be enabled after the end of the ICO.
function releaseTokenForTransfer() public onlyAdmin whenNotPaused {
require(!released);
released = true;
emit TokenReleased(released);
}
///@notice This function disables token transfers for everyone.
function disableTokenTransfers() public onlyAdmin whenNotPaused {
require(released);
released = false;
emit TokenReleased(released);
}
///@notice This function enables the whitelisted application (internal application) to set the ICO end date and can only be used once.
///@param _date The date to set as the ICO end date.
function setICOEndDate(uint _date) public onlyAdmin {
require(ICOEndDate == 0);
require(_date > now);
ICOEndDate = _date;
emit ICOEndDateSet(_date);
}
///@notice Mints the supplied value of the tokens to the destination address.
//Minting cannot be performed any further once the maximum supply is reached.
//This function is private and cannot be used by anyone except for this contract.
///@param _to The address which will receive the minted tokens.
///@param _value The amount of tokens to mint.
function mintTokens(address _to, uint _value) private {
require(_to != address(0));
require(totalSupply_.add(_value) <= MAX_SUPPLY);
balances[_to] = balances[_to].add(_value);
totalSupply_ = totalSupply_.add(_value);
emit Mint(_to, _value);
emit Transfer(address(0), _to, _value);
}
///@notice Mints the tokens only once against the supplied key (category).
///@param _key The key or the category of the allocation to mint the tokens for.
///@param _to The address receiving the minted tokens.
///@param _amount The amount of tokens to mint.
function mintOnce(string _key, address _to, uint256 _amount) private whenNotPaused whenNotMinted(_key) {
_amount = _amount * (10 ** uint256(decimals));
mintTokens(_to, _amount);
mintingList[computeHash(_key)] = true;
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab advisors.
//The tokens are only available to the advisors after 1 year of the ICO end.
function mintTokensForAdvisors() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 365 days));
mintOnce("advisors", msg.sender, 1650000);
}
///@notice Mints the below-mentioned amount of tokens allocated to the Virtual Rehab founders.
//The tokens are only available to the founders after 2 year of the ICO end.
function mintTokensForFounders() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 720 days));
mintOnce("founders", msg.sender, 60000000);
}
///@notice Mints the below-mentioned amount of tokens allocated to Virtual Rehab services.
//The tokens are only available to the services after 1 year of the ICO end.
function mintTokensForServices() public onlyAdmin {
require(ICOEndDate != 0);
require(now > (ICOEndDate + 60 days));
mintOnce("services", msg.sender, 2085000);
}
///@notice Transfers the specified value of VRH tokens to the destination address.
//Transfers can only happen when the tranfer state is enabled.
//Transfer state can only be enabled after the end of the crowdsale.
///@param _to The destination wallet address to transfer funds to.
///@param _value The amount of tokens to send to the destination address.
function transfer(address _to, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_to != address(0));
return super.transfer(_to, _value);
}
///@notice Transfers tokens from a specified wallet address.
///@dev This function is overriden to leverage transfer state feature.
///@param _from The address to transfer funds from.
///@param _to The address to transfer funds to.
///@param _value The amount of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from) public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
///@notice Approves a wallet address to spend on behalf of the sender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _value The amount of tokens approve to spend.
function approve(address _spender, uint256 _value) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.approve(_spender, _value);
}
///@notice Increases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address which is approved to spend on behalf of the sender.
///@param _addedValue The added amount of tokens approved to spend.
function increaseApproval(address _spender, uint256 _addedValue) public canTransfer(msg.sender) returns(bool) {
require(_spender != address(0));
return super.increaseApproval(_spender, _addedValue);
}
///@notice Decreases the approval of the spender.
///@dev This function is overriden to leverage transfer state feature.
///@param _spender The address of the spender to decrease the allocation from.
///@param _subtractedValue The amount of tokens to subtract from the approved allocation.
function decreaseApproval(address _spender, uint256 _subtractedValue) public canTransfer(msg.sender) returns (bool) {
require(_spender != address(0));
return super.decreaseApproval(_spender, _subtractedValue);
}
///@notice Returns the sum of supplied values.
///@param _values The collection of values to create the sum from.
function sumOf(uint256[] _values) private pure returns(uint256) {
uint256 total = 0;
for (uint256 i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
return total;
}
///@notice Allows only the admins and/or whitelisted applications to perform bulk transfer operation.
///@param _destinations The destination wallet addresses to send funds to.
///@param _amounts The respective amount of fund to send to the specified addresses.
function bulkTransfer(address[] _destinations, uint256[] _amounts) public onlyAdmin {
require(_destinations.length == _amounts.length);
//Saving gas by determining if the sender has enough balance
//to post this transaction.
uint256 requiredBalance = sumOf(_amounts);
require(balances[msg.sender] >= requiredBalance);
for (uint256 i = 0; i < _destinations.length; i++) {
transfer(_destinations[i], _amounts[i]);
}
emit BulkTransferPerformed(_destinations, _amounts);
}
///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature.
function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
} | ///@title Virtual Rehab Token (VRH) ERC20 Token Contract
///@author Binod Nirvan, Subramanian Venkatesan (http://virtualrehab.co)
///@notice The Virtual Rehab Token (VRH) has been created as a centralized currency
///to be used within the Virtual Rehab network. Users will be able to purchase and sell
///VRH tokens in exchanges. The token follows the standards of Ethereum ERC20 Standard token.
///Its design follows the widely adopted token implementation standards.
///This allows token holders to easily store and manage their VRH tokens using existing solutions
///including ERC20-compatible Ethereum wallets. The VRH Token is a utility token
///and is core to Virtual Rehab’s end-to-end operations.
///
///VRH utility use cases include:
///1. Order & Download Virtual Rehab programs through the Virtual Rehab Online Portal
///2. Request further analysis, conducted by Virtual Rehab's unique expert system (which leverages Artificial Intelligence), of the executed programs
///3. Receive incentives (VRH rewards) for seeking help and counselling from psychologists, therapists, or medical doctors
///4. Allows users to pay for services received at the Virtual Rehab Therapy Center | NatSpecSingleLine | burn | function burn(uint256 _value) public whenNotPaused {
super.burn(_value);
}
| ///@notice Burns the coins held by the sender.
///@param _value The amount of coins to burn.
///@dev This function is overriden to leverage Pausable feature. | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://7157090d1e6ef145885a8d2cbecf16fabd8c9e1285768fcbc4c4482502833660 | {
"func_code_index": [
8665,
8750
]
} | 55,754 |
|
Joylabor | Joylabor.sol | 0xd2a5885076aa5d21ab9c9cf8a5cd06d105638dd1 | Solidity | Joylabor | contract Joylabor {
address public owner;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract */
function Joylabor() {
owner = 0x0286CC45C6D24C6663a756AeF12942e086bd62f5;
name = 'Joylabor';
symbol = 'JL';
decimals = 18;
totalSupply = 10000000000000000000000000000; // 2e28
balanceOf[owner] = 10000000000000000000000000000;
}
/* Send coins */
function transfer(address _to, uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
/* Allow another contract to spend some tokens in your behalf */
function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/* A contract attempts to get the coins */
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(balanceOf[_from] >= _value);
require(allowance[_from][msg.sender] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
function burn(uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
totalSupply -= _value;
Burn(msg.sender, _value);
return true;
}
} | Joylabor | function Joylabor() {
owner = 0x0286CC45C6D24C6663a756AeF12942e086bd62f5;
name = 'Joylabor';
symbol = 'JL';
decimals = 18;
totalSupply = 10000000000000000000000000000; // 2e28
balanceOf[owner] = 10000000000000000000000000000;
}
| /* Initializes contract with initial supply tokens to the creator of the contract */ | Comment | v0.4.13+commit.fb4cb1a | bzzr://0fc332b9b73e766469f956179c220b990c45ff2e1598e6675aead5359bec00b6 | {
"func_code_index": [
660,
939
]
} | 55,755 |
|||
Joylabor | Joylabor.sol | 0xd2a5885076aa5d21ab9c9cf8a5cd06d105638dd1 | Solidity | Joylabor | contract Joylabor {
address public owner;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract */
function Joylabor() {
owner = 0x0286CC45C6D24C6663a756AeF12942e086bd62f5;
name = 'Joylabor';
symbol = 'JL';
decimals = 18;
totalSupply = 10000000000000000000000000000; // 2e28
balanceOf[owner] = 10000000000000000000000000000;
}
/* Send coins */
function transfer(address _to, uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
/* Allow another contract to spend some tokens in your behalf */
function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/* A contract attempts to get the coins */
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(balanceOf[_from] >= _value);
require(allowance[_from][msg.sender] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
function burn(uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
totalSupply -= _value;
Burn(msg.sender, _value);
return true;
}
} | transfer | function transfer(address _to, uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
| /* Send coins */ | Comment | v0.4.13+commit.fb4cb1a | bzzr://0fc332b9b73e766469f956179c220b990c45ff2e1598e6675aead5359bec00b6 | {
"func_code_index": [
964,
1233
]
} | 55,756 |
|||
Joylabor | Joylabor.sol | 0xd2a5885076aa5d21ab9c9cf8a5cd06d105638dd1 | Solidity | Joylabor | contract Joylabor {
address public owner;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract */
function Joylabor() {
owner = 0x0286CC45C6D24C6663a756AeF12942e086bd62f5;
name = 'Joylabor';
symbol = 'JL';
decimals = 18;
totalSupply = 10000000000000000000000000000; // 2e28
balanceOf[owner] = 10000000000000000000000000000;
}
/* Send coins */
function transfer(address _to, uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
/* Allow another contract to spend some tokens in your behalf */
function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/* A contract attempts to get the coins */
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(balanceOf[_from] >= _value);
require(allowance[_from][msg.sender] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
function burn(uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
totalSupply -= _value;
Burn(msg.sender, _value);
return true;
}
} | approve | function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
| /* Allow another contract to spend some tokens in your behalf */ | Comment | v0.4.13+commit.fb4cb1a | bzzr://0fc332b9b73e766469f956179c220b990c45ff2e1598e6675aead5359bec00b6 | {
"func_code_index": [
1306,
1462
]
} | 55,757 |
|||
Joylabor | Joylabor.sol | 0xd2a5885076aa5d21ab9c9cf8a5cd06d105638dd1 | Solidity | Joylabor | contract Joylabor {
address public owner;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
/* Initializes contract with initial supply tokens to the creator of the contract */
function Joylabor() {
owner = 0x0286CC45C6D24C6663a756AeF12942e086bd62f5;
name = 'Joylabor';
symbol = 'JL';
decimals = 18;
totalSupply = 10000000000000000000000000000; // 2e28
balanceOf[owner] = 10000000000000000000000000000;
}
/* Send coins */
function transfer(address _to, uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
/* Allow another contract to spend some tokens in your behalf */
function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/* A contract attempts to get the coins */
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(balanceOf[_from] >= _value);
require(allowance[_from][msg.sender] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
function burn(uint256 _value) returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
totalSupply -= _value;
Burn(msg.sender, _value);
return true;
}
} | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require(balanceOf[_from] >= _value);
require(allowance[_from][msg.sender] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
| /* A contract attempts to get the coins */ | Comment | v0.4.13+commit.fb4cb1a | bzzr://0fc332b9b73e766469f956179c220b990c45ff2e1598e6675aead5359bec00b6 | {
"func_code_index": [
1513,
1889
]
} | 55,758 |
|||
TokenERC20 | TokenERC20.sol | 0x1c3c649566115e0f306118dcbb3077000dfce046 | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
} | TokenERC20 | function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
| /**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://d8d5bb5673af2efbe50fca5a5c1f6fc159300cf33174fb2ce32840944f9e0896 | {
"func_code_index": [
1015,
1560
]
} | 55,759 |
|||
TokenERC20 | TokenERC20.sol | 0x1c3c649566115e0f306118dcbb3077000dfce046 | Solidity | TokenERC20 | contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
} | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
| /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://d8d5bb5673af2efbe50fca5a5c1f6fc159300cf33174fb2ce32840944f9e0896 | {
"func_code_index": [
1644,
2487
]
} | 55,760 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.