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
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override 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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 2468, 2689 ] }
2,500
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public virtual override view returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 2747, 2953 ] }
2,501
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 3095, 3310 ] }
2,502
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 3779, 4238 ] }
2,503
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual 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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 4642, 4947 ] }
2,504
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].sub( subtractedValue, "ERC20: decreased allowance below zero" ) ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 5445, 5850 ] }
2,505
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); ...
/** * @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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 6335, 6950 ] }
2,506
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfe...
/** @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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 7226, 7609 ] }
2,507
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub( amount, "ERC20: burn amount exceeds balance" )...
/** * @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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 7936, 8396 ] }
2,508
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve( address owner, address spender, uint256 amount ) internal virtual { 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(own...
/** * @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.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 8831, 9216 ] }
2,509
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_setupDecimals
function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; }
/** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 9543, 9638 ] }
2,510
LockToken
@openzeppelin/contracts/token/ERC20/ERC20.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _sy...
/** * @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 {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {}
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 10236, 10366 ] }
2,511
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 248, 428 ] }
2,512
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 695, 833 ] }
2,513
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1120, 1311 ] }
2,514
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1554, 2017 ] }
2,515
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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 revert (co...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 2475, 2609 ] }
2,516
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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 invalid ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 3087, 3363 ] }
2,517
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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 (consuming all...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 3810, 3942 ] }
2,518
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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 language...
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 opcode to r...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 4409, 4576 ] }
2,519
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
WadRayMath
library WadRayMath { using SafeMath for uint256; uint256 internal constant WAD = 1e18; uint256 internal constant halfWAD = WAD / 2; uint256 internal constant RAY = 1e27; uint256 internal constant halfRAY = RAY / 2; uint256 internal constant WAD_RAY_RATIO = 1e9; function ray() internal pure returns (ui...
/****************** @title WadRayMath library @author Aave @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits) */
NatSpecMultiLine
rayPow
function rayPow(uint256 x, uint256 n) internal pure returns (uint256 z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rayMul(x, x); if (n % 2 != 0) { z = rayMul(z, x); } } }
/** * @dev calculates x^n, in ray. The code uses the ModExp precompile * @param x base * @param n exponent * @return z = x^n, in ray */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1540, 1774 ] }
2,520
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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); /** * @de...
/** * @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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 90, 149 ] }
2,521
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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); /** * @de...
/** * @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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 228, 300 ] }
2,522
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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); /** * @de...
/** * @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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 516, 597 ] }
2,523
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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); /** * @de...
/** * @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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 868, 955 ] }
2,524
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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); /** * @de...
/** * @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 * tra...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1604, 1682 ] }
2,525
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
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); /** * @de...
/** * @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.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1985, 2086 ] }
2,526
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IVaultsCore
interface IVaultsCore { event Opened(uint256 indexed vaultId, address indexed collateralType, address indexed owner); event Deposited(uint256 indexed vaultId, uint256 amount, address indexed sender); event Withdrawn(uint256 indexed vaultId, uint256 amount, address indexed sender); event Borrowed(uint256 indexed...
//
LineComment
availableIncome
function availableIncome() external view returns (uint256);
//Read only
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1385, 1446 ] }
2,527
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IVaultsCore
interface IVaultsCore { event Opened(uint256 indexed vaultId, address indexed collateralType, address indexed owner); event Deposited(uint256 indexed vaultId, uint256 amount, address indexed sender); event Withdrawn(uint256 indexed vaultId, uint256 amount, address indexed sender); event Borrowed(uint256 indexed...
//
LineComment
initializeRates
function initializeRates(address _collateralType) external;
//Refresh
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1628, 1689 ] }
2,528
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IVaultsCore
interface IVaultsCore { event Opened(uint256 indexed vaultId, address indexed collateralType, address indexed owner); event Deposited(uint256 indexed vaultId, uint256 amount, address indexed sender); event Withdrawn(uint256 indexed vaultId, uint256 amount, address indexed sender); event Borrowed(uint256 indexed...
//
LineComment
upgrade
function upgrade(address _newVaultsCore) external;
//upgrade
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1799, 1851 ] }
2,529
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IRatesManager
interface IRatesManager { function a() external view returns (IAddressProvider); //current annualized borrow rate function annualizedBorrowRate(uint256 _currentBorrowRate) external pure returns (uint256); //uses current cumulative rate to calculate totalDebt based on baseDebt at time T0 function calculateDe...
//
LineComment
annualizedBorrowRate
function annualizedBorrowRate(uint256 _currentBorrowRate) external pure returns (uint256);
//current annualized borrow rate
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 119, 211 ] }
2,530
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IRatesManager
interface IRatesManager { function a() external view returns (IAddressProvider); //current annualized borrow rate function annualizedBorrowRate(uint256 _currentBorrowRate) external pure returns (uint256); //uses current cumulative rate to calculate totalDebt based on baseDebt at time T0 function calculateDe...
//
LineComment
calculateDebt
function calculateDebt(uint256 _baseDebt, uint256 _cumulativeRate) external pure returns (uint256);
//uses current cumulative rate to calculate totalDebt based on baseDebt at time T0
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 298, 399 ] }
2,531
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IRatesManager
interface IRatesManager { function a() external view returns (IAddressProvider); //current annualized borrow rate function annualizedBorrowRate(uint256 _currentBorrowRate) external pure returns (uint256); //uses current cumulative rate to calculate totalDebt based on baseDebt at time T0 function calculateDe...
//
LineComment
calculateBaseDebt
function calculateBaseDebt(uint256 _debt, uint256 _cumulativeRate) external pure returns (uint256);
//uses current cumulative rate to calculate baseDebt at time T0
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 467, 568 ] }
2,532
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IRatesManager
interface IRatesManager { function a() external view returns (IAddressProvider); //current annualized borrow rate function annualizedBorrowRate(uint256 _currentBorrowRate) external pure returns (uint256); //uses current cumulative rate to calculate totalDebt based on baseDebt at time T0 function calculateDe...
//
LineComment
calculateCumulativeRate
function calculateCumulativeRate( uint256 _borrowRate, uint256 _cumulativeRate, uint256 _timeElapsed ) external view returns (uint256);
//calculate a new cumulative rate
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 606, 757 ] }
2,533
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IVaultsDataProvider
interface IVaultsDataProvider { struct Vault { // borrowedType support USDX / PAR address collateralType; address owner; uint256 collateralBalance; uint256 baseDebt; uint256 createdAt; } function a() external view returns (IAddressProvider); // Read function baseDebt(address _collate...
//
LineComment
baseDebt
function baseDebt(address _collateralType) external view returns (uint256);
// Read
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 284, 361 ] }
2,534
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
IVaultsDataProvider
interface IVaultsDataProvider { struct Vault { // borrowedType support USDX / PAR address collateralType; address owner; uint256 collateralBalance; uint256 baseDebt; uint256 createdAt; } function a() external view returns (IAddressProvider); // Read function baseDebt(address _collate...
//
LineComment
createVault
function createVault(address _collateralType, address _owner) external returns (uint256);
//Write
LineComment
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1172, 1263 ] }
2,535
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
FeeDistributor
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
//
LineComment
release
function release() public override nonReentrant { uint256 income = a.core().availableIncome(); require(income > 0, "income is 0"); require(payees.length > 0, "Payees not configured yet"); lastReleasedAt = now; // Mint USDX to all receivers for (uint256 i = 0; i < payees.length; i++) { address payee = p...
/** Public function to release the accumulated fee income to the payees. @dev anyone can call this. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 794, 1226 ] }
2,536
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
FeeDistributor
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
//
LineComment
getPayees
function getPayees() public override view returns (address[] memory) { return payees; }
/** Get current configured payees. @return array of current payees. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1311, 1406 ] }
2,537
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
FeeDistributor
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
//
LineComment
_release
function _release(uint256 _totalIncomeReceived, address _payee) internal { uint256 payment = _totalIncomeReceived.mul(shares[_payee]).div(totalShares); a.stablex().mint(_payee, payment); }
/** Internal function to release a percentage of income to a specific payee @dev uses totalShares to calculate correct share @param _totalIncomeReceived Total income for all payees, will be split according to shares @param _payee The address of the payee to whom to distribute the fees. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 1718, 1918 ] }
2,538
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
FeeDistributor
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
//
LineComment
_addPayee
function _addPayee(address _payee, uint256 _shares) internal { require(_payee != address(0), "payee is the zero address"); require(_shares > 0, "shares are 0"); require(shares[_payee] == 0, "payee already has shares"); payees.push(_payee); shares[_payee] = _shares; totalShares = totalShares.add(_shares); ...
/** Internal function to add a new payee. @dev will update totalShares and therefore reduce the relative share of all other payees. @param _payee The address of the payee to add. @param _shares The number of shares owned by the payee. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 2178, 2552 ] }
2,539
FeeDistributor
FeeDistributor.sol
0x2a9fdc00d2ea8514f85845c8681fbc629c99b7db
Solidity
FeeDistributor
contract FeeDistributor is IFeeDistributor, ReentrancyGuard { using SafeMath for uint256; event PayeeAdded(address account, uint256 shares); event FeeReleased(uint256 income, uint256 releasedAt); uint256 public override lastReleasedAt; IAddressProvider public override a; uint256 public override total...
//
LineComment
changePayees
function changePayees(address[] memory _payees, uint256[] memory _shares) public override onlyManager { require(_payees.length == _shares.length, "Payees and shares mismatched"); require(_payees.length > 0, "No payees"); uint256 income = a.core().availableIncome(); if (income > 0 && payees.length > 0) { re...
/** Updates the payee configuration to a new one. @dev will release existing fees before the update. @param _payees Array of payees @param _shares Array of shares for each payee */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
{ "func_code_index": [ 2755, 3333 ] }
2,540
LockToken
contracts/LockToken.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
LockToken
contract LockToken is ERC20("LockToken", "LOCK"), Ownable { constructor() public { // pre-allocation 2.7M _mint(msg.sender, 2700000000000000000000000); } /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster). function mint(address _to, uint256...
// LockToken with Governance.
LineComment
mint
function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); }
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster).
NatSpecSingleLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 282, 449 ] }
2,541
LockToken
contracts/LockToken.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
LockToken
contract LockToken is ERC20("LockToken", "LOCK"), Ownable { constructor() public { // pre-allocation 2.7M _mint(msg.sender, 2700000000000000000000000); } /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster). function mint(address _to, uint256...
// LockToken with Governance.
LineComment
delegates
function delegates(address delegator) external view returns (address) { return _delegates[delegator]; }
/** * @notice Get delegatee * @param delegator The address to get delegatee for */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 2510, 2632 ] }
2,542
LockToken
contracts/LockToken.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
LockToken
contract LockToken is ERC20("LockToken", "LOCK"), Ownable { constructor() public { // pre-allocation 2.7M _mint(msg.sender, 2700000000000000000000000); } /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster). function mint(address _to, uint256...
// LockToken with Governance.
LineComment
delegate
function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); }
/** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 2775, 2884 ] }
2,543
LockToken
contracts/LockToken.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
LockToken
contract LockToken is ERC20("LockToken", "LOCK"), Ownable { constructor() public { // pre-allocation 2.7M _mint(msg.sender, 2700000000000000000000000); } /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster). function mint(address _to, uint256...
// LockToken with Governance.
LineComment
delegateBySig
function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())), getChainId(), ...
/** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECD...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 3313, 4413 ] }
2,544
LockToken
contracts/LockToken.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
LockToken
contract LockToken is ERC20("LockToken", "LOCK"), Ownable { constructor() public { // pre-allocation 2.7M _mint(msg.sender, 2700000000000000000000000); } /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster). function mint(address _to, uint256...
// LockToken with Governance.
LineComment
getCurrentVotes
function getCurrentVotes(address account) external view returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; }
/** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 4609, 4850 ] }
2,545
LockToken
contracts/LockToken.sol
0xb7bb4b08995b96bb5e577c5b02a237a6c625c172
Solidity
LockToken
contract LockToken is ERC20("LockToken", "LOCK"), Ownable { constructor() public { // pre-allocation 2.7M _mint(msg.sender, 2700000000000000000000000); } /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (KeyMaster). function mint(address _to, uint256...
// LockToken with Governance.
LineComment
getPriorVotes
function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256) { require( blockNumber < block.number, "LOCK::getPriorVotes: not yet determined" ); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return...
/** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://306999eeb4c1d068aa04064db551e6e3b3ceff5ee40a729cee3075c5ff012b1d
{ "func_code_index": [ 5276, 6574 ] }
2,546
TiqpitToken
zeppelin-solidity/contracts/examples/SimpleToken.sol
0x808a461b5ff65b78e93344785a71d72ccfc68629
Solidity
SimpleToken
contract SimpleToken is StandardToken { string public constant name = "SimpleToken"; // solium-disable-line uppercase string public constant symbol = "SIM"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 100...
/** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */
NatSpecMultiLine
SimpleToken
function SimpleToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); }
/** * @dev Constructor that gives msg.sender all of existing tokens. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://439cec8479376c73eb4bd30123b7834424bc11f619c4157af43d712f90c67df8
{ "func_code_index": [ 438, 605 ] }
2,547
Peanut
contracts/libraries/PriceMath.sol
0xe4fd5aee958d0cafc09c4f5e0d86cf6c8773ff5f
Solidity
PriceMath
library PriceMath { function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } /// @notice Calculates the sqrt ratio for given price /// @param token0 The address of token0 /// @param token1 The addr...
/// @title Math library for computing sqrt prices from price and vice versa. /// @notice Computes sqrt price for price.
NatSpecSingleLine
getSqrtRatioAtPrice
function getSqrtRatioAtPrice( address token0, address token1, uint256 price ) internal pure returns (uint160 sqrtPriceX96) { uint256 base = 1e18; if (token0 > token1) { (token0, token1) = (token1, token0); (base, price) = (price, base); } uint256 priceX96 = (price << 192) / base; sqrtPriceX96 = ...
/// @notice Calculates the sqrt ratio for given price /// @param token0 The address of token0 /// @param token1 The address of token1 /// @param price The amount with decimals of token1 for 1 token0 /// @return sqrtPriceX96 The greatest tick for which the ratio is less than or equal to the input ratio
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 507, 879 ] }
2,548
Peanut
contracts/libraries/PriceMath.sol
0xe4fd5aee958d0cafc09c4f5e0d86cf6c8773ff5f
Solidity
PriceMath
library PriceMath { function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } /// @notice Calculates the sqrt ratio for given price /// @param token0 The address of token0 /// @param token1 The addr...
/// @title Math library for computing sqrt prices from price and vice versa. /// @notice Computes sqrt price for price.
NatSpecSingleLine
getPriceAtSqrtRatio
function getPriceAtSqrtRatio( address token0, address token1, uint160 sqrtPriceX96 ) internal pure returns (uint256 price) { // second inequality must be < because the price can never reach the price at the max tick require(sqrtPriceX96 >= TickMath.MIN_SQRT_RATIO && sqrtPriceX96 < TickMath.MAX_SQRT_RATIO, 'R'...
/// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param token0 The address of token0 /// @param token1 The address of token1 /// @param sqrtPriceX96 ...
NatSpecSingleLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1339, 1924 ] }
2,549
TiqpitToken
contracts/Whitelistable.sol
0x808a461b5ff65b78e93344785a71d72ccfc68629
Solidity
Whitelistable
contract Whitelistable { Whitelist public whitelist; modifier whenWhitelisted(address _wallet) { require(whitelist.isWhitelisted(_wallet)); _; } /** * @dev Constructor for Whitelistable contract. */ function Whitelistable() public { whitelist = new White...
Whitelistable
function Whitelistable() public { whitelist = new Whitelist(); }
/** * @dev Constructor for Whitelistable contract. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://439cec8479376c73eb4bd30123b7834424bc11f619c4157af43d712f90c67df8
{ "func_code_index": [ 252, 335 ] }
2,550
TiqpitToken
contracts/Whitelist.sol
0x808a461b5ff65b78e93344785a71d72ccfc68629
Solidity
Whitelist
contract Whitelist is Ownable { mapping(address => bool) whitelist; uint256 public whitelistLength = 0; address public backendAddress; /** * @dev Add wallet to whitelist. * @dev Accept request from the owner only. * @param _wallet The address of wallet to add. */ fun...
/** * @title Whitelist contract * @dev Whitelist for wallets. */
NatSpecMultiLine
addWallet
function addWallet(address _wallet) public onlyPrivilegedAddresses { require(_wallet != address(0)); require(!isWhitelisted(_wallet)); whitelist[_wallet] = true; whitelistLength++; }
/** * @dev Add wallet to whitelist. * @dev Accept request from the owner only. * @param _wallet The address of wallet to add. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://439cec8479376c73eb4bd30123b7834424bc11f619c4157af43d712f90c67df8
{ "func_code_index": [ 313, 541 ] }
2,551
TiqpitToken
contracts/Whitelist.sol
0x808a461b5ff65b78e93344785a71d72ccfc68629
Solidity
Whitelist
contract Whitelist is Ownable { mapping(address => bool) whitelist; uint256 public whitelistLength = 0; address public backendAddress; /** * @dev Add wallet to whitelist. * @dev Accept request from the owner only. * @param _wallet The address of wallet to add. */ fun...
/** * @title Whitelist contract * @dev Whitelist for wallets. */
NatSpecMultiLine
removeWallet
function removeWallet(address _wallet) public onlyOwner { require(_wallet != address(0)); require(isWhitelisted(_wallet)); whitelist[_wallet] = false; whitelistLength--; }
/** * @dev Remove wallet from whitelist. * @dev Accept request from the owner only. * @param _wallet The address of whitelisted wallet to remove. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://439cec8479376c73eb4bd30123b7834424bc11f619c4157af43d712f90c67df8
{ "func_code_index": [ 720, 937 ] }
2,552
TiqpitToken
contracts/Whitelist.sol
0x808a461b5ff65b78e93344785a71d72ccfc68629
Solidity
Whitelist
contract Whitelist is Ownable { mapping(address => bool) whitelist; uint256 public whitelistLength = 0; address public backendAddress; /** * @dev Add wallet to whitelist. * @dev Accept request from the owner only. * @param _wallet The address of wallet to add. */ fun...
/** * @title Whitelist contract * @dev Whitelist for wallets. */
NatSpecMultiLine
isWhitelisted
function isWhitelisted(address _wallet) constant public returns (bool) { return whitelist[_wallet]; }
/** * @dev Check the specified wallet whether it is in the whitelist. * @param _wallet The address of wallet to check. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://439cec8479376c73eb4bd30123b7834424bc11f619c4157af43d712f90c67df8
{ "func_code_index": [ 1083, 1203 ] }
2,553
TiqpitToken
contracts/Whitelist.sol
0x808a461b5ff65b78e93344785a71d72ccfc68629
Solidity
Whitelist
contract Whitelist is Ownable { mapping(address => bool) whitelist; uint256 public whitelistLength = 0; address public backendAddress; /** * @dev Add wallet to whitelist. * @dev Accept request from the owner only. * @param _wallet The address of wallet to add. */ fun...
/** * @title Whitelist contract * @dev Whitelist for wallets. */
NatSpecMultiLine
setBackendAddress
function setBackendAddress(address _backendAddress) public onlyOwner { require(_backendAddress != address(0)); backendAddress = _backendAddress; }
/** * @dev Sets the backend address for automated operations. * @param _backendAddress The backend address to allow. */
NatSpecMultiLine
v0.4.19+commit.c4cbbb05
bzzr://439cec8479376c73eb4bd30123b7834424bc11f619c4157af43d712f90c67df8
{ "func_code_index": [ 1346, 1520 ] }
2,554
_goatgauds
contracts/Blimpie/Delegated.sol
0x5cebe5cde01ab154fb46b7984d6354da367bcbaf
Solidity
Delegated
contract Delegated is Ownable{ mapping(address => bool) internal _delegates; constructor(){ _delegates[owner()] = true; } modifier onlyDelegates { require(_delegates[msg.sender], "Invalid delegate" ); _; } //onlyOwner function isDelegate( address addr ) external view onlyOwner ...
/*********************** * @author: squeebo_nft * ************************/
NatSpecMultiLine
isDelegate
function isDelegate( address addr ) external view onlyOwner returns ( bool ){ return _delegates[addr]; }
//onlyOwner
LineComment
v0.8.7+commit.e28d00a7
MIT
ipfs://efc6e995f9113dd9e7553b8bfdbd720d3ba65ba918ce8660b957b3e9434d2079
{ "func_code_index": [ 258, 373 ] }
2,555
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); T...
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 268, 659 ] }
2,556
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) pub...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 865, 981 ] }
2,557
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 401, 853 ] }
2,558
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * ...
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 1485, 1675 ] }
2,559
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 1999, 2144 ] }
2,560
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
increaseApproval
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 2389, 2662 ] }
2,561
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; }...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
Ownable
function Ownable() public { owner = msg.sender; }
/** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 261, 321 ] }
2,562
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; }...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 644, 820 ] }
2,563
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; address public saleAgent; modifier notLocked() { require(msg.sender == owner || msg.sender == saleAgent || mintingFinished); ...
finishMinting
function finishMinting() public returns (bool) { require((msg.sender == saleAgent || msg.sender == owner) && !mintingFinished); mintingFinished = true; MintFinished(); return true; }
/** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 879, 1087 ] }
2,564
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
pause
function pause() onlyOwner whenNotPaused public { paused = true; Pause(); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 513, 604 ] }
2,565
Configurator
Configurator.sol
0xb98091aca11039eecc087e0b4687b7294d66c68d
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
unpause
function unpause() onlyOwner whenPaused public { paused = false; Unpause(); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://21f916f3831a80829dce4073935d401d7bf7070ea70ccd3b48c2f1ad1e06a0ce
{ "func_code_index": [ 688, 781 ] }
2,566
PAaveIntegration
contracts/peripheral/Aave/IAave.sol
0x4094aec22f40f11c29941d144c3dc887b33f5504
Solidity
ILendingPoolAddressesProviderV2
interface ILendingPoolAddressesProviderV2 { /** * @notice Get the current address for Aave LendingPool * @dev Lending pool is the core contract on which to call deposit */ function getLendingPool() external view returns (address); }
/** * @dev Interface for Aaves Lending Pool * Documentation: https://developers.aave.com/#lendingpooladdressesprovider */
NatSpecMultiLine
getLendingPool
function getLendingPool() external view returns (address);
/** * @notice Get the current address for Aave LendingPool * @dev Lending pool is the core contract on which to call deposit */
NatSpecMultiLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 191, 253 ] }
2,567
PAaveIntegration
contracts/peripheral/Aave/IAave.sol
0x4094aec22f40f11c29941d144c3dc887b33f5504
Solidity
IAaveATokenV2
interface IAaveATokenV2 { /** * @notice returns the current total aToken balance of _user all interest collected included. * To obtain the user asset principal balance with interests excluded , ERC20 non-standard * method principalBalanceOf() can be used. */ function balanceOf(address _user)...
/** * @dev Interface for Aaves A Token * Documentation: https://developers.aave.com/#atokens */
NatSpecMultiLine
balanceOf
function balanceOf(address _user) external view returns (uint256);
/** * @notice returns the current total aToken balance of _user all interest collected included. * To obtain the user asset principal balance with interests excluded , ERC20 non-standard * method principalBalanceOf() can be used. */
NatSpecMultiLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 283, 353 ] }
2,568
PAaveIntegration
contracts/peripheral/Aave/IAave.sol
0x4094aec22f40f11c29941d144c3dc887b33f5504
Solidity
IAaveLendingPoolV2
interface IAaveLendingPoolV2 { /** * @dev deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (aTokens) * is minted. * @param reserve the address of the reserve * @param amount the amount to be deposited * @param referralCode integrators are assigne...
deposit
function deposit( address reserve, uint256 amount, address onBehalfOf, uint16 referralCode ) external;
/** * @dev deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (aTokens) * is minted. * @param reserve the address of the reserve * @param amount the amount to be deposited * @param referralCode integrators are assigned a referral code and can potentially receive rewards. ...
NatSpecMultiLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 384, 526 ] }
2,569
PAaveIntegration
contracts/peripheral/Aave/IAave.sol
0x4094aec22f40f11c29941d144c3dc887b33f5504
Solidity
IAaveLendingPoolV2
interface IAaveLendingPoolV2 { /** * @dev deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (aTokens) * is minted. * @param reserve the address of the reserve * @param amount the amount to be deposited * @param referralCode integrators are assigne...
withdraw
function withdraw( address reserve, uint256 amount, address to ) external;
/** * @dev withdraws the assets of user. * @param reserve the address of the reserve * @param amount the underlying amount to be redeemed * @param to address that will receive the underlying **/
NatSpecMultiLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 752, 858 ] }
2,570
PAaveIntegration
contracts/polygon/PAaveIntegration.sol
0x4094aec22f40f11c29941d144c3dc887b33f5504
Solidity
PAaveIntegration
contract PAaveIntegration is AaveV2Integration { event RewardsClaimed(address[] assets, uint256 amount); IAaveIncentivesController public immutable rewardController; /** * @param _nexus Address of the Nexus * @param _lp Address of LP * @param _platformAddress Gener...
/** * @title PAaveIntegration * @author mStable * @notice A simple connection to deposit and withdraw bAssets from Aave on Polygon * @dev VERSION: 1.0 * DATE: 2020-16-11 */
NatSpecMultiLine
claimRewards
function claimRewards() external { uint256 len = bAssetsMapped.length; address[] memory pTokens = new address[](len); for (uint256 i = 0; i < len; i++) { pTokens[i] = bAssetToPToken[bAssetsMapped[i]]; } uint256 rewards = rewardController.claimRewards(pTokens, type(uint256).max, address(this)...
/** * @dev Claims outstanding rewards from market */
NatSpecMultiLine
v0.8.6+commit.11564f7e
{ "func_code_index": [ 917, 1321 ] }
2,571
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */
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-solidity/pull/522 if (a == 0) { return 0; ...
/** * @dev Multiplies two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 106, 544 ] }
2,572
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 674, 982 ] }
2,573
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1115, 1270 ] }
2,574
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two unsigned integers, reverts on overflow. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1353, 1508 ] }
2,575
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ 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. ...
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1664, 1793 ] }
2,576
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
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...
_msgSender
function _msgSender() internal view returns (address payable) { return msg.sender; }
// solhint-disable-previous-line no-empty-blocks
LineComment
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 265, 368 ] }
2,577
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev Total number of tokens in existence. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 361, 457 ] }
2,578
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
balanceOf
function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; }
/** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 671, 782 ] }
2,579
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
freezeOf
function freezeOf(address owner) public view returns (uint256) { return _freezeOf[owner]; }
/** * @dev Gets the balance of the specified freeze address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the freeze address. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1007, 1117 ] }
2,580
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1451, 1587 ] }
2,581
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
transfer
function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; }
/** * @dev Transfer token to a specified address. * @param to The address to transfer to. * @param value The amount to be transferred. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1757, 1902 ] }
2,582
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
approve
function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 2544, 2697 ] }
2,583
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
transferFrom
function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; }
/** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 3165, 3398 ] }
2,584
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; }
/** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 3919, 4127 ] }
2,585
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; }
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits...
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 4653, 4871 ] }
2,586
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_transfer
function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); }
/** * @dev Transfer token for a specified addresses. * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 5094, 5361 ] }
2,587
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_mint
function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); }
/** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 5708, 5980 ] }
2,588
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_burn
function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); }
/** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 6209, 6491 ] }
2,589
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; mapping (address => uint256) private _freezeOf; uint256 private _totalSupply; /** * @dev Total ...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approva...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); }
/** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 7430, 7689 ] }
2,590
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @retu...
/** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @return the name of the token. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 356, 444 ] }
2,591
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @retu...
/** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @return the symbol of the token. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 506, 598 ] }
2,592
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
ERC20Detailed
contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @retu...
/** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @return the number of decimals of the token. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 672, 760 ] }
2,593
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
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)); role.bearer[account] = true; } /** ...
/** * @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)); role.bearer[account] = true; }
/** * @dev Give an account access to this role. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 156, 306 ] }
2,594
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
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)); role.bearer[account] = true; } /** ...
/** * @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)); role.bearer[account] = false; }
/** * @dev Remove an account's access to this role. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 381, 534 ] }
2,595
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
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)); role.bearer[account] = true; } /** ...
/** * @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)); return role.bearer[account]; }
/** * @dev Check if an account has this role. * @return bool */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 624, 794 ] }
2,596
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 497, 581 ] }
2,597
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
isOwner
function isOwner() public view returns (bool) { return _msgSender() == _owner; }
/** * @dev Returns true if the caller is the current owner. */
NatSpecMultiLine
v0.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 863, 962 ] }
2,598
HooToken
HooToken.sol
0xaa52c04c7b18c2ebdba34627bde40c0bf241065c
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
renounceOwnership
function renounceOwnership() public 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.5.17+commit.d19bba13
None
bzzr://5557e44db2bc84bd03fea4f1d2b0b06530c4cdb00ab9534e3b33839b7d78bfff
{ "func_code_index": [ 1308, 1453 ] }
2,599