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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCall | function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
| /**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
3721,
3922
]
} | 57,461 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCallWithValue | function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| /**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
4292,
4523
]
} | 57,462 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCallWithValue | function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
| /**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
4774,
5095
]
} | 57,463 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | owner | function owner() public view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
566,
650
]
} | 57,464 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | renounceOwnership | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
1209,
1362
]
} | 57,465 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
1512,
1761
]
} | 57,466 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | lock | function lock(uint256 time) public virtual onlyOwner {
_previousOwner = _owner;
_owner = address(0);
_lockTime = now + time;
emit OwnershipTransferred(_owner, address(0));
}
| //Locks the contract for owner for the amount of time provided | LineComment | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
1929,
2148
]
} | 57,467 |
Burner | Burner.sol | 0x0bf09916957f3eadc1be240c6f145fd7a34bf7f2 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | unlock | function unlock() public virtual {
require(_previousOwner == msg.sender, "You don't have permission to unlock");
require(now > _lockTime , "Contract is locked until 7 days");
emit OwnershipTransferred(_owner, _previousOwner);
_owner = _previousOwner;
}
| //Unlocks the contract for owner when _lockTime is exceeds | LineComment | v0.6.12+commit.27d51765 | MIT | ipfs://a6415090acf70603bf5af800aa8c4494001140989736ae14d9b1eacb4a5a1d41 | {
"func_code_index": [
2219,
2517
]
} | 57,468 |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* a... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
710,
891
]
} | 57,469 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* a... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | renounceOwnership | function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
| /**
* @dev Allows the current owner to relinquish control of the contract.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
983,
1100
]
} | 57,470 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
89,
266
]
} | 57,471 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
350,
630
]
} | 57,472 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
744,
860
]
} | 57,473 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, tr... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
924,
1054
]
} | 57,474 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | pause | function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
513,
609
]
} | 57,475 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | Pausable | contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function ... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | unpause | function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
693,
791
]
} | 57,476 | |
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | name | function name() constant returns (string _name) {
return name;
}
| // Function to access name of token . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
840,
917
]
} | 57,477 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | symbol | function symbol() constant returns (string _symbol) {
return symbol;
}
| // Function to access symbol of token . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
961,
1044
]
} | 57,478 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | decimals | function decimals() constant returns (uint8 _decimals) {
return decimals;
}
| // Function to access decimals of token . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
1090,
1178
]
} | 57,479 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | totalSupply | function totalSupply() constant returns (uint256 _totalSupply) {
return totalSupply;
}
| // Function to access total supply of tokens . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
1229,
1328
]
} | 57,480 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | transfer | function transfer(address _to, uint _value, bytes _data, string _custom_fallback)
whenNotPaused
returns (bool success)
{
require(_to != address(0));
require(!frozenAccount[_to]);
require(!frozenAccount[msg.sender]);
if(isContract(_to)) {
require(balanceOf(msg.sender) >= _value);
balances[_to]... | // Function that is called when a user or another contract wants to transfer funds . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
1576,
2257
]
} | 57,481 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | transfer | function transfer(address _to, uint _value, bytes _data)
whenNotPaused
returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(!frozenAccount[msg.sender]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferTo... | // Function that is called when a user or another contract wants to transfer funds . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
2350,
2731
]
} | 57,482 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | transfer | function transfer(address _to, uint _value)
whenNotPaused
returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(!frozenAccount[msg.sender]);
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes ... | // Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons . | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
2862,
3381
]
} | 57,483 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | isContract | function isContract(address _addr) private returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
| //assemble the given address bytecode. If bytecode exists then the _addr is a contract. | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
3473,
3753
]
} | 57,484 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | transferToAddress | function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(balanceOf(msg.sender) >= _value);
require(!frozenAccount[msg.sender]);
balances[msg.sender] = balanceOf(msg.sender).sub(_value);
balances... | //function that is called when transaction target is an address | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
3823,
4268
]
} | 57,485 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | transferToContract | function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(_to != address(0));
require(!frozenAccount[_to]);
require(balanceOf(msg.sender) >= _value);
require(!frozenAccount[msg.sender]);
balances[msg.sender] = balanceOf(msg.sender).sub(_value);
balance... | //function that is called when transaction target is a contract | LineComment | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
4338,
4896
]
} | 57,486 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | approve | function approve(address _spender, uint256 _value)
public
whenNotPaused
returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* ... | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
5637,
5861
]
} | 57,487 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | allowance | function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
6185,
6350
]
} | 57,488 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | increaseApproval | function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool)
{
allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
6816,
7134
]
} | 57,489 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | decreaseApproval | function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtr... | /**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
7605,
8067
]
} | 57,490 | |||
WTO | WTO.sol | 0x9220895a55533a5e751d7d1b333bd74bdfc2c9aa | Solidity | WTO | contract WTO is Pausable {
using SafeMath for uint256;
mapping (address => uint) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozenAccount;
event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
ev... | collectTokens | function collectTokens(address[] addresses, uint256[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0);
require(addresses.length == amounts.length);
uint256 totalAmount = 0;
bytes memory empty;
for (uint j = 0; j < addresses.length; j++) {
require(am... | /**
* @dev Function to collect tokens from the list of addresses
*/ | NatSpecMultiLine | v0.4.23+commit.124ca40d | bzzr://25025e3e18d4505e72e2e4bfba2aab8f2b15126ef2ffc076b781fab97cd44fd2 | {
"func_code_index": [
9734,
10599
]
} | 57,491 | |||
BatchExchange | contracts/libraries/TokenConservation.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | TokenConservation | library TokenConservation {
using SignedSafeMath for int256;
/** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/
function init(uint16[] memory tokenIdsForPrice) internal pure returns ... | /** @title Token Conservation
* A library for updating and verifying the tokenConservation contraint for BatchExchange's batch auction
* @author @gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>
*/ | NatSpecMultiLine | init | function init(uint16[] memory tokenIdsForPrice) internal pure returns (int256[] memory) {
return new int256[](tokenIdsForPrice.length + 1);
}
| /** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
246,
406
]
} | 57,492 |
BatchExchange | contracts/libraries/TokenConservation.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | TokenConservation | library TokenConservation {
using SignedSafeMath for int256;
/** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/
function init(uint16[] memory tokenIdsForPrice) internal pure returns ... | /** @title Token Conservation
* A library for updating and verifying the tokenConservation contraint for BatchExchange's batch auction
* @author @gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>
*/ | NatSpecMultiLine | feeTokenImbalance | function feeTokenImbalance(int256[] memory self) internal pure returns (int256) {
return self[0];
}
| /** @dev returns the token imbalance of the fee token
* @param self internal datastructure created by TokenConservation.init()
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
558,
676
]
} | 57,493 |
BatchExchange | contracts/libraries/TokenConservation.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | TokenConservation | library TokenConservation {
using SignedSafeMath for int256;
/** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/
function init(uint16[] memory tokenIdsForPrice) internal pure returns ... | /** @title Token Conservation
* A library for updating and verifying the tokenConservation contraint for BatchExchange's batch auction
* @author @gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>
*/ | NatSpecMultiLine | updateTokenConservation | function updateTokenConservation(
int256[] memory self,
uint16 buyToken,
uint16 sellToken,
uint16[] memory tokenIdsForPrice,
uint128 buyAmount,
uint128 sellAmount
) internal pure {
uint256 buyTokenIndex = findPriceIndex(buyToken, tokenIdsForPrice);
uint256 sellTokenIndex = findP... | /** @dev updated token conservation array.
* @param self internal datastructure created by TokenConservation.init()
* @param buyToken id of token whose imbalance should be subtracted from
* @param sellToken id of token whose imbalance should be added to
* @param tokenIdsForPrice sorted list of tokenIds
* @par... | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
1173,
1733
]
} | 57,494 |
BatchExchange | contracts/libraries/TokenConservation.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | TokenConservation | library TokenConservation {
using SignedSafeMath for int256;
/** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/
function init(uint16[] memory tokenIdsForPrice) internal pure returns ... | /** @title Token Conservation
* A library for updating and verifying the tokenConservation contraint for BatchExchange's batch auction
* @author @gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>
*/ | NatSpecMultiLine | checkTokenConservation | function checkTokenConservation(int256[] memory self) internal pure {
require(self[0] > 0, "Token conservation at 0 must be positive.");
for (uint256 i = 1; i < self.length; i++) {
require(self[i] == 0, "Token conservation does not hold");
}
}
| /** @dev Ensures all array's elements are zero except the first.
* @param self internal datastructure created by TokenConservation.init()
* @return true if all, but first element of self are zero else false
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
1972,
2265
]
} | 57,495 |
BatchExchange | contracts/libraries/TokenConservation.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | TokenConservation | library TokenConservation {
using SignedSafeMath for int256;
/** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/
function init(uint16[] memory tokenIdsForPrice) internal pure returns ... | /** @title Token Conservation
* A library for updating and verifying the tokenConservation contraint for BatchExchange's batch auction
* @author @gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>
*/ | NatSpecMultiLine | checkPriceOrdering | function checkPriceOrdering(uint16[] memory tokenIdsForPrice) internal pure returns (bool) {
for (uint256 i = 1; i < tokenIdsForPrice.length; i++) {
if (tokenIdsForPrice[i] <= tokenIdsForPrice[i - 1]) {
return false;
}
}
return true;
}
| /** @dev Token ordering is verified by submitSolution. Required because binary search is used to fetch token info.
* @param tokenIdsForPrice list of tokenIds
* @return true if tokenIdsForPrice is sorted else false
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
2511,
2826
]
} | 57,496 |
BatchExchange | contracts/libraries/TokenConservation.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | TokenConservation | library TokenConservation {
using SignedSafeMath for int256;
/** @dev initialize the token conservation data structure
* @param tokenIdsForPrice sorted list of tokenIds for which token conservation should be checked
*/
function init(uint16[] memory tokenIdsForPrice) internal pure returns ... | /** @title Token Conservation
* A library for updating and verifying the tokenConservation contraint for BatchExchange's batch auction
* @author @gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>
*/ | NatSpecMultiLine | findPriceIndex | function findPriceIndex(uint16 tokenId, uint16[] memory tokenIdsForPrice) private pure returns (uint256) {
// Fee token is not included in tokenIdsForPrice
if (tokenId == 0) {
return 0;
}
// binary search for the other tokens
uint256 leftValue = 0;
uint256 rightValue = tokenIdsFor... | /** @dev implementation of binary search on sorted list returns token id
* @param tokenId element whose index is to be found
* @param tokenIdsForPrice list of (sorted) tokenIds for which binary search is applied.
* @return `index` in `tokenIdsForPrice` where `tokenId` appears (reverts if not found).
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
3166,
4103
]
} | 57,497 |
Commune | Commune.sol | 0x4f7892978a0eea4ce75b9b8ccefffa542cc4d40e | Solidity | Commune | contract Commune is ICommune {
using SafeMath for uint256;
struct aCommune {
bool allowsJoining;
bool allowsRemoving;
bool allowsOutsideContribution;
address asset;
uint256 proratedTotal;
uint256 memberCount;
address controller;
string uri;
}
... | numberOfCommunes | function numberOfCommunes() external override view returns (uint256){
return _nonce;
}
| // Getters /// | LineComment | v0.7.3+commit.9bfce1f6 | MIT | ipfs://b94e99684d24b8c95813b89bd6a236b00bcbd816e2a127637e8d07dfbf17d216 | {
"func_code_index": [
1247,
1349
]
} | 57,498 | ||
Commune | Commune.sol | 0x4f7892978a0eea4ce75b9b8ccefffa542cc4d40e | Solidity | Commune | contract Commune is ICommune {
using SafeMath for uint256;
struct aCommune {
bool allowsJoining;
bool allowsRemoving;
bool allowsOutsideContribution;
address asset;
uint256 proratedTotal;
uint256 memberCount;
address controller;
string uri;
}
... | createCommune | function createCommune(string memory _uri, address asset, bool allowJoining, bool allowRemoving, bool allowOutsideContribution) external override returns(uint256 _id) {
require((!allowJoining && allowRemoving) || (allowJoining && !allowRemoving) || (!allowJoining && !allowRemoving), "Commune: cannot both allow jo... | /**
@dev _uri should link to a JSON file of the form
{
"title": "Commune Title",
"description": "Commune description"
}
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | MIT | ipfs://b94e99684d24b8c95813b89bd6a236b00bcbd816e2a127637e8d07dfbf17d216 | {
"func_code_index": [
3502,
4225
]
} | 57,499 | ||
Commune | Commune.sol | 0x4f7892978a0eea4ce75b9b8ccefffa542cc4d40e | Solidity | Commune | contract Commune is ICommune {
using SafeMath for uint256;
struct aCommune {
bool allowsJoining;
bool allowsRemoving;
bool allowsOutsideContribution;
address asset;
uint256 proratedTotal;
uint256 memberCount;
address controller;
string uri;
}
... | joinCommune | function joinCommune(uint256 commune) external override {
require(getCommune[commune].allowsJoining, "Commune: commune does not allow joining");
_addCommuneMember(msg.sender, commune);
}
| //Join/Add Functions | LineComment | v0.7.3+commit.9bfce1f6 | MIT | ipfs://b94e99684d24b8c95813b89bd6a236b00bcbd816e2a127637e8d07dfbf17d216 | {
"func_code_index": [
4252,
4462
]
} | 57,500 | ||
Commune | Commune.sol | 0x4f7892978a0eea4ce75b9b8ccefffa542cc4d40e | Solidity | Commune | contract Commune is ICommune {
using SafeMath for uint256;
struct aCommune {
bool allowsJoining;
bool allowsRemoving;
bool allowsOutsideContribution;
address asset;
uint256 proratedTotal;
uint256 memberCount;
address controller;
string uri;
}
... | leaveCommune | function leaveCommune(uint256 commune) external override {
_removeCommuneMember(msg.sender, commune);
}
| // Leave/Remove Functions | LineComment | v0.7.3+commit.9bfce1f6 | MIT | ipfs://b94e99684d24b8c95813b89bd6a236b00bcbd816e2a127637e8d07dfbf17d216 | {
"func_code_index": [
5086,
5205
]
} | 57,501 | ||
Commune | Commune.sol | 0x4f7892978a0eea4ce75b9b8ccefffa542cc4d40e | Solidity | Commune | contract Commune is ICommune {
using SafeMath for uint256;
struct aCommune {
bool allowsJoining;
bool allowsRemoving;
bool allowsOutsideContribution;
address asset;
uint256 proratedTotal;
uint256 memberCount;
address controller;
string uri;
}
... | updateCommuneController | function updateCommuneController(address account, uint256 commune) external communeControllerOnly(commune) override {
getCommune[commune].controller = account;
emit UpdateCommuneController(account, commune);
}
| /// controller functions /// | NatSpecSingleLine | v0.7.3+commit.9bfce1f6 | MIT | ipfs://b94e99684d24b8c95813b89bd6a236b00bcbd816e2a127637e8d07dfbf17d216 | {
"func_code_index": [
6211,
6445
]
} | 57,502 | ||
Commune | Commune.sol | 0x4f7892978a0eea4ce75b9b8ccefffa542cc4d40e | Solidity | Commune | contract Commune is ICommune {
using SafeMath for uint256;
struct aCommune {
bool allowsJoining;
bool allowsRemoving;
bool allowsOutsideContribution;
address asset;
uint256 proratedTotal;
uint256 memberCount;
address controller;
string uri;
}
... | balanceOfBatch | function balanceOfBatch(
address[] memory accounts,
uint256[] memory ids
)
public
view
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "Commune: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (ui... | /**
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | MIT | ipfs://b94e99684d24b8c95813b89bd6a236b00bcbd816e2a127637e8d07dfbf17d216 | {
"func_code_index": [
8557,
9176
]
} | 57,503 | ||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
89,
272
]
} | 57,504 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
356,
629
]
} | 57,505 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
744,
860
]
} | 57,506 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbe... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
924,
1060
]
} | 57,507 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | setOwner | function setOwner (address _owner) onlyOwner() public {
owner = _owner;
}
| // contract owner | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
1880,
1964
]
} | 57,508 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | setCharity | function setCharity (address _charityAddress) onlyOwner() public {
charityAddress = _charityAddress;
}
| // Set charity address | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
1993,
2106
]
} | 57,509 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | setItemRegistry | function setItemRegistry (address _itemRegistry) onlyOwner() public {
itemRegistry = IItemRegistry(_itemRegistry);
}
| // Set item registry | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
2133,
2260
]
} | 57,510 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | addAdmin | function addAdmin (address _admin) onlyOwner() public {
admins[_admin] = true;
}
| // Add admin | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
2279,
2370
]
} | 57,511 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | removeAdmin | function removeAdmin (address _admin) onlyOwner() public {
delete admins[_admin];
}
| // Remove admin | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
2392,
2486
]
} | 57,512 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | enableERC721 | function enableERC721 () onlyOwner() public {
erc721Enabled = true;
}
| // Unlocks ERC721 behaviour, allowing for trading on third party platforms. | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
2568,
2648
]
} | 57,513 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | withdrawAll | function withdrawAll () onlyOwner() public {
owner.transfer(address(this).balance);
}
| // Withdraw | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
2666,
2762
]
} | 57,514 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | populateFromItemRegistry | function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
for (uint256 i = 0; i < _itemIds.length; i++) {
if (charityCutOfItem[_itemIds[i]] > 0 || priceOfItem[_itemIds[i]] > 0 || itemRegistry.priceOf(_itemIds[i]) == 0) {
continue;
}
listItemFromRegistry(_itemIds[i]);
}
}... | // Listing | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
2882,
3219
]
} | 57,515 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | calculateNextPrice | function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
if (_price < increaseLimit1) {
return _price.mul(200).div(95);
} else if (_price < increaseLimit2) {
return _price.mul(135).div(96);
} else if (_price < increaseLimit3) {
return _price.mul(125).div(97);
} ... | // Buy | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
4581,
5057
]
} | 57,516 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | calculateDevCut | function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
if (_price < increaseLimit1) {
return _price.mul(5).div(100); // 5%
} else if (_price < increaseLimit2) {
return _price.mul(4).div(100); // 4%
} else if (_price < increaseLimit3) {
return _price.mul(3).div(100); //... | // Dev cut | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
5074,
5569
]
} | 57,517 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | buy | function buy (uint256 _itemId, uint256 _charityCutNew) payable public {
require(priceOf(_itemId) > 0); // price of the token has to be greater than zero
require(_charityCutNew >= 10); // minimum charity cut is 10%
require(_charityCutNew <= 100); // maximum charity cut is 100%
require(charityCutOf(_itemId) >... | // Buy function | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
5591,
8048
]
} | 57,518 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | balanceOf | function balanceOf (address _owner) public view returns (uint256 _balance) {
uint256 counter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
counter++;
}
}
return counter;
}
| // balance of an address | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
8470,
8745
]
} | 57,519 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | ownerOf | function ownerOf (uint256 _itemId) public view returns (address _owner) {
return ownerOfItem[_itemId];
}
| // owner of token | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
8769,
8884
]
} | 57,520 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | tokensOf | function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
uint256[] memory items = new uint256[](balanceOf(_owner));
uint256 itemCounter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
items[itemCounter] = listedItems[i];
... | // tokens of an address | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
8914,
9310
]
} | 57,521 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | tokenExists | function tokenExists (uint256 _itemId) public view returns (bool _exists) {
return priceOf(_itemId) > 0;
}
| // token exists | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
9332,
9449
]
} | 57,522 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | approvedFor | function approvedFor(uint256 _itemId) public view returns (address _approved) {
return approvedOfItem[_itemId];
}
| // approved for | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
9471,
9595
]
} | 57,523 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | approve | function approve(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender != _to);
require(tokenExists(_itemId));
require(ownerOf(_itemId) == msg.sender);
if (_to == 0) {
if (approvedOfItem[_itemId] != 0) {
delete approvedOfItem[_itemId];
emit Approval(msg.sender, 0, _item... | // approve | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
9612,
10074
]
} | 57,524 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | isAdmin | function isAdmin (address _admin) public view returns (bool _isAdmin) {
return admins[_admin];
}
| // read | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
10785,
10892
]
} | 57,525 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | ownerkill | function ownerkill() public onlyOwner {
selfdestruct(owner);
}
| // selfdestruct | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
11994,
12071
]
} | 57,526 | |||
ItemToken | ItemToken.sol | 0x7e0f4a1d28228cdc3079bca1e1668fb18ddbc995 | Solidity | ItemToken | contract ItemToken {
using SafeMath for uint256; // Loading the SafeMath library
// Events of the contract
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, ... | isContract | function isContract(address addr) internal view returns (bool) {
uint size;
assembly { size := extcodesize(addr) } // solium-disable-line
return size > 0;
}
| // util | LineComment | v0.4.25-nightly.2018.6.8+commit.81c5a6e4 | bzzr://f2380f08bd7a1a98365a31fe9681329926f1e3c91ddc577d7485f5c5def099e7 | {
"func_code_index": [
12361,
12538
]
} | 57,527 | |||
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | parseInt | function parseInt(string _a) internal returns (uint) {
return parseInt(_a, 0);
}
| // parseInt | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
27456,
27555
]
} | 57,528 | |||
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | parseInt | function parseInt(string _a, uint _b) internal returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
bool decimals = false;
for (uint i=0; i<bresult.length; i++){
if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
if (decimals){
if (_b == 0) break;
... | // parseInt(parseFloat*10^_b) | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
27593,
28202
]
} | 57,529 | |||
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | copyBytes | function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal returns (bytes) {
uint minLength = length + toOffset;
if (to.length < minLength) {
// Buffer too small
throw; // Should be a better way?
}
// NOTE: the offset 32 is added to skip the ... | // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
39906,
40623
]
} | 57,530 | |||
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | safer_ecrecover | function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {
// We do our own memory management here. Solidity uses memory offset
// 0x40 to store the current end of memory. We write past it (as
// writes are memory extensions), but don't update the offset so
... | // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
// Duplicate Solidity's ecrecover, but catching the CALL return value | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
40820,
41823
]
} | 57,531 | |||
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | usingOraclize | contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
... | ecrecovery | function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) {
bytes32 r;
bytes32 s;
uint8 v;
if (sig.length != 65)
return (false, 0);
// The signature format is a compact form of:
// {bytes32 r}{bytes32 s}{uint8 v}
// Compact means, uint8 is not padded t... | // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
41945,
43371
]
} | 57,532 | |||
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | Superbowl | function Superbowl() public {
owner = msg.sender;
pingOracle(PAYOUT_DATE - now); // Schedule payout at first manual scheduled time
}
| // Constructor | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
2152,
2300
]
} | 57,533 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | __callback | function __callback(bytes32 queryId, string result, bytes proof) public {
require(payoutCompleted == false);
require(msg.sender == oraclize_cbAddress());
// Determine winning team index based
// on its name that the request returned
if (keccak256(TEAM_NAMES[0]) == keccak256(result)) {
winning... | // Callback from Oraclize | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
2662,
3545
]
} | 57,534 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | getUserBets | function getUserBets() public constant returns(uint[NUM_TEAMS]) {
return betterInfo[msg.sender].amountsBet;
}
| // Returns the total amounts betted for
// the sender | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
3608,
3732
]
} | 57,535 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | releaseBets | function releaseBets() private {
uint storedBalance = this.balance;
for (uint k = 0; k < betters.length; k++) {
uint totalBet = betterInfo[betters[k]].amountsBet[0] + betterInfo[betters[k]].amountsBet[1];
betters[k].transfer(totalBet * storedBalance / totalBetAmount);
}
}
| // Release all the bets back to the betters
// if, for any reason, payouts cannot be
// completed | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
3842,
4149
]
} | 57,536 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | canBet | function canBet() public constant returns(bool) {
return (now >= BETTING_OPENS && now < BETTING_CLOSES);
}
| // Returns true if we can bet (in betting window) | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
4207,
4324
]
} | 57,537 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | triggerPayout | function triggerPayout() public onlyBookieLevel {
pingOracle(0);
}
| // We (bookies) can trigger a payout
// immediately, before the scheduled payout,
// if the data source has already been updated.
// This is so people can get their $$$ ASAP. | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
4516,
4593
]
} | 57,538 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | bet | function bet(uint teamIdx) public payable {
require(canBet() == true);
require(TeamType(teamIdx) == TeamType.PAEagles || TeamType(teamIdx) == TeamType.NEPatriots);
require(msg.value >= MINIMUM_BET);
// Add better to better list if they
// aren't already in it
if (betterInfo[msg.sender].amountsBet[0]... | // Function for user to bet on team idx,
// where 0 = Eagles and 1 = Patriots | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
4680,
5320
]
} | 57,539 | |
Superbowl | Superbowl.sol | 0xca896d11e43c4927b2041a97eba1505e1ff26f8c | Solidity | Superbowl | contract Superbowl is usingOraclize {
/* Declaration */
address owner;
address[2] public BOOKIES = [0xC3eD2d481B9d75835EC04174b019A7eAF2Faf78A, 0x393F3668a1B66EBB107FBF01F6C361D507Be8Ee7];
uint public constant NUM_TEAMS = 2;
string[NUM_TEAMS] public TEAM_NAMES = ["Philadelphia Eagles", "New England... | // </ORACLIZE_API> | LineComment | performPayout | function performPayout() private canPerformPayout {
// Calculate total pool of ETH
// betted for all different teams,
// and for the winning pool.
uint losingChunk = this.balance - totalAmountsBet[uint(winningTeam)];
uint bookiePayout = losingChunk / BOOKIE_POOL_COMMISSION; // Payout to the bookies... | // Performs payout based on winning team | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://3b1e0a2f120128eebec8275e285a8645aa8ce6d66dfbaaaf6dcab6e13b8a98df | {
"func_code_index": [
5367,
6333
]
} | 57,540 | |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) ret... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
| /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
268,
507
]
} | 57,541 |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) ret... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
714,
823
]
} | 57,542 |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
392,
895
]
} | 57,543 |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
1131,
1314
]
} | 57,544 |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
1638,
1776
]
} | 57,545 |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/ | Comment | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
2025,
2297
]
} | 57,546 |
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | ERC677Token | contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
func... | transferAndCall | function transferAndCall(address _to, uint _value, bytes _data)
public
returns (bool success)
{
super.transfer(_to, _value);
Transfer(msg.sender, _to, _value, _data);
if (isContract(_to)) {
contractFallback(_to, _value, _data);
}
return true;
}
| /**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
314,
609
]
} | 57,547 | ||
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | ERC677Token | contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
func... | contractFallback | function contractFallback(address _to, uint _value, bytes _data)
private
{
ERC677Receiver receiver = ERC677Receiver(_to);
receiver.onTokenTransfer(msg.sender, _value, _data);
}
| // PRIVATE | LineComment | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
630,
830
]
} | 57,548 | ||
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | UKRToken | contract UKRToken is StandardToken, ERC677Token {
uint public constant totalSupply = 1500000000000000000000000000;
string public constant name = 'UKRCHAIN';
uint8 public constant decimals = 18;
string public constant symbol = 'UKR';
function UKRToken()
public
{
balances[msg.sender] = tot... | transferAndCall | function transferAndCall(address _to, uint _value, bytes _data)
public
validRecipient(_to)
returns (bool success)
{
return super.transferAndCall(_to, _value, _data);
}
| /**
* @dev transfer token to a specified address with additional data if the recipient is a contract.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
618,
814
]
} | 57,549 | ||
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | UKRToken | contract UKRToken is StandardToken, ERC677Token {
uint public constant totalSupply = 1500000000000000000000000000;
string public constant name = 'UKRCHAIN';
uint8 public constant decimals = 18;
string public constant symbol = 'UKR';
function UKRToken()
public
{
balances[msg.sender] = tot... | transfer | function transfer(address _to, uint _value)
public
validRecipient(_to)
returns (bool success)
{
return super.transfer(_to, _value);
}
| /**
* @dev transfer token to a specified address.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
972,
1134
]
} | 57,550 | ||
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | UKRToken | contract UKRToken is StandardToken, ERC677Token {
uint public constant totalSupply = 1500000000000000000000000000;
string public constant name = 'UKRCHAIN';
uint8 public constant decimals = 18;
string public constant symbol = 'UKR';
function UKRToken()
public
{
balances[msg.sender] = tot... | approve | function approve(address _spender, uint256 _value)
public
validRecipient(_spender)
returns (bool)
{
return super.approve(_spender, _value);
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
1370,
1541
]
} | 57,551 | ||
UKRToken | UKRToken.sol | 0xc875230d5342916a02ccdf6800d3805799b41fa3 | Solidity | UKRToken | contract UKRToken is StandardToken, ERC677Token {
uint public constant totalSupply = 1500000000000000000000000000;
string public constant name = 'UKRCHAIN';
uint8 public constant decimals = 18;
string public constant symbol = 'UKR';
function UKRToken()
public
{
balances[msg.sender] = tot... | transferFrom | function transferFrom(address _from, address _to, uint256 _value)
public
validRecipient(_to)
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
| /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | MIT | bzzr://b6d130161ae3a6518bf24bbd0b07136cebf13b4ad30d01b20eef9ca75fff307b | {
"func_code_index": [
1821,
2008
]
} | 57,552 | ||
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | deposit | function deposit(address token, uint256 amount) public {
updateDepositsBalance(msg.sender, token);
SafeERC20.safeTransferFrom(IERC20(token), msg.sender, address(this), amount);
// solhint-disable-next-line max-line-length
balanceStates[msg.sender][token].pendingDeposits.amount = balanceStates[msg.se... | /** @dev credits user with deposit amount on next epoch (given by getCurrentBatchId)
* @param token address of token to be deposited
* @param amount number of token(s) to be credited to user's account
*
* Emits an {Deposit} event with relevent deposit information.
*
* Requirements:
* - token transfer to c... | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
1439,
2019
]
} | 57,553 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | requestWithdraw | function requestWithdraw(address token, uint256 amount) public {
requestFutureWithdraw(token, amount, getCurrentBatchId());
}
| /** @dev Signals and initiates user's intent to withdraw.
* @param token address of token to be withdrawn
* @param amount number of token(s) to be withdrawn
*
* Emits an {WithdrawRequest} event with relevent request information.
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
2294,
2438
]
} | 57,554 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | requestFutureWithdraw | function requestFutureWithdraw(address token, uint256 amount, uint32 batchId) public {
// First process pendingWithdraw (if any), as otherwise balances might increase for currentBatchId - 1
if (hasValidWithdrawRequest(msg.sender, token)) {
withdraw(msg.sender, token);
}
require(batchId >= g... | /** @dev Signals and initiates user's intent to withdraw.
* @param token address of token to be withdrawn
* @param amount number of token(s) to be withdrawn
* @param batchId state index at which request is to be made.
*
* Emits an {WithdrawRequest} event with relevent request information.
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
2781,
3368
]
} | 57,555 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | withdraw | function withdraw(address user, address token) public {
updateDepositsBalance(user, token); // withdrawn amount may have been deposited in previous epoch
require(
balanceStates[user][token].pendingWithdraws.batchId < getCurrentBatchId(),
"withdraw was not registered previously"
);
... | /** @dev Claims pending withdraw - can be called on behalf of others
* @param token address of token to be withdrawn
* @param user address of user who withdraw is being claimed.
*
* Emits an {Withdraw} event stating that `user` withdrew `amount` of `token`
*
* Requirements:
* - withdraw was requested in p... | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
3824,
4754
]
} | 57,556 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | getPendingDeposit | function getPendingDeposit(address user, address token) public view returns (uint256, uint256) {
PendingFlux memory pendingDeposit = balanceStates[user][token].pendingDeposits;
return (pendingDeposit.amount, pendingDeposit.batchId);
}
| /** @dev getter function used to display pending deposit
* @param user address of user
* @param token address of ERC20 token
* return amount and batchId of deposit's transfer if any (else 0)
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
5032,
5294
]
} | 57,557 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | getPendingWithdraw | function getPendingWithdraw(address user, address token) public view returns (uint256, uint256) {
PendingFlux memory pendingWithdraw = balanceStates[user][token].pendingWithdraws;
return (pendingWithdraw.amount, pendingWithdraw.batchId);
}
| /** @dev getter function used to display pending withdraw
* @param user address of user
* @param token address of ERC20 token
* return amount and batchId when withdraw was requested if any (else 0)
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
5531,
5798
]
} | 57,558 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | getCurrentBatchId | function getCurrentBatchId() public view returns (uint32) {
return uint32(now / BATCH_TIME);
}
| /** @dev getter function to determine current auction id.
* return current batchId
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
5906,
6019
]
} | 57,559 |
BatchExchange | contracts/EpochTokenLocker.sol | 0x46f3f2f9662f66a6ddd6a8d1ddec3cd9ae5e87b5 | Solidity | EpochTokenLocker | contract EpochTokenLocker {
using SafeMath for uint256;
/** @dev Number of seconds a batch is lasting*/
uint32 public constant BATCH_TIME = 300;
// User => Token => BalanceState
mapping(address => mapping(address => BalanceState)) private balanceStates;
// user => token => lastCredit... | /** @title Epoch Token Locker
* EpochTokenLocker saveguards tokens for applications with constant-balances during discrete epochs
* It allows to deposit a token which become credited in the next epoch and allows to request a token-withdraw
* which becomes claimable after the current epoch has expired.
* @au... | NatSpecMultiLine | getSecondsRemainingInBatch | function getSecondsRemainingInBatch() public view returns (uint256) {
return BATCH_TIME - (now % BATCH_TIME);
}
| /** @dev used to determine how much time is left in a batch
* return seconds remaining in current batch
*/ | NatSpecMultiLine | v0.5.6+commit.b259423e | GNU GPLv3 | bzzr://d75d8f06b335b5c4398c51039c6bbb9a0b7d2e34f3a8a69428935ad3326899cb | {
"func_code_index": [
6148,
6278
]
} | 57,560 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.