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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | KEKEcon | function KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
| /* Initializes contract with initial supply tokens to the creator of the contract */ | Comment | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
719,
1218
]
} | 0 |
|||
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | _transfer | function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
| /* Internal transfer, only can be called by this contract */ | Comment | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
1287,
1888
]
} | 1 |
|||
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | transfer | function transfer(address _to, uint256 _value) {
_transfer(msg.sender, _to, _value);
}
| /// @notice Send `_value` tokens to `_to` from your account
/// @param _to The address of the recipient
/// @param _value the amount to send | NatSpecSingleLine | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
2047,
2152
]
} | 2 |
|||
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /// @notice Send `_value` tokens to `_to` in behalf of `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value the amount to send | NatSpecSingleLine | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
2362,
2657
]
} | 3 |
|||
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | approve | function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
| /// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend | NatSpecSingleLine | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
2858,
3027
]
} | 4 |
|||
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
| /// @notice Allows `_spender` to spend no more than `_value` tokens in 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 | NatSpecSingleLine | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
3348,
3684
]
} | 5 |
|||
KEKEcon | KEKEcon.sol | 0x3d7e4eb0facef2aaffaa07b7a61c7c1c49ffa2d4 | Solidity | KEKEcon | contract KEKEcon{
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
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 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 KEKEcon(){
balanceOf[msg.sender] = 100000000000000000; // Give the creator all initial tokens
totalSupply = 100000000000000000; // Update total supply
name = "KEKEcon"; // Set the name for display purposes
symbol = "KEKEcon"; // Set the symbol for display purposes
decimals = 8; // Amount of decimals for display purposes
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice 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) {
_transfer(msg.sender, _to, _value);
}
/// @notice Send `_value` tokens to `_to` in 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) returns (bool success) {
require (_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in your behalf
/// @param _spender The address authorized to spend
/// @param _value the max amount they can spend
function approve(address _spender, uint256 _value)
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/// @notice Allows `_spender` to spend no more than `_value` tokens in 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)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn
function burn(uint256 _value) 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;
}
function burnFrom(address _from, uint256 _value) 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;
}
function getBalance(address addr) public view returns(uint256) {
return balanceOf[addr];
}
} | burn | function burn(uint256 _value) 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;
}
| /// @notice Remove `_value` tokens from the system irreversibly
/// @param _value the amount of money to burn | NatSpecSingleLine | v0.4.23-nightly.2018.4.17+commit.5499db01 | bzzr://1d3b178f91e40d136cf4e04a3ba2615aa41be6c40e35dec09e0f910960426751 | {
"func_code_index": [
3807,
4204
]
} | 6 |
|||
Presale | contracts/IPricingStrategy.sol | 0x0062179227c03efc81301ade144f447f2561edd5 | Solidity | IPricingStrategy | interface IPricingStrategy {
function isPricingStrategy() public view returns (bool);
/** Calculate the current price for buy in amount. */
function calculateTokenAmount(uint weiAmount, uint tokensSold) public view returns (uint tokenAmount);
} | calculateTokenAmount | function calculateTokenAmount(uint weiAmount, uint tokensSold) public view returns (uint tokenAmount);
| /** Calculate the current price for buy in amount. */ | NatSpecMultiLine | v0.4.21+commit.dfe3193c | bzzr://ba3c28fc7c70f348a38a5db1f33070032de92318ad1c5d463b543499c5492020 | {
"func_code_index": [
155,
262
]
} | 7 |
|||
ZCDistribution | contracts/ZCDistribution.sol | 0x8c58694bffb6d61fc335c5ff7b6831df88a2961f | Solidity | ZCDistribution | contract ZCDistribution is Claimable {
// Total amount of airdrops that happend
uint256 public numDrops;
// Total amount of tokens dropped
uint256 public dropAmount;
// Address of the Token
address public tokenAddress;
/**
* @param _tokenAddr The Address of the Token
*/
constructor(address _tokenAddr) public {
assert(_tokenAddr != address(0));
tokenAddress = _tokenAddr;
}
/**
* @dev Event when reward is distributed to consumer
* @param receiver Consumer address
* @param amount Amount of tokens distributed
*/
event RewardDistributed(address receiver, uint amount);
/**
* @dev Distributes the rewards to the consumers. Returns the amount of customers that received tokens. Can only be called by Owner
* @param dests Array of cosumer addresses
* @param values Array of token amounts to distribute to each client
*/
function multisend(address[] dests, uint256[] values) public onlyOwner returns (uint256) {
assert(dests.length == values.length);
uint256 i = 0;
while (i < dests.length) {
assert(ERC20Basic(tokenAddress).transfer(dests[i], values[i]));
emit RewardDistributed(dests[i], values[i]);
dropAmount += values[i];
i += 1;
}
numDrops += dests.length;
return i;
}
/**
* @dev Returns the Amount of tokens issued to consumers
*/
function getSentAmount() external view returns (uint256) {
return dropAmount;
}
} | /**
* @title ZCDistribution
*
* Used to distribute rewards to consumers
*
* (c) Philip Louw / Zero Carbon Project 2018. The MIT Licence.
*/ | NatSpecMultiLine | multisend | function multisend(address[] dests, uint256[] values) public onlyOwner returns (uint256) {
assert(dests.length == values.length);
uint256 i = 0;
while (i < dests.length) {
assert(ERC20Basic(tokenAddress).transfer(dests[i], values[i]));
emit RewardDistributed(dests[i], values[i]);
dropAmount += values[i];
i += 1;
}
numDrops += dests.length;
return i;
}
| /**
* @dev Distributes the rewards to the consumers. Returns the amount of customers that received tokens. Can only be called by Owner
* @param dests Array of cosumer addresses
* @param values Array of token amounts to distribute to each client
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://ddc4a1ebf9801a8697e26b95dec80d39d4c376a538bb3bf50597ec12a4b6ac8d | {
"func_code_index": [
957,
1426
]
} | 8 |
|
ZCDistribution | contracts/ZCDistribution.sol | 0x8c58694bffb6d61fc335c5ff7b6831df88a2961f | Solidity | ZCDistribution | contract ZCDistribution is Claimable {
// Total amount of airdrops that happend
uint256 public numDrops;
// Total amount of tokens dropped
uint256 public dropAmount;
// Address of the Token
address public tokenAddress;
/**
* @param _tokenAddr The Address of the Token
*/
constructor(address _tokenAddr) public {
assert(_tokenAddr != address(0));
tokenAddress = _tokenAddr;
}
/**
* @dev Event when reward is distributed to consumer
* @param receiver Consumer address
* @param amount Amount of tokens distributed
*/
event RewardDistributed(address receiver, uint amount);
/**
* @dev Distributes the rewards to the consumers. Returns the amount of customers that received tokens. Can only be called by Owner
* @param dests Array of cosumer addresses
* @param values Array of token amounts to distribute to each client
*/
function multisend(address[] dests, uint256[] values) public onlyOwner returns (uint256) {
assert(dests.length == values.length);
uint256 i = 0;
while (i < dests.length) {
assert(ERC20Basic(tokenAddress).transfer(dests[i], values[i]));
emit RewardDistributed(dests[i], values[i]);
dropAmount += values[i];
i += 1;
}
numDrops += dests.length;
return i;
}
/**
* @dev Returns the Amount of tokens issued to consumers
*/
function getSentAmount() external view returns (uint256) {
return dropAmount;
}
} | /**
* @title ZCDistribution
*
* Used to distribute rewards to consumers
*
* (c) Philip Louw / Zero Carbon Project 2018. The MIT Licence.
*/ | NatSpecMultiLine | getSentAmount | function getSentAmount() external view returns (uint256) {
return dropAmount;
}
| /**
* @dev Returns the Amount of tokens issued to consumers
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://ddc4a1ebf9801a8697e26b95dec80d39d4c376a538bb3bf50597ec12a4b6ac8d | {
"func_code_index": [
1510,
1608
]
} | 9 |
|
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | 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);
} | totalSupply | function totalSupply() constant returns (uint256 supply) {}
| /// @return total amount of tokens | NatSpecSingleLine | v0.4.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
64,
128
]
} | 10 |
|||
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | 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);
} | balanceOf | function balanceOf(address _owner) constant returns (uint256 balance) {}
| /// @param _owner The address from which the balance will be retrieved
/// @return The balance | NatSpecSingleLine | v0.4.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
242,
319
]
} | 11 |
|||
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | 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);
} | 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.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
566,
643
]
} | 12 |
|||
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | 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);
} | 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.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
978,
1074
]
} | 13 |
|||
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | 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);
} | 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.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
1368,
1449
]
} | 14 |
|||
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | 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);
} | 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.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
1665,
1762
]
} | 15 |
|||
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | Solidity | Breakbits | contract Breakbits is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether.
string public symbol; //An identifier: eg SBX
string public version = 'H1.0'; //human 0.1 standard. Just an arbitrary versioning scheme.
//
// CHANGE THESE VALUES FOR YOUR TOKEN
//
//make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token
function Breakbits(
) {
balances[msg.sender] = 900000; // Give the creator all initial tokens (100000 for example)
totalSupply = 900000; // Update total supply (100000 for example)
name = "Breakbits"; // Set the name for display purposes
decimals = 0; // Amount of decimals for display purposes
symbol = "BR20"; // Set the symbol for display purposes
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
return true;
}
} | //name this contract whatever you'd like | LineComment | Breakbits | function Breakbits(
) {
balances[msg.sender] = 900000; // Give the creator all initial tokens (100000 for example)
totalSupply = 900000; // Update total supply (100000 for example)
name = "Breakbits"; // Set the name for display purposes
decimals = 0; // Amount of decimals for display purposes
symbol = "BR20"; // Set the symbol for display purposes
}
| //human 0.1 standard. Just an arbitrary versioning scheme.
//
// CHANGE THESE VALUES FOR YOUR TOKEN
//
//make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
1198,
1756
]
} | 16 |
|
Breakbits | Breakbits.sol | 0x89f3cda50198aca4adde4d2a1a32c6d378eef380 | Solidity | Breakbits | contract Breakbits is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether.
string public symbol; //An identifier: eg SBX
string public version = 'H1.0'; //human 0.1 standard. Just an arbitrary versioning scheme.
//
// CHANGE THESE VALUES FOR YOUR TOKEN
//
//make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token
function Breakbits(
) {
balances[msg.sender] = 900000; // Give the creator all initial tokens (100000 for example)
totalSupply = 900000; // Update total supply (100000 for example)
name = "Breakbits"; // Set the name for display purposes
decimals = 0; // Amount of decimals for display purposes
symbol = "BR20"; // Set the symbol for display purposes
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
return true;
}
} | //name this contract whatever you'd like | LineComment | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
return true;
}
| /* Approves and then calls the receiving contract */ | Comment | v0.4.25+commit.59dbf8f1 | bzzr://bcbbe5b08c4231f1a6e361f37f8464328618282025c98de5a51db7ecc95782b9 | {
"func_code_index": [
1821,
2642
]
} | 17 |
|
Crowdsale | Crowdsale.sol | 0x0069e491f2ed9e562a7c9c92ba40f73d946718e0 | Solidity | SafeMath | contract SafeMath {
//internals
function safeMul(uint a, uint b) internal returns(uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns(uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns(uint) {
uint c = a + b;
assert(c >= a && c >= b);
return c;
}
} | safeMul | function safeMul(uint a, uint b) internal returns(uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
| //internals | LineComment | v0.4.24+commit.e67f0147 | bzzr://c98d29b66a132aa590ecef7727d8f421be44503e0c062933e4b703c914875cb1 | {
"func_code_index": [
40,
192
]
} | 18 |
|||
Crowdsale | Crowdsale.sol | 0x0069e491f2ed9e562a7c9c92ba40f73d946718e0 | Solidity | Crowdsale | contract Crowdsale is owned, SafeMath {
address public beneficiary;
uint public fundingGoal;
uint public amountRaised; //The amount being raised by the crowdsale
uint public deadline; /* the end date of the crowdsale*/
uint public rate; //rate for the crowdsale
uint public tokenDecimals;
token public tokenReward; //
uint public tokensSold = 0; //the amount of UzmanbuCoin sold
uint public start; /* the start date of the crowdsale*/
uint public bonusEndDate;
mapping(address => uint256) public balanceOf; //Ether deposited by the investor
bool crowdsaleClosed = false; //It will be true when the crowsale gets closed
event GoalReached(address beneficiary, uint capital);
event FundTransfer(address backer, uint amount, bool isContribution);
/**
* Constrctor function
*
* Setup the owner
*/
function Crowdsale( ) {
beneficiary = 0xe579891b98a3f58e26c4b2edb54e22250899363c;
rate = 80000; // 8.000.000 TORC/Ether
tokenDecimals=8;
fundingGoal = 2500000000 * (10 ** tokenDecimals);
start = 1536537600; //
deadline = 1539129600; //
bonusEndDate =1537156800;
tokenReward = token(0xBD64a0d7330bc16c30aA1AE34eD2C329F6DB49C9); //Token address. Modify by the current token address
}
/**
* Fallback function
*
* The function without name is the default function that is called whenever anyone sends funds to a contract
*/
/*
*/
function () payable {
uint amount = msg.value; //amount received by the contract
uint numTokens; //number of token which will be send to the investor
numTokens = getNumTokens(amount); //It will be true if the soft capital was reached
require(numTokens>0 && !crowdsaleClosed && now > start && now < deadline);
balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount);
amountRaised = safeAdd(amountRaised, amount); //Amount raised increments with the amount received by the investor
tokensSold += numTokens; //Tokens sold increased too
tokenReward.transfer(msg.sender, numTokens); //The contract sends the corresponding tokens to the investor
beneficiary.transfer(amount); //Forward ether to beneficiary
FundTransfer(msg.sender, amount, true);
}
/*
It calculates the amount of tokens to send to the investor
*/
function getNumTokens(uint _value) internal returns(uint numTokens) {
require(_value>=10000000000000000 * 1 wei); //Min amount to invest: 0.01 ETH
numTokens = safeMul(_value,rate)/(10 ** tokenDecimals); //Number of tokens to give is equal to the amount received by the rate
if(now <= bonusEndDate){
if(_value>= 1 ether && _value< 5 * 1 ether){ // +15% tokens
numTokens += safeMul(numTokens,15)/100;
}else if(_value>=5 * 1 ether){ // +35% tokens
numTokens += safeMul(numTokens,35)/100;
}
}
return numTokens;
}
function changeBeneficiary(address newBeneficiary) onlyOwner {
beneficiary = newBeneficiary;
}
modifier afterDeadline() { if (now >= deadline) _; }
/**
* Check if goal was reached
*
* Checks if the goal or time limit has been reached and ends the campaign and burn the tokens
*/
function checkGoalReached() afterDeadline {
require(msg.sender == owner); //Checks if the one who executes the function is the owner of the contract
if (tokensSold >=fundingGoal){
GoalReached(beneficiary, amountRaised);
}
tokenReward.burn(tokenReward.balanceOf(this)); //Burns all the remaining tokens in the contract
crowdsaleClosed = true; //The crowdsale gets closed if it has expired
}
} | Crowdsale | function Crowdsale( ) {
beneficiary = 0xe579891b98a3f58e26c4b2edb54e22250899363c;
rate = 80000; // 8.000.000 TORC/Ether
tokenDecimals=8;
fundingGoal = 2500000000 * (10 ** tokenDecimals);
start = 1536537600; //
deadline = 1539129600; //
bonusEndDate =1537156800;
tokenReward = token(0xBD64a0d7330bc16c30aA1AE34eD2C329F6DB49C9); //Token address. Modify by the current token address
}
| /**
* Constrctor function
*
* Setup the owner
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://c98d29b66a132aa590ecef7727d8f421be44503e0c062933e4b703c914875cb1 | {
"func_code_index": [
901,
1380
]
} | 19 |
|||
Crowdsale | Crowdsale.sol | 0x0069e491f2ed9e562a7c9c92ba40f73d946718e0 | Solidity | Crowdsale | contract Crowdsale is owned, SafeMath {
address public beneficiary;
uint public fundingGoal;
uint public amountRaised; //The amount being raised by the crowdsale
uint public deadline; /* the end date of the crowdsale*/
uint public rate; //rate for the crowdsale
uint public tokenDecimals;
token public tokenReward; //
uint public tokensSold = 0; //the amount of UzmanbuCoin sold
uint public start; /* the start date of the crowdsale*/
uint public bonusEndDate;
mapping(address => uint256) public balanceOf; //Ether deposited by the investor
bool crowdsaleClosed = false; //It will be true when the crowsale gets closed
event GoalReached(address beneficiary, uint capital);
event FundTransfer(address backer, uint amount, bool isContribution);
/**
* Constrctor function
*
* Setup the owner
*/
function Crowdsale( ) {
beneficiary = 0xe579891b98a3f58e26c4b2edb54e22250899363c;
rate = 80000; // 8.000.000 TORC/Ether
tokenDecimals=8;
fundingGoal = 2500000000 * (10 ** tokenDecimals);
start = 1536537600; //
deadline = 1539129600; //
bonusEndDate =1537156800;
tokenReward = token(0xBD64a0d7330bc16c30aA1AE34eD2C329F6DB49C9); //Token address. Modify by the current token address
}
/**
* Fallback function
*
* The function without name is the default function that is called whenever anyone sends funds to a contract
*/
/*
*/
function () payable {
uint amount = msg.value; //amount received by the contract
uint numTokens; //number of token which will be send to the investor
numTokens = getNumTokens(amount); //It will be true if the soft capital was reached
require(numTokens>0 && !crowdsaleClosed && now > start && now < deadline);
balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount);
amountRaised = safeAdd(amountRaised, amount); //Amount raised increments with the amount received by the investor
tokensSold += numTokens; //Tokens sold increased too
tokenReward.transfer(msg.sender, numTokens); //The contract sends the corresponding tokens to the investor
beneficiary.transfer(amount); //Forward ether to beneficiary
FundTransfer(msg.sender, amount, true);
}
/*
It calculates the amount of tokens to send to the investor
*/
function getNumTokens(uint _value) internal returns(uint numTokens) {
require(_value>=10000000000000000 * 1 wei); //Min amount to invest: 0.01 ETH
numTokens = safeMul(_value,rate)/(10 ** tokenDecimals); //Number of tokens to give is equal to the amount received by the rate
if(now <= bonusEndDate){
if(_value>= 1 ether && _value< 5 * 1 ether){ // +15% tokens
numTokens += safeMul(numTokens,15)/100;
}else if(_value>=5 * 1 ether){ // +35% tokens
numTokens += safeMul(numTokens,35)/100;
}
}
return numTokens;
}
function changeBeneficiary(address newBeneficiary) onlyOwner {
beneficiary = newBeneficiary;
}
modifier afterDeadline() { if (now >= deadline) _; }
/**
* Check if goal was reached
*
* Checks if the goal or time limit has been reached and ends the campaign and burn the tokens
*/
function checkGoalReached() afterDeadline {
require(msg.sender == owner); //Checks if the one who executes the function is the owner of the contract
if (tokensSold >=fundingGoal){
GoalReached(beneficiary, amountRaised);
}
tokenReward.burn(tokenReward.balanceOf(this)); //Burns all the remaining tokens in the contract
crowdsaleClosed = true; //The crowdsale gets closed if it has expired
}
} | function () payable {
uint amount = msg.value; //amount received by the contract
uint numTokens; //number of token which will be send to the investor
numTokens = getNumTokens(amount); //It will be true if the soft capital was reached
require(numTokens>0 && !crowdsaleClosed && now > start && now < deadline);
balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount);
amountRaised = safeAdd(amountRaised, amount); //Amount raised increments with the amount received by the investor
tokensSold += numTokens; //Tokens sold increased too
tokenReward.transfer(msg.sender, numTokens); //The contract sends the corresponding tokens to the investor
beneficiary.transfer(amount); //Forward ether to beneficiary
FundTransfer(msg.sender, amount, true);
}
| /*
*/ | Comment | v0.4.24+commit.e67f0147 | bzzr://c98d29b66a132aa590ecef7727d8f421be44503e0c062933e4b703c914875cb1 | {
"func_code_index": [
1573,
2439
]
} | 20 |
||||
Crowdsale | Crowdsale.sol | 0x0069e491f2ed9e562a7c9c92ba40f73d946718e0 | Solidity | Crowdsale | contract Crowdsale is owned, SafeMath {
address public beneficiary;
uint public fundingGoal;
uint public amountRaised; //The amount being raised by the crowdsale
uint public deadline; /* the end date of the crowdsale*/
uint public rate; //rate for the crowdsale
uint public tokenDecimals;
token public tokenReward; //
uint public tokensSold = 0; //the amount of UzmanbuCoin sold
uint public start; /* the start date of the crowdsale*/
uint public bonusEndDate;
mapping(address => uint256) public balanceOf; //Ether deposited by the investor
bool crowdsaleClosed = false; //It will be true when the crowsale gets closed
event GoalReached(address beneficiary, uint capital);
event FundTransfer(address backer, uint amount, bool isContribution);
/**
* Constrctor function
*
* Setup the owner
*/
function Crowdsale( ) {
beneficiary = 0xe579891b98a3f58e26c4b2edb54e22250899363c;
rate = 80000; // 8.000.000 TORC/Ether
tokenDecimals=8;
fundingGoal = 2500000000 * (10 ** tokenDecimals);
start = 1536537600; //
deadline = 1539129600; //
bonusEndDate =1537156800;
tokenReward = token(0xBD64a0d7330bc16c30aA1AE34eD2C329F6DB49C9); //Token address. Modify by the current token address
}
/**
* Fallback function
*
* The function without name is the default function that is called whenever anyone sends funds to a contract
*/
/*
*/
function () payable {
uint amount = msg.value; //amount received by the contract
uint numTokens; //number of token which will be send to the investor
numTokens = getNumTokens(amount); //It will be true if the soft capital was reached
require(numTokens>0 && !crowdsaleClosed && now > start && now < deadline);
balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount);
amountRaised = safeAdd(amountRaised, amount); //Amount raised increments with the amount received by the investor
tokensSold += numTokens; //Tokens sold increased too
tokenReward.transfer(msg.sender, numTokens); //The contract sends the corresponding tokens to the investor
beneficiary.transfer(amount); //Forward ether to beneficiary
FundTransfer(msg.sender, amount, true);
}
/*
It calculates the amount of tokens to send to the investor
*/
function getNumTokens(uint _value) internal returns(uint numTokens) {
require(_value>=10000000000000000 * 1 wei); //Min amount to invest: 0.01 ETH
numTokens = safeMul(_value,rate)/(10 ** tokenDecimals); //Number of tokens to give is equal to the amount received by the rate
if(now <= bonusEndDate){
if(_value>= 1 ether && _value< 5 * 1 ether){ // +15% tokens
numTokens += safeMul(numTokens,15)/100;
}else if(_value>=5 * 1 ether){ // +35% tokens
numTokens += safeMul(numTokens,35)/100;
}
}
return numTokens;
}
function changeBeneficiary(address newBeneficiary) onlyOwner {
beneficiary = newBeneficiary;
}
modifier afterDeadline() { if (now >= deadline) _; }
/**
* Check if goal was reached
*
* Checks if the goal or time limit has been reached and ends the campaign and burn the tokens
*/
function checkGoalReached() afterDeadline {
require(msg.sender == owner); //Checks if the one who executes the function is the owner of the contract
if (tokensSold >=fundingGoal){
GoalReached(beneficiary, amountRaised);
}
tokenReward.burn(tokenReward.balanceOf(this)); //Burns all the remaining tokens in the contract
crowdsaleClosed = true; //The crowdsale gets closed if it has expired
}
} | getNumTokens | function getNumTokens(uint _value) internal returns(uint numTokens) {
require(_value>=10000000000000000 * 1 wei); //Min amount to invest: 0.01 ETH
numTokens = safeMul(_value,rate)/(10 ** tokenDecimals); //Number of tokens to give is equal to the amount received by the rate
if(now <= bonusEndDate){
if(_value>= 1 ether && _value< 5 * 1 ether){ // +15% tokens
numTokens += safeMul(numTokens,15)/100;
}else if(_value>=5 * 1 ether){ // +35% tokens
numTokens += safeMul(numTokens,35)/100;
}
}
return numTokens;
}
| /*
It calculates the amount of tokens to send to the investor
*/ | Comment | v0.4.24+commit.e67f0147 | bzzr://c98d29b66a132aa590ecef7727d8f421be44503e0c062933e4b703c914875cb1 | {
"func_code_index": [
2521,
3183
]
} | 21 |
|||
Crowdsale | Crowdsale.sol | 0x0069e491f2ed9e562a7c9c92ba40f73d946718e0 | Solidity | Crowdsale | contract Crowdsale is owned, SafeMath {
address public beneficiary;
uint public fundingGoal;
uint public amountRaised; //The amount being raised by the crowdsale
uint public deadline; /* the end date of the crowdsale*/
uint public rate; //rate for the crowdsale
uint public tokenDecimals;
token public tokenReward; //
uint public tokensSold = 0; //the amount of UzmanbuCoin sold
uint public start; /* the start date of the crowdsale*/
uint public bonusEndDate;
mapping(address => uint256) public balanceOf; //Ether deposited by the investor
bool crowdsaleClosed = false; //It will be true when the crowsale gets closed
event GoalReached(address beneficiary, uint capital);
event FundTransfer(address backer, uint amount, bool isContribution);
/**
* Constrctor function
*
* Setup the owner
*/
function Crowdsale( ) {
beneficiary = 0xe579891b98a3f58e26c4b2edb54e22250899363c;
rate = 80000; // 8.000.000 TORC/Ether
tokenDecimals=8;
fundingGoal = 2500000000 * (10 ** tokenDecimals);
start = 1536537600; //
deadline = 1539129600; //
bonusEndDate =1537156800;
tokenReward = token(0xBD64a0d7330bc16c30aA1AE34eD2C329F6DB49C9); //Token address. Modify by the current token address
}
/**
* Fallback function
*
* The function without name is the default function that is called whenever anyone sends funds to a contract
*/
/*
*/
function () payable {
uint amount = msg.value; //amount received by the contract
uint numTokens; //number of token which will be send to the investor
numTokens = getNumTokens(amount); //It will be true if the soft capital was reached
require(numTokens>0 && !crowdsaleClosed && now > start && now < deadline);
balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount);
amountRaised = safeAdd(amountRaised, amount); //Amount raised increments with the amount received by the investor
tokensSold += numTokens; //Tokens sold increased too
tokenReward.transfer(msg.sender, numTokens); //The contract sends the corresponding tokens to the investor
beneficiary.transfer(amount); //Forward ether to beneficiary
FundTransfer(msg.sender, amount, true);
}
/*
It calculates the amount of tokens to send to the investor
*/
function getNumTokens(uint _value) internal returns(uint numTokens) {
require(_value>=10000000000000000 * 1 wei); //Min amount to invest: 0.01 ETH
numTokens = safeMul(_value,rate)/(10 ** tokenDecimals); //Number of tokens to give is equal to the amount received by the rate
if(now <= bonusEndDate){
if(_value>= 1 ether && _value< 5 * 1 ether){ // +15% tokens
numTokens += safeMul(numTokens,15)/100;
}else if(_value>=5 * 1 ether){ // +35% tokens
numTokens += safeMul(numTokens,35)/100;
}
}
return numTokens;
}
function changeBeneficiary(address newBeneficiary) onlyOwner {
beneficiary = newBeneficiary;
}
modifier afterDeadline() { if (now >= deadline) _; }
/**
* Check if goal was reached
*
* Checks if the goal or time limit has been reached and ends the campaign and burn the tokens
*/
function checkGoalReached() afterDeadline {
require(msg.sender == owner); //Checks if the one who executes the function is the owner of the contract
if (tokensSold >=fundingGoal){
GoalReached(beneficiary, amountRaised);
}
tokenReward.burn(tokenReward.balanceOf(this)); //Burns all the remaining tokens in the contract
crowdsaleClosed = true; //The crowdsale gets closed if it has expired
}
} | checkGoalReached | function checkGoalReached() afterDeadline {
require(msg.sender == owner); //Checks if the one who executes the function is the owner of the contract
if (tokensSold >=fundingGoal){
GoalReached(beneficiary, amountRaised);
}
tokenReward.burn(tokenReward.balanceOf(this)); //Burns all the remaining tokens in the contract
crowdsaleClosed = true; //The crowdsale gets closed if it has expired
}
| /**
* Check if goal was reached
*
* Checks if the goal or time limit has been reached and ends the campaign and burn the tokens
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://c98d29b66a132aa590ecef7727d8f421be44503e0c062933e4b703c914875cb1 | {
"func_code_index": [
3522,
3980
]
} | 22 |
|||
TangentStake | TangentStake.sol | 0x5db4b520284049d7dcb21c6317664190791bb8e5 | Solidity | TangentStake | contract TangentStake is Owned {
// prevents overflows
using SafeMath for uint;
// represents a purchase object
// addr is the buying address
// amount is the number of wei in the purchase
// sf is the sum of (purchase amount / sum of previous purchase amounts)
struct Purchase {
address addr;
uint amount;
uint sf;
}
// Purchase object array that holds entire purchase history
Purchase[] purchases;
// tangents are rewarded along with Ether upon cashing out
Tangent tokenContract;
// the rate of tangents to ether is multiplier / divisor
uint multiplier;
uint divisor;
// accuracy multiplier
uint acm;
uint netStakes;
// logged when a purchase is made
event PurchaseEvent(uint index, address addr, uint eth, uint sf);
// logged when a person cashes out or the contract is destroyed
event CashOutEvent(uint index, address addr, uint eth, uint tangles);
event NetStakesChange(uint netStakes);
// logged when the rate of tangents to ether is decreased
event Revaluation(uint oldMul, uint oldDiv, uint newMul, uint newDiv);
// constructor, sets initial rate to 1000 TAN per 1 Ether
function TangentStake(address tokenAddress) public {
tokenContract = Tangent(tokenAddress);
multiplier = 1000;
divisor = 1;
acm = 10**18;
netStakes = 0;
}
// decreases the rate of Tangents to Ether, the contract cannot be told
// to give out more Tangents per Ether, only fewer.
function revalue(uint newMul, uint newDiv) public onlyOwner {
require( (newMul.div(newDiv)) <= (multiplier.div(divisor)) );
Revaluation(multiplier, divisor, newMul, newDiv);
multiplier = newMul;
divisor = newDiv;
return;
}
// returns the current amount of wei that will be given for the purchase
// at purchases[index]
function getEarnings(uint index) public constant returns (uint earnings, uint amount) {
Purchase memory cpurchase;
Purchase memory lpurchase;
cpurchase = purchases[index];
amount = cpurchase.amount;
if (cpurchase.addr == address(0)) {
return (0, amount);
}
earnings = (index == 0) ? acm : 0;
lpurchase = purchases[purchases.length-1];
earnings = earnings.add( lpurchase.sf.sub(cpurchase.sf) );
earnings = earnings.mul(amount).div(acm);
return (earnings, amount);
}
// Cash out Ether and Tangent at for the purchase at index "index".
// All of the Ether and Tangent associated with with that purchase will
// be sent to recipient, and no future withdrawals can be made for the
// purchase.
function cashOut(uint index) public {
require(0 <= index && index < purchases.length);
require(purchases[index].addr == msg.sender);
uint earnings;
uint amount;
uint tangles;
(earnings, amount) = getEarnings(index);
purchases[index].addr = address(0);
require(earnings != 0 && amount != 0);
netStakes = netStakes.sub(amount);
tangles = earnings.mul(multiplier).div(divisor);
CashOutEvent(index, msg.sender, earnings, tangles);
NetStakesChange(netStakes);
tokenContract.transfer(msg.sender, tangles);
msg.sender.transfer(earnings);
return;
}
// The fallback function used to purchase stakes
// sf is the sum of the proportions of:
// (ether of current purchase / sum of ether prior to purchase)
// It is used to calculate earnings upon withdrawal.
function () public payable {
require(msg.value != 0);
uint index = purchases.length;
uint sf;
uint f;
if (index == 0) {
sf = 0;
} else {
f = msg.value.mul(acm).div(netStakes);
sf = purchases[index-1].sf.add(f);
}
netStakes = netStakes.add(msg.value);
purchases.push(Purchase(msg.sender, msg.value, sf));
NetStakesChange(netStakes);
PurchaseEvent(index, msg.sender, msg.value, sf);
return;
}
} | TangentStake | function TangentStake(address tokenAddress) public {
tokenContract = Tangent(tokenAddress);
multiplier = 1000;
divisor = 1;
acm = 10**18;
netStakes = 0;
}
| // constructor, sets initial rate to 1000 TAN per 1 Ether | LineComment | v0.4.20+commit.3155dd80 | bzzr://fd10ee54578c0b64fc35a5085b768db7aa513868eae12cd89826e489514eb8ef | {
"func_code_index": [
1303,
1512
]
} | 23 |
|||
TangentStake | TangentStake.sol | 0x5db4b520284049d7dcb21c6317664190791bb8e5 | Solidity | TangentStake | contract TangentStake is Owned {
// prevents overflows
using SafeMath for uint;
// represents a purchase object
// addr is the buying address
// amount is the number of wei in the purchase
// sf is the sum of (purchase amount / sum of previous purchase amounts)
struct Purchase {
address addr;
uint amount;
uint sf;
}
// Purchase object array that holds entire purchase history
Purchase[] purchases;
// tangents are rewarded along with Ether upon cashing out
Tangent tokenContract;
// the rate of tangents to ether is multiplier / divisor
uint multiplier;
uint divisor;
// accuracy multiplier
uint acm;
uint netStakes;
// logged when a purchase is made
event PurchaseEvent(uint index, address addr, uint eth, uint sf);
// logged when a person cashes out or the contract is destroyed
event CashOutEvent(uint index, address addr, uint eth, uint tangles);
event NetStakesChange(uint netStakes);
// logged when the rate of tangents to ether is decreased
event Revaluation(uint oldMul, uint oldDiv, uint newMul, uint newDiv);
// constructor, sets initial rate to 1000 TAN per 1 Ether
function TangentStake(address tokenAddress) public {
tokenContract = Tangent(tokenAddress);
multiplier = 1000;
divisor = 1;
acm = 10**18;
netStakes = 0;
}
// decreases the rate of Tangents to Ether, the contract cannot be told
// to give out more Tangents per Ether, only fewer.
function revalue(uint newMul, uint newDiv) public onlyOwner {
require( (newMul.div(newDiv)) <= (multiplier.div(divisor)) );
Revaluation(multiplier, divisor, newMul, newDiv);
multiplier = newMul;
divisor = newDiv;
return;
}
// returns the current amount of wei that will be given for the purchase
// at purchases[index]
function getEarnings(uint index) public constant returns (uint earnings, uint amount) {
Purchase memory cpurchase;
Purchase memory lpurchase;
cpurchase = purchases[index];
amount = cpurchase.amount;
if (cpurchase.addr == address(0)) {
return (0, amount);
}
earnings = (index == 0) ? acm : 0;
lpurchase = purchases[purchases.length-1];
earnings = earnings.add( lpurchase.sf.sub(cpurchase.sf) );
earnings = earnings.mul(amount).div(acm);
return (earnings, amount);
}
// Cash out Ether and Tangent at for the purchase at index "index".
// All of the Ether and Tangent associated with with that purchase will
// be sent to recipient, and no future withdrawals can be made for the
// purchase.
function cashOut(uint index) public {
require(0 <= index && index < purchases.length);
require(purchases[index].addr == msg.sender);
uint earnings;
uint amount;
uint tangles;
(earnings, amount) = getEarnings(index);
purchases[index].addr = address(0);
require(earnings != 0 && amount != 0);
netStakes = netStakes.sub(amount);
tangles = earnings.mul(multiplier).div(divisor);
CashOutEvent(index, msg.sender, earnings, tangles);
NetStakesChange(netStakes);
tokenContract.transfer(msg.sender, tangles);
msg.sender.transfer(earnings);
return;
}
// The fallback function used to purchase stakes
// sf is the sum of the proportions of:
// (ether of current purchase / sum of ether prior to purchase)
// It is used to calculate earnings upon withdrawal.
function () public payable {
require(msg.value != 0);
uint index = purchases.length;
uint sf;
uint f;
if (index == 0) {
sf = 0;
} else {
f = msg.value.mul(acm).div(netStakes);
sf = purchases[index-1].sf.add(f);
}
netStakes = netStakes.add(msg.value);
purchases.push(Purchase(msg.sender, msg.value, sf));
NetStakesChange(netStakes);
PurchaseEvent(index, msg.sender, msg.value, sf);
return;
}
} | revalue | function revalue(uint newMul, uint newDiv) public onlyOwner {
require( (newMul.div(newDiv)) <= (multiplier.div(divisor)) );
Revaluation(multiplier, divisor, newMul, newDiv);
multiplier = newMul;
divisor = newDiv;
return;
}
| // decreases the rate of Tangents to Ether, the contract cannot be told
// to give out more Tangents per Ether, only fewer. | LineComment | v0.4.20+commit.3155dd80 | bzzr://fd10ee54578c0b64fc35a5085b768db7aa513868eae12cd89826e489514eb8ef | {
"func_code_index": [
1653,
1930
]
} | 24 |
|||
TangentStake | TangentStake.sol | 0x5db4b520284049d7dcb21c6317664190791bb8e5 | Solidity | TangentStake | contract TangentStake is Owned {
// prevents overflows
using SafeMath for uint;
// represents a purchase object
// addr is the buying address
// amount is the number of wei in the purchase
// sf is the sum of (purchase amount / sum of previous purchase amounts)
struct Purchase {
address addr;
uint amount;
uint sf;
}
// Purchase object array that holds entire purchase history
Purchase[] purchases;
// tangents are rewarded along with Ether upon cashing out
Tangent tokenContract;
// the rate of tangents to ether is multiplier / divisor
uint multiplier;
uint divisor;
// accuracy multiplier
uint acm;
uint netStakes;
// logged when a purchase is made
event PurchaseEvent(uint index, address addr, uint eth, uint sf);
// logged when a person cashes out or the contract is destroyed
event CashOutEvent(uint index, address addr, uint eth, uint tangles);
event NetStakesChange(uint netStakes);
// logged when the rate of tangents to ether is decreased
event Revaluation(uint oldMul, uint oldDiv, uint newMul, uint newDiv);
// constructor, sets initial rate to 1000 TAN per 1 Ether
function TangentStake(address tokenAddress) public {
tokenContract = Tangent(tokenAddress);
multiplier = 1000;
divisor = 1;
acm = 10**18;
netStakes = 0;
}
// decreases the rate of Tangents to Ether, the contract cannot be told
// to give out more Tangents per Ether, only fewer.
function revalue(uint newMul, uint newDiv) public onlyOwner {
require( (newMul.div(newDiv)) <= (multiplier.div(divisor)) );
Revaluation(multiplier, divisor, newMul, newDiv);
multiplier = newMul;
divisor = newDiv;
return;
}
// returns the current amount of wei that will be given for the purchase
// at purchases[index]
function getEarnings(uint index) public constant returns (uint earnings, uint amount) {
Purchase memory cpurchase;
Purchase memory lpurchase;
cpurchase = purchases[index];
amount = cpurchase.amount;
if (cpurchase.addr == address(0)) {
return (0, amount);
}
earnings = (index == 0) ? acm : 0;
lpurchase = purchases[purchases.length-1];
earnings = earnings.add( lpurchase.sf.sub(cpurchase.sf) );
earnings = earnings.mul(amount).div(acm);
return (earnings, amount);
}
// Cash out Ether and Tangent at for the purchase at index "index".
// All of the Ether and Tangent associated with with that purchase will
// be sent to recipient, and no future withdrawals can be made for the
// purchase.
function cashOut(uint index) public {
require(0 <= index && index < purchases.length);
require(purchases[index].addr == msg.sender);
uint earnings;
uint amount;
uint tangles;
(earnings, amount) = getEarnings(index);
purchases[index].addr = address(0);
require(earnings != 0 && amount != 0);
netStakes = netStakes.sub(amount);
tangles = earnings.mul(multiplier).div(divisor);
CashOutEvent(index, msg.sender, earnings, tangles);
NetStakesChange(netStakes);
tokenContract.transfer(msg.sender, tangles);
msg.sender.transfer(earnings);
return;
}
// The fallback function used to purchase stakes
// sf is the sum of the proportions of:
// (ether of current purchase / sum of ether prior to purchase)
// It is used to calculate earnings upon withdrawal.
function () public payable {
require(msg.value != 0);
uint index = purchases.length;
uint sf;
uint f;
if (index == 0) {
sf = 0;
} else {
f = msg.value.mul(acm).div(netStakes);
sf = purchases[index-1].sf.add(f);
}
netStakes = netStakes.add(msg.value);
purchases.push(Purchase(msg.sender, msg.value, sf));
NetStakesChange(netStakes);
PurchaseEvent(index, msg.sender, msg.value, sf);
return;
}
} | getEarnings | function getEarnings(uint index) public constant returns (uint earnings, uint amount) {
Purchase memory cpurchase;
Purchase memory lpurchase;
cpurchase = purchases[index];
amount = cpurchase.amount;
if (cpurchase.addr == address(0)) {
return (0, amount);
}
earnings = (index == 0) ? acm : 0;
lpurchase = purchases[purchases.length-1];
earnings = earnings.add( lpurchase.sf.sub(cpurchase.sf) );
earnings = earnings.mul(amount).div(acm);
return (earnings, amount);
}
| // returns the current amount of wei that will be given for the purchase
// at purchases[index] | LineComment | v0.4.20+commit.3155dd80 | bzzr://fd10ee54578c0b64fc35a5085b768db7aa513868eae12cd89826e489514eb8ef | {
"func_code_index": [
2044,
2660
]
} | 25 |
|||
TangentStake | TangentStake.sol | 0x5db4b520284049d7dcb21c6317664190791bb8e5 | Solidity | TangentStake | contract TangentStake is Owned {
// prevents overflows
using SafeMath for uint;
// represents a purchase object
// addr is the buying address
// amount is the number of wei in the purchase
// sf is the sum of (purchase amount / sum of previous purchase amounts)
struct Purchase {
address addr;
uint amount;
uint sf;
}
// Purchase object array that holds entire purchase history
Purchase[] purchases;
// tangents are rewarded along with Ether upon cashing out
Tangent tokenContract;
// the rate of tangents to ether is multiplier / divisor
uint multiplier;
uint divisor;
// accuracy multiplier
uint acm;
uint netStakes;
// logged when a purchase is made
event PurchaseEvent(uint index, address addr, uint eth, uint sf);
// logged when a person cashes out or the contract is destroyed
event CashOutEvent(uint index, address addr, uint eth, uint tangles);
event NetStakesChange(uint netStakes);
// logged when the rate of tangents to ether is decreased
event Revaluation(uint oldMul, uint oldDiv, uint newMul, uint newDiv);
// constructor, sets initial rate to 1000 TAN per 1 Ether
function TangentStake(address tokenAddress) public {
tokenContract = Tangent(tokenAddress);
multiplier = 1000;
divisor = 1;
acm = 10**18;
netStakes = 0;
}
// decreases the rate of Tangents to Ether, the contract cannot be told
// to give out more Tangents per Ether, only fewer.
function revalue(uint newMul, uint newDiv) public onlyOwner {
require( (newMul.div(newDiv)) <= (multiplier.div(divisor)) );
Revaluation(multiplier, divisor, newMul, newDiv);
multiplier = newMul;
divisor = newDiv;
return;
}
// returns the current amount of wei that will be given for the purchase
// at purchases[index]
function getEarnings(uint index) public constant returns (uint earnings, uint amount) {
Purchase memory cpurchase;
Purchase memory lpurchase;
cpurchase = purchases[index];
amount = cpurchase.amount;
if (cpurchase.addr == address(0)) {
return (0, amount);
}
earnings = (index == 0) ? acm : 0;
lpurchase = purchases[purchases.length-1];
earnings = earnings.add( lpurchase.sf.sub(cpurchase.sf) );
earnings = earnings.mul(amount).div(acm);
return (earnings, amount);
}
// Cash out Ether and Tangent at for the purchase at index "index".
// All of the Ether and Tangent associated with with that purchase will
// be sent to recipient, and no future withdrawals can be made for the
// purchase.
function cashOut(uint index) public {
require(0 <= index && index < purchases.length);
require(purchases[index].addr == msg.sender);
uint earnings;
uint amount;
uint tangles;
(earnings, amount) = getEarnings(index);
purchases[index].addr = address(0);
require(earnings != 0 && amount != 0);
netStakes = netStakes.sub(amount);
tangles = earnings.mul(multiplier).div(divisor);
CashOutEvent(index, msg.sender, earnings, tangles);
NetStakesChange(netStakes);
tokenContract.transfer(msg.sender, tangles);
msg.sender.transfer(earnings);
return;
}
// The fallback function used to purchase stakes
// sf is the sum of the proportions of:
// (ether of current purchase / sum of ether prior to purchase)
// It is used to calculate earnings upon withdrawal.
function () public payable {
require(msg.value != 0);
uint index = purchases.length;
uint sf;
uint f;
if (index == 0) {
sf = 0;
} else {
f = msg.value.mul(acm).div(netStakes);
sf = purchases[index-1].sf.add(f);
}
netStakes = netStakes.add(msg.value);
purchases.push(Purchase(msg.sender, msg.value, sf));
NetStakesChange(netStakes);
PurchaseEvent(index, msg.sender, msg.value, sf);
return;
}
} | cashOut | function cashOut(uint index) public {
require(0 <= index && index < purchases.length);
require(purchases[index].addr == msg.sender);
uint earnings;
uint amount;
uint tangles;
(earnings, amount) = getEarnings(index);
purchases[index].addr = address(0);
require(earnings != 0 && amount != 0);
netStakes = netStakes.sub(amount);
tangles = earnings.mul(multiplier).div(divisor);
CashOutEvent(index, msg.sender, earnings, tangles);
NetStakesChange(netStakes);
tokenContract.transfer(msg.sender, tangles);
msg.sender.transfer(earnings);
return;
}
| // Cash out Ether and Tangent at for the purchase at index "index".
// All of the Ether and Tangent associated with with that purchase will
// be sent to recipient, and no future withdrawals can be made for the
// purchase. | LineComment | v0.4.20+commit.3155dd80 | bzzr://fd10ee54578c0b64fc35a5085b768db7aa513868eae12cd89826e489514eb8ef | {
"func_code_index": [
2911,
3636
]
} | 26 |
|||
TangentStake | TangentStake.sol | 0x5db4b520284049d7dcb21c6317664190791bb8e5 | Solidity | TangentStake | contract TangentStake is Owned {
// prevents overflows
using SafeMath for uint;
// represents a purchase object
// addr is the buying address
// amount is the number of wei in the purchase
// sf is the sum of (purchase amount / sum of previous purchase amounts)
struct Purchase {
address addr;
uint amount;
uint sf;
}
// Purchase object array that holds entire purchase history
Purchase[] purchases;
// tangents are rewarded along with Ether upon cashing out
Tangent tokenContract;
// the rate of tangents to ether is multiplier / divisor
uint multiplier;
uint divisor;
// accuracy multiplier
uint acm;
uint netStakes;
// logged when a purchase is made
event PurchaseEvent(uint index, address addr, uint eth, uint sf);
// logged when a person cashes out or the contract is destroyed
event CashOutEvent(uint index, address addr, uint eth, uint tangles);
event NetStakesChange(uint netStakes);
// logged when the rate of tangents to ether is decreased
event Revaluation(uint oldMul, uint oldDiv, uint newMul, uint newDiv);
// constructor, sets initial rate to 1000 TAN per 1 Ether
function TangentStake(address tokenAddress) public {
tokenContract = Tangent(tokenAddress);
multiplier = 1000;
divisor = 1;
acm = 10**18;
netStakes = 0;
}
// decreases the rate of Tangents to Ether, the contract cannot be told
// to give out more Tangents per Ether, only fewer.
function revalue(uint newMul, uint newDiv) public onlyOwner {
require( (newMul.div(newDiv)) <= (multiplier.div(divisor)) );
Revaluation(multiplier, divisor, newMul, newDiv);
multiplier = newMul;
divisor = newDiv;
return;
}
// returns the current amount of wei that will be given for the purchase
// at purchases[index]
function getEarnings(uint index) public constant returns (uint earnings, uint amount) {
Purchase memory cpurchase;
Purchase memory lpurchase;
cpurchase = purchases[index];
amount = cpurchase.amount;
if (cpurchase.addr == address(0)) {
return (0, amount);
}
earnings = (index == 0) ? acm : 0;
lpurchase = purchases[purchases.length-1];
earnings = earnings.add( lpurchase.sf.sub(cpurchase.sf) );
earnings = earnings.mul(amount).div(acm);
return (earnings, amount);
}
// Cash out Ether and Tangent at for the purchase at index "index".
// All of the Ether and Tangent associated with with that purchase will
// be sent to recipient, and no future withdrawals can be made for the
// purchase.
function cashOut(uint index) public {
require(0 <= index && index < purchases.length);
require(purchases[index].addr == msg.sender);
uint earnings;
uint amount;
uint tangles;
(earnings, amount) = getEarnings(index);
purchases[index].addr = address(0);
require(earnings != 0 && amount != 0);
netStakes = netStakes.sub(amount);
tangles = earnings.mul(multiplier).div(divisor);
CashOutEvent(index, msg.sender, earnings, tangles);
NetStakesChange(netStakes);
tokenContract.transfer(msg.sender, tangles);
msg.sender.transfer(earnings);
return;
}
// The fallback function used to purchase stakes
// sf is the sum of the proportions of:
// (ether of current purchase / sum of ether prior to purchase)
// It is used to calculate earnings upon withdrawal.
function () public payable {
require(msg.value != 0);
uint index = purchases.length;
uint sf;
uint f;
if (index == 0) {
sf = 0;
} else {
f = msg.value.mul(acm).div(netStakes);
sf = purchases[index-1].sf.add(f);
}
netStakes = netStakes.add(msg.value);
purchases.push(Purchase(msg.sender, msg.value, sf));
NetStakesChange(netStakes);
PurchaseEvent(index, msg.sender, msg.value, sf);
return;
}
} | function () public payable {
require(msg.value != 0);
uint index = purchases.length;
uint sf;
uint f;
if (index == 0) {
sf = 0;
} else {
f = msg.value.mul(acm).div(netStakes);
sf = purchases[index-1].sf.add(f);
}
netStakes = netStakes.add(msg.value);
purchases.push(Purchase(msg.sender, msg.value, sf));
NetStakesChange(netStakes);
PurchaseEvent(index, msg.sender, msg.value, sf);
return;
}
| // The fallback function used to purchase stakes
// sf is the sum of the proportions of:
// (ether of current purchase / sum of ether prior to purchase)
// It is used to calculate earnings upon withdrawal. | LineComment | v0.4.20+commit.3155dd80 | bzzr://fd10ee54578c0b64fc35a5085b768db7aa513868eae12cd89826e489514eb8ef | {
"func_code_index": [
3875,
4462
]
} | 27 |
||||
StakingInfo | contracts/common/Registry.sol | 0x3929ffab35937ab32f6ea0d9849174161d9d20c7 | Solidity | Registry | contract Registry is Governable {
// @todo hardcode constants
bytes32 private constant WETH_TOKEN = keccak256("wethToken");
bytes32 private constant DEPOSIT_MANAGER = keccak256("depositManager");
bytes32 private constant STAKE_MANAGER = keccak256("stakeManager");
bytes32 private constant VALIDATOR_SHARE = keccak256("validatorShare");
bytes32 private constant WITHDRAW_MANAGER = keccak256("withdrawManager");
bytes32 private constant CHILD_CHAIN = keccak256("childChain");
bytes32 private constant STATE_SENDER = keccak256("stateSender");
bytes32 private constant SLASHING_MANAGER = keccak256("slashingManager");
address public erc20Predicate;
address public erc721Predicate;
mapping(bytes32 => address) public contractMap;
mapping(address => address) public rootToChildToken;
mapping(address => address) public childToRootToken;
mapping(address => bool) public proofValidatorContracts;
mapping(address => bool) public isERC721;
enum Type {Invalid, ERC20, ERC721, Custom}
struct Predicate {
Type _type;
}
mapping(address => Predicate) public predicates;
event TokenMapped(address indexed rootToken, address indexed childToken);
event ProofValidatorAdded(address indexed validator, address indexed from);
event ProofValidatorRemoved(address indexed validator, address indexed from);
event PredicateAdded(address indexed predicate, address indexed from);
event PredicateRemoved(address indexed predicate, address indexed from);
event ContractMapUpdated(bytes32 indexed key, address indexed previousContract, address indexed newContract);
constructor(address _governance) public Governable(_governance) {}
function updateContractMap(bytes32 _key, address _address) external onlyGovernance {
emit ContractMapUpdated(_key, contractMap[_key], _address);
contractMap[_key] = _address;
}
/**
* @dev Map root token to child token
* @param _rootToken Token address on the root chain
* @param _childToken Token address on the child chain
* @param _isERC721 Is the token being mapped ERC721
*/
function mapToken(
address _rootToken,
address _childToken,
bool _isERC721
) external onlyGovernance {
require(_rootToken != address(0x0) && _childToken != address(0x0), "INVALID_TOKEN_ADDRESS");
rootToChildToken[_rootToken] = _childToken;
childToRootToken[_childToken] = _rootToken;
isERC721[_rootToken] = _isERC721;
IWithdrawManager(contractMap[WITHDRAW_MANAGER]).createExitQueue(_rootToken);
emit TokenMapped(_rootToken, _childToken);
}
function addErc20Predicate(address predicate) public onlyGovernance {
require(predicate != address(0x0), "Can not add null address as predicate");
erc20Predicate = predicate;
addPredicate(predicate, Type.ERC20);
}
function addErc721Predicate(address predicate) public onlyGovernance {
erc721Predicate = predicate;
addPredicate(predicate, Type.ERC721);
}
function addPredicate(address predicate, Type _type) public onlyGovernance {
require(predicates[predicate]._type == Type.Invalid, "Predicate already added");
predicates[predicate]._type = _type;
emit PredicateAdded(predicate, msg.sender);
}
function removePredicate(address predicate) public onlyGovernance {
require(predicates[predicate]._type != Type.Invalid, "Predicate does not exist");
delete predicates[predicate];
emit PredicateRemoved(predicate, msg.sender);
}
function getValidatorShareAddress() public view returns (address) {
return contractMap[VALIDATOR_SHARE];
}
function getWethTokenAddress() public view returns (address) {
return contractMap[WETH_TOKEN];
}
function getDepositManagerAddress() public view returns (address) {
return contractMap[DEPOSIT_MANAGER];
}
function getStakeManagerAddress() public view returns (address) {
return contractMap[STAKE_MANAGER];
}
function getSlashingManagerAddress() public view returns (address) {
return contractMap[SLASHING_MANAGER];
}
function getWithdrawManagerAddress() public view returns (address) {
return contractMap[WITHDRAW_MANAGER];
}
function getChildChainAndStateSender() public view returns (address, address) {
return (contractMap[CHILD_CHAIN], contractMap[STATE_SENDER]);
}
function isTokenMapped(address _token) public view returns (bool) {
return rootToChildToken[_token] != address(0x0);
}
function isTokenMappedAndIsErc721(address _token) public view returns (bool) {
require(isTokenMapped(_token), "TOKEN_NOT_MAPPED");
return isERC721[_token];
}
function isTokenMappedAndGetPredicate(address _token) public view returns (address) {
if (isTokenMappedAndIsErc721(_token)) {
return erc721Predicate;
}
return erc20Predicate;
}
function isChildTokenErc721(address childToken) public view returns (bool) {
address rootToken = childToRootToken[childToken];
require(rootToken != address(0x0), "Child token is not mapped");
return isERC721[rootToken];
}
} | mapToken | function mapToken(
address _rootToken,
address _childToken,
bool _isERC721
) external onlyGovernance {
require(_rootToken != address(0x0) && _childToken != address(0x0), "INVALID_TOKEN_ADDRESS");
rootToChildToken[_rootToken] = _childToken;
childToRootToken[_childToken] = _rootToken;
isERC721[_rootToken] = _isERC721;
IWithdrawManager(contractMap[WITHDRAW_MANAGER]).createExitQueue(_rootToken);
emit TokenMapped(_rootToken, _childToken);
}
| /**
* @dev Map root token to child token
* @param _rootToken Token address on the root chain
* @param _childToken Token address on the child chain
* @param _isERC721 Is the token being mapped ERC721
*/ | NatSpecMultiLine | v0.5.17+commit.d19bba13 | None | {
"func_code_index": [
2159,
2682
]
} | 28 |
|||
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | TootyrTokenSale | function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
| // ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
544,
744
]
} | 29 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | totalSupply | function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
| // ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
932,
1048
]
} | 30 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | balanceOf | function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
| // ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
1270,
1395
]
} | 31 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transfer | function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
1741,
2018
]
} | 32 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approve | function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
2529,
2737
]
} | 33 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | transferFrom | function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
| // ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
3275,
3633
]
} | 34 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | allowance | function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
| // ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
3916,
4068
]
} | 35 |
|
TootyrTokenSale | TootyrTokenSale.sol | 0x7150bf55144f12cb12ecde2064ae4a06e297bf37 | Solidity | TootyrTokenSale | contract TootyrTokenSale is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public startDate;
uint public bonusEnds;
uint public endDate;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function TootyrTokenSale() public {
symbol = "TRT";
name = "TootyrToken";
decimals = 18;
bonusEnds = now + 5 weeks;
endDate = now + 10 weeks;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// 10,000 TRT Tokens per 1 ETH
// ------------------------------------------------------------------------
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 13000;
} else {
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_totalSupply = safeAdd(_totalSupply, tokens);
Transfer(address(0), msg.sender, tokens);
owner.transfer(msg.value);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
} | // ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ---------------------------------------------------------------------------- | LineComment | approveAndCall | function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------ | LineComment | v0.4.24+commit.e67f0147 | bzzr://7b5223d85f714a55740dc3ecdf6fac5860d249631f7aab8beebd50be3ad70ef0 | {
"func_code_index": [
4431,
4748
]
} | 36 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
- Downloads last month
- 545