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
SynergisSGRToken
SynergisSGRToken.sol
0x3d23a5bfadf33cb0aeb47d607605ffe9f9596327
Solidity
SynergisSGRToken
contract SynergisSGRToken is StandardToken, Ownable { string public constant name = "Reputation SGR"; string public constant symbol = "SGR"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1000000 * (10 ** uint256(decimals)); /////////////// // VAR...
//
LineComment
mintTokens
function mintTokens(uint256 newEmission) external onlyOwner returns (bool) { require(newEmission > 0); balances[address(this)] = balances[address(this)].add(newEmission); totalSupply = totalSupply.add(newEmission); allowed[address(this)][proxydeposit] = allowed[address(this)][proxydeposit].add(newE...
//Add New tokens to contract balance // newemission - number of new tokens (WITH decimals!!!!!)
LineComment
v0.4.24+commit.e67f0147
bzzr://805d6b17bb31e66ad02fe20cd9ab5ae752bdc7390e599206d29da066a4aa41a4
{ "func_code_index": [ 1310, 1796 ] }
19,500
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev r...
add
function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; }
/** * @dev give an account access to this role */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 134, 301 ] }
19,501
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev r...
remove
function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; }
/** * @dev remove an account's access to this role */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 366, 536 ] }
19,502
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev r...
has
function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; }
/** * @dev check if an account has this role * @return bool */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 613, 765 ] }
19,503
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 94, 154 ] }
19,504
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 237, 310 ] }
19,505
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 534, 616 ] }
19,506
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 895, 983 ] }
19,507
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 1647, 1726 ] }
19,508
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 2039, 2141 ] }
19,509
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 259, 445 ] }
19,510
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 723, 864 ] }
19,511
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 1162, 1359 ] }
19,512
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 1613, 2089 ] }
19,513
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts 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 invalid opcode to reve...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 2560, 2697 ] }
19,514
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
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.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 3188, 3471 ] }
19,515
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
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.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 3931, 4066 ] }
19,516
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
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 ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
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.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 4546, 4717 ] }
19,517
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
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.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 606, 1230 ] }
19,518
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
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: u...
/** * @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.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 2160, 2559 ] }
19,519
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) 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.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 3315, 3493 ] }
19,520
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 3718, 3919 ] }
19,521
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 4289, 4520 ] }
19,522
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 4771, 5092 ] }
19,523
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
safeApprove
function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line ...
/** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 747, 1374 ] }
19,524
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
_callOptionalReturn
function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target ad...
/** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 2393, 3159 ] }
19,525
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
YieldContract
contract YieldContract is YieldRoles { using SafeERC20 for IERC20; IERC20 token; // Timeframe in which it it possible to deposit tokens uint256 public endDepositTime; // Max tokens to be deposited uint256 internal maxTokens; // Originating wallet for yield payments ...
/** * @dev A token holder contract that will allow a beneficiary to extract the * tokens after a given release time. * * Useful for simple vesting schedules like "advisors get all of their tokens * after 1 year". */
NatSpecMultiLine
deposit3m
function deposit3m(address beneficiary, uint256 amount) external { deposit(beneficiary, amount, 90 days); }
// Deposit for 3, 6 or 12 months
LineComment
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 1496, 1622 ] }
19,526
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
YieldContract
contract YieldContract is YieldRoles { using SafeERC20 for IERC20; IERC20 token; // Timeframe in which it it possible to deposit tokens uint256 public endDepositTime; // Max tokens to be deposited uint256 internal maxTokens; // Originating wallet for yield payments ...
/** * @dev A token holder contract that will allow a beneficiary to extract the * tokens after a given release time. * * Useful for simple vesting schedules like "advisors get all of their tokens * after 1 year". */
NatSpecMultiLine
updateBeneficiary
function updateBeneficiary(uint256 lockBoxNumber, address newBeneficiary) public { LockBoxStruct storage l = lockBoxStructs[lockBoxNumber]; require(msg.sender == l.beneficiary); l.beneficiary = newBeneficiary; }
// Beneficiaries can update the receiver wallet
LineComment
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 3220, 3468 ] }
19,527
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
YieldContract
contract YieldContract is YieldRoles { using SafeERC20 for IERC20; IERC20 token; // Timeframe in which it it possible to deposit tokens uint256 public endDepositTime; // Max tokens to be deposited uint256 internal maxTokens; // Originating wallet for yield payments ...
/** * @dev A token holder contract that will allow a beneficiary to extract the * tokens after a given release time. * * Useful for simple vesting schedules like "advisors get all of their tokens * after 1 year". */
NatSpecMultiLine
triggerWithdrawAll
function triggerWithdrawAll() public { for (uint256 i = 0; i < lockBoxStructs.length; ++i) { if (lockBoxStructs[i].releaseTime <= now && lockBoxStructs[i].balance > 0) { withdraw(i); } } }
// Helper function to release everything
LineComment
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 3861, 4120 ] }
19,528
YieldContract
YieldContract.sol
0x59490052ea18d4fd974657d0aa7c8424d456d353
Solidity
YieldContract
contract YieldContract is YieldRoles { using SafeERC20 for IERC20; IERC20 token; // Timeframe in which it it possible to deposit tokens uint256 public endDepositTime; // Max tokens to be deposited uint256 internal maxTokens; // Originating wallet for yield payments ...
/** * @dev A token holder contract that will allow a beneficiary to extract the * tokens after a given release time. * * Useful for simple vesting schedules like "advisors get all of their tokens * after 1 year". */
NatSpecMultiLine
updateEndDepositTime
function updateEndDepositTime (uint256 newEndTime) public onlyOwner { endDepositTime = newEndTime; }
// Admin update functions
LineComment
v0.5.12+commit.7709ece9
None
bzzr://f314baa37527070830373c108bd824ff1bdf0d3244ad87134a8149624ae0c71b
{ "func_code_index": [ 4158, 4277 ] }
19,529
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
Context
contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (addres...
/* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending ...
Comment
_msgSender
function _msgSender() internal view returns (address payable) { return msg.sender; }
// solhint-disable-previous-line no-empty-blocks
LineComment
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 265, 368 ] }
19,530
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 94, 154 ] }
19,531
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 237, 310 ] }
19,532
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 534, 616 ] }
19,533
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 895, 983 ] }
19,534
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1647, 1726 ] }
19,535
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 2039, 2141 ] }
19,536
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 251, 437 ] }
19,537
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 707, 848 ] }
19,538
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1180, 1377 ] }
19,539
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1623, 2099 ] }
19,540
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts 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 invalid opcode to reve...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 2562, 2699 ] }
19,541
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 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.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 3224, 3574 ] }
19,542
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
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.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 4026, 4161 ] }
19,543
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
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 (uint256...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
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.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 4675, 4846 ] }
19,544
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 299, 395 ] }
19,545
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 453, 568 ] }
19,546
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 776, 939 ] }
19,547
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 997, 1136 ] }
19,548
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1278, 1435 ] }
19,549
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amou...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1902, 2211 ] }
19,550
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 2615, 2830 ] }
19,551
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 3328, 3594 ] }
19,552
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exc...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 4079, 4555 ] }
19,553
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 4831, 5144 ] }
19,554
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amo...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 5471, 5824 ] }
19,555
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); }
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 6259, 6602 ] }
19,556
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_burnFrom
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); }
/** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 6783, 7020 ] }
19,557
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[accou...
/** * @title Roles * @dev Library for managing addresses assigned to a Role. */
NatSpecMultiLine
add
function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; }
/** * @dev Give an account access to this role. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 156, 339 ] }
19,558
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[accou...
/** * @title Roles * @dev Library for managing addresses assigned to a Role. */
NatSpecMultiLine
remove
function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; }
/** * @dev Remove an account's access to this role. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 414, 602 ] }
19,559
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
Roles
library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[accou...
/** * @title Roles * @dev Library for managing addresses assigned to a Role. */
NatSpecMultiLine
has
function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; }
/** * @dev Check if an account has this role. * @return bool */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 692, 900 ] }
19,560
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20Mintable
contract ERC20Mintable is ERC20, MinterRole { /** * @dev See {ERC20-_mint}. * * Requirements: * * - the caller must have the {MinterRole}. */ function mint(address account, uint256 amount) public onlyMinter returns (bool) { _mint(account, amount); return t...
/** * @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole}, * which have permission to mint (create) new tokens as they see fit. * * At construction, the deployer of the contract is the only minter. */
NatSpecMultiLine
mint
function mint(address account, uint256 amount) public onlyMinter returns (bool) { _mint(account, amount); return true; }
/** * @dev See {ERC20-_mint}. * * Requirements: * * - the caller must have the {MinterRole}. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 184, 332 ] }
19,561
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ con...
/** * @dev Optional functions from the ERC20 standard. */
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 550, 638 ] }
19,562
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ con...
/** * @dev Optional functions from the ERC20 standard. */
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 752, 844 ] }
19,563
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ con...
/** * @dev Optional functions from the ERC20 standard. */
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * *...
NatSpecMultiLine
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1402, 1490 ] }
19,564
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
SWP4_Contest
contract SWP4_Contest is ReentrancyGuard { using SafeMath for uint256; //Contest finish time uint public finishTime; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible token unit. // So, if you are using a rate of 1 with a ERC20...
withdraw
function withdraw(uint256 _amount) public payable onlyBy(owner) { require(weiRaised >= weiTakenByOwner.add(_amount)*2, "Cannot take too much, owner can take up to 50% of total WEI deposited"); weiTakenByOwner = weiTakenByOwner.add(_amount); owner.transfer(_amount); }
//Function that can be called by creator to withdraw up to 50% of eth deposited. Contract will always hold 50% until contest is over.
LineComment
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1526, 1814 ] }
19,565
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
SWP4_Contest
contract SWP4_Contest is ReentrancyGuard { using SafeMath for uint256; //Contest finish time uint public finishTime; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible token unit. // So, if you are using a rate of 1 with a ERC20...
deposit
function deposit() public payable onlyBy(owner) atState(ContestStates.IN_PROGRESS) { require(msg.value > 0, "Cannot deposit zero ETH"); uint256 weiAmount = msg.value; weiRaised = weiRaised.add(weiAmount); }
//Function that can be called by creator to deposit eth without having tokens issues.
LineComment
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 1906, 2133 ] }
19,566
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
SWP4_Contest
contract SWP4_Contest is ReentrancyGuard { using SafeMath for uint256; //Contest finish time uint public finishTime; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible token unit. // So, if you are using a rate of 1 with a ERC20...
buyTokens
function buyTokens() public nonReentrant payable atState(ContestStates.IN_PROGRESS) { require(msg.value > 0, "Cannot buy tokens with zero ETH"); require(token.isMinter(address(this)), "Contest contract MUST became a minter of token before token sale"); uint256 weiAmount = msg.value; uint256 tokens = weiAmou...
//Receive eth and issue tokens at a given rate per token. //Contest ends at finishTime and will not except eth after that date.
LineComment
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 2270, 2699 ] }
19,567
SWP4_Contest
SWP4_Contest.sol
0x9cfed9a6c0f57ff47f860ba89f6f032ea1bbf373
Solidity
SWP4_Contest
contract SWP4_Contest is ReentrancyGuard { using SafeMath for uint256; //Contest finish time uint public finishTime; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible token unit. // So, if you are using a rate of 1 with a ERC20...
pickWinner
function pickWinner(address payable _winner) public onlyBy(owner) atState(ContestStates.COLLECTION_FINISHED) { require(_winner != 0x0000000000000000000000000000000000000000, "Winner address cannot be 0"); _winner.transfer(weiRaised.sub(weiTakenByOwner)); winner = _winner; }
//Function that can be called by creator only after finishTime, that allows creator to enter a wallet address //and send out remaining balance of eth in contract to entered wallet.
LineComment
v0.5.12+commit.7709ece9
None
bzzr://b0d8870369905604f8589468622d31fc7bb2ec5ccb9de53bae151d0bf46db28c
{ "func_code_index": [ 2889, 3184 ] }
19,568
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
approveToken
function approveToken() external virtual onlyController { address strategy = controller.strategy(address(this)); token.safeApprove(strategy, MAX_UINT_VALUE); IERC20(IStrategy(strategy).token()).safeApprove(strategy, MAX_UINT_VALUE); }
/// @dev Approve strategy to spend collateral token and strategy token of pool.
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 954, 1225 ] }
19,569
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
resetApproval
function resetApproval() external virtual onlyController { address strategy = controller.strategy(address(this)); token.safeApprove(strategy, 0); IERC20(IStrategy(strategy).token()).safeApprove(strategy, 0); }
/// @dev Reset token approval of strategy. Called when updating strategy.
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 1307, 1553 ] }
19,570
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
rebalance
function rebalance() external virtual { IStrategy strategy = IStrategy(controller.strategy(address(this))); strategy.rebalance(); }
/** * @dev Rebalance invested collateral to mitigate liquidation risk, if any. * Behavior of rebalance is driven by risk parameters defined in strategy. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 1735, 1894 ] }
19,571
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
sweepErc20
function sweepErc20(address _erc20) external virtual { _sweepErc20(_erc20); }
/** * @dev Convert given ERC20 token into collateral token via Uniswap * @param _erc20 Token address */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 2024, 2120 ] }
19,572
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
tokenLocked
function tokenLocked() public view virtual returns (uint256) { IStrategy strategy = IStrategy(controller.strategy(address(this))); return strategy.totalLocked(); }
/// @dev Returns collateral token locked in strategy
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 2181, 2372 ] }
19,573
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
totalValue
function totalValue() public view override returns (uint256) { return tokenLocked().add(tokensHere()); }
/// @dev Returns total value of vesper pool, in terms of collateral token
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 2454, 2577 ] }
19,574
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
_afterBurning
function _afterBurning(uint256 _amount) internal override { uint256 balanceHere = tokensHere(); if (balanceHere < _amount) { _withdrawCollateral(_amount.sub(balanceHere)); balanceHere = tokensHere(); _amount = balanceHere < _amount ? balanceHere : _amount; } token.safeTran...
/** * @dev After burning hook, it will be called during withdrawal process. * It will withdraw collateral from strategy and transfer it to user. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 2751, 3139 ] }
19,575
VLINK
contracts/pools/VTokenBase.sol
0x0a27e910aee974d05000e05eab8a4b8ebd93d40c
Solidity
VTokenBase
abstract contract VTokenBase is PoolShareToken { address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; constructor( string memory name, string memory symbol, address _token, address _controller ) public PoolShareToken(name, symbol, _token, _con...
_beforeBurning
function _beforeBurning( uint256 /* shares */ ) internal override { IStrategy strategy = IStrategy(controller.strategy(address(this))); strategy.beforeWithdraw(); }
/** * @dev Before burning hook. * Some actions, like resurface(), can impact share price and has to be called before withdraw. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://81fe5bc2e35a760b7f94bc1539af5866d55b6e5de89ec1822e59a695f1e5a04c
{ "func_code_index": [ 3295, 3501 ] }
19,576
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view r...
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 104, 168 ] }
19,577
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view r...
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 261, 338 ] }
19,578
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view r...
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 584, 670 ] }
19,579
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view r...
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 971, 1063 ] }
19,580
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view r...
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 1770, 1853 ] }
19,581
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view r...
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 2194, 2300 ] }
19,582
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 290, 496 ] }
19,583
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 805, 958 ] }
19,584
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 1287, 1504 ] }
19,585
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 1789, 2309 ] }
19,586
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts 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 invalid opcode to reve...
NatSpecMultiLine
v0.6.12+commit.27d51765
None
ipfs://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 2817, 2966 ] }
19,587
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 3494, 3801 ] }
19,588
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 4298, 4445 ] }
19,589
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 4962, 5149 ] }
19,590
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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. * * Amon...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 658, 1322 ] }
19,591
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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. * * Amon...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 2301, 2727 ] }
19,592
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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. * * Amon...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 3538, 3726 ] }
19,593
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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. * * Amon...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 3970, 4183 ] }
19,594
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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. * * Amon...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 4587, 4830 ] }
19,595
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
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. * * Amon...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 5100, 5437 ] }
19,596
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 622, 718 ] }
19,597
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 1324, 1493 ] }
19,598
Einstein
Einstein.sol
0x35e921ab360e1500516b065f6802943122b9b8bc
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the ...
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://86fef7a34ca1ce6193266c91f8c259551c3d8cdb159e828587f0532538f2117a
{ "func_code_index": [ 1656, 1925 ] }
19,599