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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
3188,
3471
]
} | 25,200 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consumi... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
3931,
4066
]
} | 25,201 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcod... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
4546,
4717
]
} | 25,202 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | 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 ... | isContract | function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codeha... | /**
* @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 return false for the following
* types of addresses:
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
606,
1230
]
} | 25,203 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | 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 ... | sendValue | function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address... | /**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `tr... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
2160,
2562
]
} | 25,204 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | 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 ... | functionCall | function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
| /**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
3318,
3496
]
} | 25,205 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | 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 ... | 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 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
3721,
3922
]
} | 25,206 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | 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 ... | 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 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
4292,
4523
]
} | 25,207 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | 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 ... | 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 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
4774,
5095
]
} | 25,208 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSend... | owner | function owner() public view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
497,
581
]
} | 25,209 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSend... | 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 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
1139,
1292
]
} | 25,210 | ||
ZeepyNetwork | ZeepyNetwork.sol | 0x9078f955b8c262382ef28592488916f4f6b58b07 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSend... | 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 | None | ipfs://b46052f49ff05ac6bf9702a1cd07ec46100afc6f10acdf22ed105dd5fc95f1ec | {
"func_code_index": [
1442,
1691
]
} | 25,211 | ||
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c... | /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
95,
512
]
} | 25,212 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
602,
902
]
} | 25,213 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
| /**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
1022,
1150
]
} | 25,214 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
1220,
1366
]
} | 25,215 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | Pausable | contract Pausable is Owned {
bool public paused = false;
event Pause();
event Unpause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifie... | /**
* @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.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
551,
659
]
} | 25,216 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | Pausable | contract Pausable is Owned {
bool public paused = false;
event Pause();
event Unpause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifie... | /**
* @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.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
747,
857
]
} | 25,217 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | _transfer | function _transfer(address _from, address _to, uint _value) whenNotPaused internal {
require (_to != 0x0);
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
uint256 amount = balanceOf[_from].sub(_value);
require(frozenAmount[_from] == 0 || amount >= frozenAmount[_from]);
balanc... | /* Internal transfer, only can be called by this contract */ | Comment | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
1440,
1914
]
} | 25,218 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value)
public
returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
| /**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
2113,
2280
]
} | 25,219 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value)
public
returns (bool success) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
| /**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
2547,
2810
]
} | 25,220 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) onlyOwner
public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
* Limited usage in case of front running attack, see: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#approve
*
* @param _spender The address authorized to spend
* @param _value the... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
3194,
3435
]
} | 25,221 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData) onlyOwner
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
| /**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to s... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
3821,
4175
]
} | 25,222 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | burn | function burn(uint256 _value)
public
returns (bool success) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
return true;
}
| /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
4339,
4600
]
} | 25,223 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | freezeAccount | function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
| /**
* @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
*
* @param target Address to be frozen
* @param freeze either to freeze it or not
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
4801,
4967
]
} | 25,224 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | freezeAmount | function freezeAmount(address target, uint256 _value) onlyOwner public {
require(_value > 0);
frozenAmount[target] = _value;
emit FrozenAmt(target, _value);
}
| /**
* @notice Freeze `_value` of `target` balance
*
* @param target Address to be frozen amount
* @param _value freeze amount
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
5129,
5324
]
} | 25,225 | |
CXToken | CXToken.sol | 0xcb33c7a2cff4d770fdbff7454cc58825a94f990e | Solidity | CXToken | contract CXToken is Pausable {
using SafeMath for uint; // use the library for uint type
string public symbol;
string public name;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint public totalSupply;
mapping (address => uint256)... | /******************************************/ | NatSpecMultiLine | unfreezeAmount | function unfreezeAmount(address target) onlyOwner public {
frozenAmount[target] = 0;
emit UnfrozenAmt(target);
}
| /**
* @notice Unfreeze `target` balance.
*
* @param target Address to be unfrozen
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://9fc5f874a947d9710f4c8645f706cd2763a9da2a45cf596d578c8ba3a555dc36 | {
"func_code_index": [
5437,
5577
]
} | 25,226 | |
CRPFactory | contracts/test/BadToken.sol | 0xed52d8e202401645edad1c0aa21e872498ce47d0 | Solidity | BadToken | contract BadToken {
string internal _name;
string internal _symbol;
uint8 internal _decimals;
address internal _owner;
uint internal _totalSupply;
mapping(address => uint) internal _balance;
mapping(address => mapping(address=>uint)) internal _allowance;
modifier ... | add | function add(uint a, uint b) internal pure returns (uint c) {
require((c = a + b) >= a, "ERR_ADD");
}
| // Math | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
626,
743
]
} | 25,227 | ||||
CodexCoin | contracts/ERC20/StandardToken.sol | 0xf226e38c3007b3d974fc79bcf5a77750035436ee | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_... | /**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://00b8f87c12c7ee39be25557c384332b6030187048f3f4326576421274e54c95e | {
"func_code_index": [
401,
858
]
} | 25,228 | |
CodexCoin | contracts/ERC20/StandardToken.sol | 0xf226e38c3007b3d974fc79bcf5a77750035436ee | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* ... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://00b8f87c12c7ee39be25557c384332b6030187048f3f4326576421274e54c95e | {
"func_code_index": [
1490,
1685
]
} | 25,229 | |
CodexCoin | contracts/ERC20/StandardToken.sol | 0xf226e38c3007b3d974fc79bcf5a77750035436ee | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://00b8f87c12c7ee39be25557c384332b6030187048f3f4326576421274e54c95e | {
"func_code_index": [
2009,
2140
]
} | 25,230 | |
CodexCoin | contracts/ERC20/StandardToken.sol | 0xf226e38c3007b3d974fc79bcf5a77750035436ee | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spend... | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://00b8f87c12c7ee39be25557c384332b6030187048f3f4326576421274e54c95e | {
"func_code_index": [
2606,
2875
]
} | 25,231 | |
CodexCoin | contracts/ERC20/StandardToken.sol | 0xf226e38c3007b3d974fc79bcf5a77750035436ee | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | decreaseApproval | function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Appro... | /**
* @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.24+commit.e67f0147 | bzzr://00b8f87c12c7ee39be25557c384332b6030187048f3f4326576421274e54c95e | {
"func_code_index": [
3346,
3763
]
} | 25,232 | |
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | LPTokenWrapper | contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public stakingToken;
address public devFund;
uint256 public devFee;
uint256 public _totalSupply;
uint256 public _totalSupplyAccounting;
uint256 public startTime;
mapping(address => uint256) publ... | totalSupply | function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| // Returns the total staked tokens within the contract | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
454,
547
]
} | 25,233 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | LPTokenWrapper | contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public stakingToken;
address public devFund;
uint256 public devFee;
uint256 public _totalSupply;
uint256 public _totalSupplyAccounting;
uint256 public startTime;
mapping(address => uint256) publ... | balanceOf | function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
| // Returns staking balance of the account | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
595,
707
]
} | 25,234 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | LPTokenWrapper | contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public stakingToken;
address public devFund;
uint256 public devFee;
uint256 public _totalSupply;
uint256 public _totalSupplyAccounting;
uint256 public startTime;
mapping(address => uint256) publ... | setStakingToken | function setStakingToken(address stakingTokenAddress) internal {
stakingToken = IERC20(stakingTokenAddress);
}
| // Set the staking token for the contract | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
755,
881
]
} | 25,235 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | LPTokenWrapper | contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public stakingToken;
address public devFund;
uint256 public devFee;
uint256 public _totalSupply;
uint256 public _totalSupplyAccounting;
uint256 public startTime;
mapping(address => uint256) publ... | stake | function stake(uint256 amount) public virtual {
// Increment sender's balances and total supply
_balances[msg.sender] = _balances[msg.sender].add(amount);
_totalSupply = _totalSupply.add(amount);
// Transfer funds
stakingToken.safeTransferFrom(msg.sender, address(this), amount);
}
| // Stake funds into the pool | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
916,
1246
]
} | 25,236 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | LPTokenWrapper | contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public stakingToken;
address public devFund;
uint256 public devFee;
uint256 public _totalSupply;
uint256 public _totalSupplyAccounting;
uint256 public startTime;
mapping(address => uint256) publ... | withdraw | function withdraw(uint256 amount) public virtual {
_totalSupply = _totalSupply.sub(amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
}
| // Align balances for the user | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1283,
1459
]
} | 25,237 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | rewardPerToken | function rewardPerToken() public view returns (uint256) {
// Do not distribute rewards before games begin
if (block.timestamp < startTime) {
return 0;
}
if (_totalSupply == 0) {
return rewardPerTokenStored;
}
// Effective total supply takes into account all the multipliers bought... | // Returns the current rate of rewards per token (doh) | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
1505,
2090
]
} | 25,238 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | earned | function earned(address account) public view returns (uint256) {
// Each user has it's own effective balance which is just the staked balance multiplied by boost level multiplier.
uint256 effectiveBalance = _balances[account].add(_balancesAccounting[account]);
return effectiveBalance.mul(rewardPerToken().su... | // Returns the current reward tokens that the user can claim. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2158,
2568
]
} | 25,239 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | stake | function stake(uint256 amount) public override {
updateReward(msg.sender);
require(amount > 0, "Cannot stake 0");
super.stake(amount);
uint256 userTotalMultiplier = deflector.getTotalValueForUser(address(this), msg.sender);
adjustEffectiveStake(msg.sender, userTotalMultiplier, false);
emit Stak... | // Staking function which updates the user balances in the parent contract | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
2649,
3026
]
} | 25,240 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | withdraw | function withdraw(uint256 amount) public override {
require(amount > 0, "Cannot withdraw 0");
updateReward(msg.sender);
uint256 tax = amount.mul(devFee).div(1000);
stakingToken.safeTransfer(devFund, tax);
stakingToken.safeTransfer(msg.sender, amount.sub(tax));
super.withdraw(amount);
uint2... | // Withdraw function to remove stake from the pool | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
3083,
3637
]
} | 25,241 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | exit | function exit() external {
getReward();
withdraw(balanceOf(msg.sender));
}
| // Get the earned rewards and withdraw staked tokens | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
4845,
4943
]
} | 25,242 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | getReward | function getReward() public {
updateReward(msg.sender);
uint256 reward = earned(msg.sender);
if (reward > 0) {
rewards[msg.sender] = 0;
rewardToken.safeTransfer(msg.sender, reward);
emit RewardPaid(msg.sender, reward);
}
}
| // Sends out the reward tokens to the user. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
4993,
5291
]
} | 25,243 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | notifyRewardAmount | function notifyRewardAmount(uint256 reward) external onlyOwner {
rewardToken.safeTransferFrom(msg.sender, address(this), reward);
updateRewardPerTokenStored();
if (block.timestamp >= periodFinish) {
rewardRate = reward.div(DURATION);
} else {
uint256 remaining = periodFinish.sub(block.ti... | // Called to start the pool with the reward amount it should distribute
// The reward period will be the duration of the pool. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
5428,
6050
]
} | 25,244 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | notifyRewardAmountWithoutUpdateTime | function notifyRewardAmountWithoutUpdateTime(uint256 reward) external onlyOwner {
updateRewardPerTokenStored();
if (block.timestamp >= periodFinish) {
rewardRate = reward.div(DURATION);
} else {
uint256 remaining = periodFinish.sub(block.timestamp);
uint256 leftover = remaining.mul(r... | // Notify the reward amount without updating time; | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
6107,
6577
]
} | 25,245 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | getTotalLevel | function getTotalLevel(address _user) external view returns (uint256) {
return deflector.getTotalLevel(address(this), _user);
}
| // Returns the users current multiplier level | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
6629,
6772
]
} | 25,246 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | getSpent | function getSpent(address _token, address _user) external view returns (uint256) {
return deflector.getTokensSpentPerContract(address(this), _token, _user);
}
| // Return the amount spent on multipliers, used for subtracting for future purchases. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
6864,
7038
]
} | 25,247 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | calculateCost | function calculateCost(
address _user,
address _token,
uint256 _level
) public view returns (uint256) {
uint256 lastLevel = deflector.getLastTokenLevelForUser(address(this), _token, _user);
if (lastLevel > _level) return 0;
return deflector.getSpendableCostPerTokenForUser(address(this), _user, _... | // Calculate the cost for purchasing a boost. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
7090,
7463
]
} | 25,248 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | purchase | function purchase(address _token, uint256 _level) external {
require(deflector.isSpendableTokenInContract(address(this), _token), "Not a multiplier token");
uint256 lastLevel = deflector.getLastTokenLevelForUser(address(this), msg.sender, _token);
require(lastLevel < _level, "Cannot downgrade level or same ... | // Purchase a multiplier level, same level cannot be purchased twice. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
7539,
8393
]
} | 25,249 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | getTotalMultiplier | function getTotalMultiplier(address _account) public view returns (uint256) {
return deflector.getTotalValueForUser(address(this), _account);
}
| // Returns the multiplier for user. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
8435,
8594
]
} | 25,250 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | eject | function eject() external onlyOwner {
require(startTime < block.timestamp && block.timestamp >= periodFinish, "Cannot eject before period finishes or pool has started");
uint256 currBalance = rewardToken.balanceOf(address(this));
rewardToken.safeTransfer(msg.sender, currBalance);
}
| // Ejects any remaining tokens from the pool.
// Callable only after the pool has started and the pools reward distribution period has finished. | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
8749,
9063
]
} | 25,251 | ||||
DeflectPoolRFIETH | contracts/DeflectPoolRFIETH.sol | 0xf539adbe6467c7c6e2b8f7aecf16747247b1f64f | Solidity | DeflectPoolRFIETH | contract DeflectPoolRFIETH is LPTokenWrapper, OwnableUpgradeSafe {
using SafeERC20 for IERC20;
IERC20 public rewardToken;
IDeflector deflector;
uint256 public DURATION;
uint256 public periodFinish;
uint256 public lastUpdateTime;
uint256 public rewardRate;
uint256 public rewardPerTokenSt... | kill | function kill() external onlyOwner {
periodFinish = block.timestamp;
}
| // Forcefully retire a pool
// Only sets the period finish to 0
// This will prevent more rewards from being disbursed | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
9196,
9282
]
} | 25,252 | ||||
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | Token | contract Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public ... | // Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20 | LineComment | balanceOf | function balanceOf(address _owner) constant returns (uint256 balance);
| /// @param _owner The address from which the balance will be retrieved
/// @return The balance | NatSpecSingleLine | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
629,
704
]
} | 25,253 | |
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | Token | contract Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public ... | // Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20 | LineComment | transfer | function transfer(address _to, uint256 _value) returns (bool success);
| /// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
941,
1016
]
} | 25,254 | |
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | Token | contract Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public ... | // Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20 | LineComment | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
| /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
1339,
1433
]
} | 25,255 | |
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | Token | contract Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public ... | // Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20 | LineComment | approve | function approve(address _spender, uint256 _value) returns (bool success);
| /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not | NatSpecSingleLine | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
1717,
1796
]
} | 25,256 | |
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | Token | contract Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public ... | // Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20 | LineComment | allowance | function allowance(address _owner, address _spender) constant returns (uint256 remaining);
| /// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent | NatSpecSingleLine | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
2004,
2099
]
} | 25,257 | |
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | DZoneCoin | contract DZoneCoin is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to custo... | DZoneCoin | function DZoneCoin(
uint256 _initialAmount,
string _tokenName,
uint8 _decimalUnits,
string _tokenSymbol
) {
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens
totalSupply = _initialAmount; // Update total supply
name... | //human 0.1 standard. Just an arbitrary versioning scheme. | LineComment | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
918,
1573
]
} | 25,258 | |||
DZoneCoin | DZoneCoin.sol | 0x14903ad104da65729b99bbd64c47fb7d75f8548a | Solidity | DZoneCoin | contract DZoneCoin is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to custo... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually s... | /* Approves and then calls the receiving contract */ | Comment | v0.4.23+commit.124ca40d | bzzr://c769dfde57e818944d4a80a9b225d64301497f0ab5ccffca9d1aa2091ee7b2c3 | {
"func_code_index": [
1634,
2439
]
} | 25,259 | |||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | set_quarter_details | function set_quarter_details(
IKladeDiffToken alpha_token_contract,
IKladeDiffToken omega_token_contract,
IChainlinkOracle chainlink_diff_oracle,
IChainlinkOracle chainlink_blocknum_oracle,
uint256 required_collateral,
uint256 hedged_revenue,
uint256 miner_earnings
) external {
... | /**
* Set basic quarter details for Chainlink Receiver
* @param alpha_token_contract IKladeDiffToken - Klade Alpha Token Contract
* @param omega_token_contract IKladeDifFToken - Klade Omega Token Contract
* @param chainlink_diff_oracle IChainlinkOracle - Chainlink oracle contract that provides difficulty inform... | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
3493,
4424
]
} | 25,260 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | getChainlinkUpdate | function getChainlinkUpdate() external returns (bool updated) {
require(Q3_set, "Quarter details not set yet");
uint256 i = Q3_details.number_of_updates;
require(i < 13, "All datapoints for the quarter have been collected");
ChainlinkUpdate memory current_update =
read_chainlink(
... | /**
* At the call to getChainlinkUpdate at the beginning or end of the quarter, the current_block_number should
* be passed in as the block number at the beginning or end of the quarter.
* On all other calls, current_block_number should be fed as the block number
* at the most recent time the Oracle has updated... | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
4787,
6186
]
} | 25,261 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | new_chainlink_data | function new_chainlink_data(
ChainlinkUpdate memory last_update,
ChainlinkUpdate memory current_update
) internal pure returns (bool new_data) {
bool new_difficulty_data =
current_update.diff_roundID != last_update.diff_roundID;
bool new_blocknum_data =
current_update.blocknum_rou... | /**
* Checks if the current_update has updated difficulty and block_number values
* compared to last_update. If either the difficulty or the block_number has
* not been updated by Chainlink, this returns false.
* @param last_update ChainlinkUpdate - previous update data returned by Chainlink Oracle
* @param c... | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
6628,
7083
]
} | 25,262 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | read_chainlink | function read_chainlink(
IChainlinkOracle blocknum_oracle,
IChainlinkOracle diff_oracle
) internal view returns (ChainlinkUpdate memory latest) {
uint80 updated_roundID_diff;
int256 current_diff;
uint256 startedAt;
uint256 updatedAt;
uint80 answeredInRound;
int256 current_blockn... | /**
* Calls Chainlink's Oracles, gets the latest data, and returns it.
* @param blocknum_oracle IChainlinkOracle - Chainlink block number oracle
* @param diff_oracle IChainlinkOracle - Chainlink difficulty number oracle
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
7338,
8384
]
} | 25,263 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | additional_miner_earnings | function additional_miner_earnings(
ChainlinkUpdate memory last_update,
ChainlinkUpdate memory current_update
) internal view returns (uint256 earnings) {
uint256 startBlock = last_update.block_number;
uint256 startDiff = last_update.difficulty;
uint256 endBlock = current_update.block_number;
... | /**
* Revenue (in WBTC base units) for 10 TH/s over the blocks from startBlock to endBlock
* does not account for if there is a halving in between a difficulty update.
* should not be relevant for Q3 2021
* @param last_update ChainlinkUpdate - previous update data returned by Chainlink Oracle
* @param current... | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
8820,
10200
]
} | 25,264 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | get_last_diff_update | function get_last_diff_update(uint256 block_num)
internal
view
returns (uint256)
{
return
safemath.sub(
block_num,
safemath.mod(block_num, numBlockBetweenDiffChanges)
);
}
| /**
* Returns the Bitcoin block number when difficulty was last updated prior to the given block_num
* @param block_num uint - bitcoin block number
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
10377,
10659
]
} | 25,265 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | earnings_on_block | function earnings_on_block(uint256 difficulty, uint256 block_number)
internal
view
returns (uint256)
{
uint256 numerator =
safemath.mul(factor, block_reward_on_block(block_number));
return safemath.div(numerator, difficulty);
}
| /**
* Returns earnings in WBTC base units
* @param difficulty uint - bitcoin network difficulty
* @param block_number uint - bitcoin block number
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
10840,
11140
]
} | 25,266 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | block_reward_on_block | function block_reward_on_block(uint256 block_number)
internal
view
returns (uint256)
{
uint256 divisor =
2**(safemath.div(block_number, blocksBetweenHalvings));
return safemath.div(initialBlockReward, divisor);
}
| /**
* Returns bitcoin block reward in WBTC base units
* @param block_number uint - bitcoin block number
*/ | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
11273,
11558
]
} | 25,267 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | check_reasonable_values | function check_reasonable_values(ChainlinkUpdate memory update)
internal
view
returns (bool reasonable)
{
uint256 update_diff = update.difficulty;
uint256 update_block_number = update.block_number;
uint256 number_of_updates = Q3_details.number_of_updates;
if (
(update_diff >... | /**
* Check that the values that are trying to be added to the ChainlinkData
* for a quarter actually makes sense.
* Returns True if the update seems reasonable and returns false if the update
* values seems unreasonable
* Very generous constraints that are just sanity checks.
* @param update ChainlinkUpd... | NatSpecMultiLine | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
11982,
13229
]
} | 25,268 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | set_payouts | function set_payouts() public {
require(
Q3_details.number_of_updates == 13,
"Need 13 datapoints before setting payout"
);
require(
(block.timestamp >= Q3_details.end_unix),
"You cannot set a payout yet"
);
uint256 hedged_revenue = Q3_details.hedged_revenue... | // payouts are set in WBTC base units for 1.0 tokens | LineComment | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
13290,
14494
]
} | 25,269 | ||
ChainlinkReceiver | ChainlinkReceiver.sol | 0xd6adce6d6049fb7d9ded629a7dfa34984310fcb0 | Solidity | ChainlinkReceiver | contract ChainlinkReceiver {
uint256 constant multiple = 10**7;
uint256 constant initial_factor = 1396984; // initial_factor = 600 * 10^13 / 2^32 rounded to nearest whole number
// factor = block_reward * seconds_per_block * Hashes_per_second * WBTC_adjustment_factor / constant
// Formula for Earni... | anyTokenTransfer | function anyTokenTransfer(
IERC20 token,
uint256 num,
address to
) external returns (bool success) {
require(
(msg.sender == KladeAddress1 || msg.sender == KladeAddress2),
"Only Klade can recover tokens"
);
return token.transfer(to, num);
}
| // If any address accidentally sends any ERC20 token to this address,
// they can contact us. Off-chain we will verify that the address did
// in fact accidentally send tokens and return them. | LineComment | v0.7.3+commit.9bfce1f6 | None | ipfs://f2c287e64a52349e9a690f2b544b78d710907037e80c1f2cc8b07282c1792e72 | {
"func_code_index": [
14705,
15040
]
} | 25,270 | ||
Migration | Migration.sol | 0xcbf8412e939b7712251eb5ec07220573283a4e90 | Solidity | Migration | contract Migration is Context, Ownable {
using SafeMath for uint256;
address public safe;
address public safe2;
uint256 public constant migrationDuration = 5 days; // 10/01/2020 @ 12:00am (UTC)
uint256 public constant startTime = 1601078400; // set to now for testing 09/26/2020 @ 12:00a... | /**
* @title SAFE2 Migration
* @dev SAFE2 Mintable Token with migration from legacy contract. Used as an inbetween for COVER.
*/ | NatSpecMultiLine | migrate | function migrate() external {
require(block.timestamp >= startTime, "SAFE2 migration has not started");
require(block.timestamp < startTime + migrationDuration, "SAFE2 migration has ended");
// Current balance of SAFE for user.
uint256 safeBalance = SAFE(safe).balanceOf(_msgSender());
// Ma... | /**
* @dev Migrate a users' entire balance
*
* One way function. SAFE1 tokens are BURNED. SAFE2 tokens are minted.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://4dc31e537f7e0a46b2e966eacf2b3fc44291357736a42b7aad663e7d428fb8dd | {
"func_code_index": [
720,
1480
]
} | 25,271 |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | SafeMath | library SafeMath {
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
funct... | /**
* @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.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
133,
249
]
} | 25,272 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | SafeMath | library SafeMath {
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
funct... | /**
* @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.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
313,
443
]
} | 25,273 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| /**
* @dev Total number of tokens in existence
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
199,
287
]
} | 25,274 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
| /**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
445,
777
]
} | 25,275 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token... | /**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
983,
1087
]
} | 25,276 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_... | /**
* @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.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
401,
858
]
} | 25,277 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
1484,
1679
]
} | 25,278 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | allowance | function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
2003,
2134
]
} | 25,279 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | increaseApproval | function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender T... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
2594,
2868
]
} | 25,280 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... | /**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/ | NatSpecMultiLine | decreaseApproval | function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit A... | /**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender T... | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
3333,
3754
]
} | 25,281 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | 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.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
815,
932
]
} | 25,282 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | 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 {
_transferOwnership(_newOwner);
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
1097,
1205
]
} | 25,283 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | 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) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| /**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
1343,
1521
]
} | 25,284 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | Claimable | contract Claimable is Ownable {
address public pendingOwner;
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
/**
* @dev Allows the current owner to set the pendingOwner ad... | /**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) onlyOwner public {
pendingOwner = newOwner;
}
| /**
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
395,
496
]
} | 25,285 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | Solidity | Claimable | contract Claimable is Ownable {
address public pendingOwner;
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
/**
* @dev Allows the current owner to set the pendingOwner ad... | /**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/ | NatSpecMultiLine | claimOwnership | function claimOwnership() onlyPendingOwner public {
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
| /**
* @dev Allows the pendingOwner address to finalize the transfer.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
582,
753
]
} | 25,286 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | 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 ca... | /**
* @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.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
511,
607
]
} | 25,287 | |
UniversalUSD | UniversalUSD.sol | 0x1c2dee28e339ea852262a0f906647ed3d4bf1ba7 | 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 ca... | /**
* @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.25+commit.59dbf8f1 | bzzr://bf5fb6268c37b67444ce98723494552c5869d67c00bf62939955f4033a713f32 | {
"func_code_index": [
691,
789
]
} | 25,288 | |
TokenTraderFactory | TokenTraderFactory.sol | 0xa0264dc5b89692dde2315090a35bed2ba15508b4 | Solidity | TokenTrader | contract TokenTrader is owned {
address public asset; // address of token
uint256 public sellPrice; // contract sells lots of tokens at this price
uint256 public units; // lot size (token-wei)
bool public sellsTokens; // is contract selling
event ActivatedEvent(bool sells... | // contract can sell tokens for ETH
// prices are in amount of wei per batch of token units | LineComment | activate | function activate (
bool _sellsTokens
) onlyOwner
{
sellsTokens = _sellsTokens;
ActivatedEvent(sellsTokens);
}
| // modify trading behavior | LineComment | v0.4.11+commit.68ef5810 | bzzr://6c151c668a807a25782eda697fa632e045917c17bedcdac34cd53488dbb85fe2 | {
"func_code_index": [
743,
915
]
} | 25,289 | |
TokenTraderFactory | TokenTraderFactory.sol | 0xa0264dc5b89692dde2315090a35bed2ba15508b4 | Solidity | TokenTrader | contract TokenTrader is owned {
address public asset; // address of token
uint256 public sellPrice; // contract sells lots of tokens at this price
uint256 public units; // lot size (token-wei)
bool public sellsTokens; // is contract selling
event ActivatedEvent(bool sells... | // contract can sell tokens for ETH
// prices are in amount of wei per batch of token units | LineComment | withdrawAsset | function withdrawAsset(uint256 _value) onlyOwner returns (bool ok)
{
return ERC20(asset).transfer(owner,_value);
UpdateEvent();
}
| // allow owner to remove trade token | LineComment | v0.4.11+commit.68ef5810 | bzzr://6c151c668a807a25782eda697fa632e045917c17bedcdac34cd53488dbb85fe2 | {
"func_code_index": [
960,
1122
]
} | 25,290 | |
TokenTraderFactory | TokenTraderFactory.sol | 0xa0264dc5b89692dde2315090a35bed2ba15508b4 | Solidity | TokenTrader | contract TokenTrader is owned {
address public asset; // address of token
uint256 public sellPrice; // contract sells lots of tokens at this price
uint256 public units; // lot size (token-wei)
bool public sellsTokens; // is contract selling
event ActivatedEvent(bool sells... | // contract can sell tokens for ETH
// prices are in amount of wei per batch of token units | LineComment | withdrawToken | function withdrawToken(address _token, uint256 _value) onlyOwner returns (bool ok)
{
return ERC20(_token).transfer(owner,_value);
UpdateEvent();
}
| // allow owner to remove arbitrary tokens
// included just in case contract receives wrong token | LineComment | v0.4.11+commit.68ef5810 | bzzr://6c151c668a807a25782eda697fa632e045917c17bedcdac34cd53488dbb85fe2 | {
"func_code_index": [
1232,
1411
]
} | 25,291 | |
TokenTraderFactory | TokenTraderFactory.sol | 0xa0264dc5b89692dde2315090a35bed2ba15508b4 | Solidity | TokenTrader | contract TokenTrader is owned {
address public asset; // address of token
uint256 public sellPrice; // contract sells lots of tokens at this price
uint256 public units; // lot size (token-wei)
bool public sellsTokens; // is contract selling
event ActivatedEvent(bool sells... | // contract can sell tokens for ETH
// prices are in amount of wei per batch of token units | LineComment | withdraw | function withdraw(uint256 _value) onlyOwner returns (bool ok)
{
if(this.balance >= _value) {
return owner.send(_value);
}
UpdateEvent();
}
| // allow owner to remove ETH | LineComment | v0.4.11+commit.68ef5810 | bzzr://6c151c668a807a25782eda697fa632e045917c17bedcdac34cd53488dbb85fe2 | {
"func_code_index": [
1448,
1641
]
} | 25,292 | |
TokenTraderFactory | TokenTraderFactory.sol | 0xa0264dc5b89692dde2315090a35bed2ba15508b4 | Solidity | TokenTrader | contract TokenTrader is owned {
address public asset; // address of token
uint256 public sellPrice; // contract sells lots of tokens at this price
uint256 public units; // lot size (token-wei)
bool public sellsTokens; // is contract selling
event ActivatedEvent(bool sells... | // contract can sell tokens for ETH
// prices are in amount of wei per batch of token units | LineComment | buy | function buy() payable {
if(sellsTokens || msg.sender == owner)
{
uint order = msg.value / sellPrice;
uint can_sell = ERC20(asset).balanceOf(address(this)) / units;
if(order > can_sell)
{
uint256 change = msg.value - (can_sell * sellPrice);
o... | //user buys token with ETH | LineComment | v0.4.11+commit.68ef5810 | bzzr://6c151c668a807a25782eda697fa632e045917c17bedcdac34cd53488dbb85fe2 | {
"func_code_index": [
1676,
2392
]
} | 25,293 | |
TokenTraderFactory | TokenTraderFactory.sol | 0xa0264dc5b89692dde2315090a35bed2ba15508b4 | Solidity | TokenTrader | contract TokenTrader is owned {
address public asset; // address of token
uint256 public sellPrice; // contract sells lots of tokens at this price
uint256 public units; // lot size (token-wei)
bool public sellsTokens; // is contract selling
event ActivatedEvent(bool sells... | // contract can sell tokens for ETH
// prices are in amount of wei per batch of token units | LineComment | function () payable {
buy();
}
| // sending ETH to contract sells GNT to user | LineComment | v0.4.11+commit.68ef5810 | bzzr://6c151c668a807a25782eda697fa632e045917c17bedcdac34cd53488dbb85fe2 | {
"func_code_index": [
2445,
2494
]
} | 25,294 | ||
NearBridge | contracts/Ed25519.sol | 0xd41878e50ad4cbccb99f20a450427b442bdef456 | Solidity | Ed25519 | contract Ed25519 {
// Computes (v^(2^250-1), v^11) mod p
function pow22501(uint256 v) private pure returns (uint256 p22501, uint256 p11) {
p11 = mulmod(v, v, 0x7fffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffed);
p22501 = mulmod(p11, p11, 0x7fffffff_ffffffff_ffffffff_fff... | pow22501 | function pow22501(uint256 v) private pure returns (uint256 p22501, uint256 p11) {
p11 = mulmod(v, v, 0x7fffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffed);
p22501 = mulmod(p11, p11, 0x7fffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffff_ffffffed);
p22501 = mulmod(
... | // Computes (v^(2^250-1), v^11) mod p | LineComment | v0.6.12+commit.27d51765 | None | ipfs://6ea1e8ac6d0cd14a4be5d187567bc3bf10bec74347e3d26f380bc332847bed38 | {
"func_code_index": [
63,
26777
]
} | 25,295 | ||
HybridProxy | HybridProxy.sol | 0x16b4c91735737c4f80b8492a8bc9caca715b63f5 | Solidity | HybridProxy | contract HybridProxy {
struct Snapshot {
uint256 tokens_balance;
uint256 eth_balance;
}
Contract contr;
uint256 public eth_balance;
ERC20 public token;
mapping (address => uint8) public contributor_rounds;
Snapshot[] public snapshots;
address owner;
uint8 public rounds;
c... | withdraw | function withdraw() {
/* require(contract_token_balance != 0); */
if (contributor_rounds[msg.sender] < rounds) {
uint256 balance = contr.balances_bonus(msg.sender);
Snapshot storage snapshot = snapshots[contributor_rounds[msg.sender]];
uint256 tokens_to_withdraw = (balance * snapshot.to... | //public functions | LineComment | v0.4.24+commit.e67f0147 | bzzr://2525c5467e23ab82ff4a90c09b828a9b583d007c9d4104d83ce05553e2d33614 | {
"func_code_index": [
546,
1192
]
} | 25,296 | |||
TokenERC20 | TokenERC20.sol | 0x91e3cc8ac4391a9c455c1f064e8babed25e94e0c | Solidity | TokenERC20 | contract TokenERC20 {
string public name; // ERC20标准
string public symbol; // ERC20标准
uint8 public decimals = 18; // ERC20标准,decimals 可以有的小数点个数,最小的代币单位。18 是建议的默认值
uint256 public totalSupply; // ERC20标准 总供应量
// 用mapping保存每个地址对应的余额 ERC20标准
mapping (address => uint256) public balanceOf;
... | TokenERC20 | function TokenERC20(uint256 initialSupply, string tokenName, string tokenSymbol) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // 供应的份额,份额跟最小的代币单位有关,份额 = 币数 * 10 ** decimals。
balanceOf[msg.sender] = totalSupply; // 创建者拥有所有的代币
name = tokenName; ... | /**
* 初始化构造
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | None | bzzr://28dc287f690001c7611af91d99787df997a070920ada3984221f7d18fc58ae8c | {
"func_code_index": [
650,
1077
]
} | 25,297 | ||
TokenERC20 | TokenERC20.sol | 0x91e3cc8ac4391a9c455c1f064e8babed25e94e0c | Solidity | TokenERC20 | contract TokenERC20 {
string public name; // ERC20标准
string public symbol; // ERC20标准
uint8 public decimals = 18; // ERC20标准,decimals 可以有的小数点个数,最小的代币单位。18 是建议的默认值
uint256 public totalSupply; // ERC20标准 总供应量
// 用mapping保存每个地址对应的余额 ERC20标准
mapping (address => uint256) public balanceOf;
... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// 确保目标地址不为0x0,因为0x0地址代表销毁
require(_to != 0x0);
// 检查发送者余额
require(balanceOf[_from] >= _value);
// 确保转移为正数个
require(balanceOf[_to] + _value > balanceOf[_to]);
// 以下用来检查交易,
uint previousBalances = balanceOf[_... | /**
* 代币交易转移的内部实现
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | None | bzzr://28dc287f690001c7611af91d99787df997a070920ada3984221f7d18fc58ae8c | {
"func_code_index": [
1118,
1797
]
} | 25,298 | ||
TokenERC20 | TokenERC20.sol | 0x91e3cc8ac4391a9c455c1f064e8babed25e94e0c | Solidity | TokenERC20 | contract TokenERC20 {
string public name; // ERC20标准
string public symbol; // ERC20标准
uint8 public decimals = 18; // ERC20标准,decimals 可以有的小数点个数,最小的代币单位。18 是建议的默认值
uint256 public totalSupply; // ERC20标准 总供应量
// 用mapping保存每个地址对应的余额 ERC20标准
mapping (address => uint256) public balanceOf;
... | transfer | function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
| /**
* 代币交易转移
* 从自己(创建交易者)账号发送`_value`个代币到 `_to`账号
* ERC20标准
* @param _to 接收者地址
* @param _value 转移数额
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | None | bzzr://28dc287f690001c7611af91d99787df997a070920ada3984221f7d18fc58ae8c | {
"func_code_index": [
1946,
2058
]
} | 25,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.