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
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
ERC721
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */
NatSpecMultiLine
_burn
function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), toke...
/** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 9458, 9823 ] }
15,100
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
ERC721
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */
NatSpecMultiLine
_transfer
function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); //...
/** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 10155, 10738 ] }
15,101
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
ERC721
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */
NatSpecMultiLine
_approve
function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); }
/** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 10851, 11030 ] }
15,102
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
ERC721
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */
NatSpecMultiLine
_checkOnERC721Received
function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721...
/** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param to...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 11590, 12398 ] }
15,103
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
ERC721
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
/** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {}
/** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 12965, 13096 ] }
15,104
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
tryAdd
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } }
/** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 161, 388 ] }
15,105
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
trySub
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } }
/** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 536, 735 ] }
15,106
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
tryMul
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // 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 ...
/** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 885, 1393 ] }
15,107
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
tryDiv
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } }
/** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 1544, 1744 ] }
15,108
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
tryMod
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } }
/** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 1905, 2105 ] }
15,109
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 2347, 2450 ] }
15,110
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; }
/** * @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.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 2728, 2831 ] }
15,111
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; }
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 3085, 3188 ] }
15,112
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; }
/** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 3484, 3587 ] }
15,113
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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 (consu...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 4049, 4152 ] }
15,114
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
sub
function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterp...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 4626, 4871 ] }
15,115
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
div
function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } }
/** * @dev Returns the integer division of two unsigned integers, reverting 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 ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 5364, 5608 ] }
15,116
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) ...
/** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */
NatSpecMultiLine
mod
function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. ...
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 6266, 6510 ] }
15,117
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
Ownable
abstract 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() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 399, 491 ] }
15,118
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
Ownable
abstract 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() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { _setOwner(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.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 1050, 1149 ] }
15,119
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
Ownable
abstract 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() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 1299, 1496 ] }
15,120
LootBasicSkills
LootBasicSkills.sol
0xc7db217c94b6e74598067858ab96144e5dd0e5a1
Solidity
Base64
library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return...
/// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <brecht@loopring.org>
NatSpecSingleLine
encode
function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes me...
/// @notice Encodes some bytes to the base64 representation
NatSpecSingleLine
v0.8.7+commit.e28d00a7
MIT
ipfs://b9946195c36c3e14a4401cd0818897cad72b60598b2020af0336d1bc4c38092e
{ "func_code_index": [ 186, 1562 ] }
15,121
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://git...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c ...
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 89, 483 ] }
15,122
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://git...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 567, 858 ] }
15,123
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://git...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; }
/** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 972, 1094 ] }
15,124
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://git...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 1158, 1293 ] }
15,125
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return totalSupply_; }
/** * @dev Total number of tokens in existence */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 217, 305 ] }
15,126
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; }
/** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 463, 795 ] }
15,127
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 1001, 1105 ] }
15,128
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
BurnableToken
contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _w...
/** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */
NatSpecMultiLine
burn
function burn(uint256 _value) public { _burn(msg.sender, _value); }
/** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 212, 290 ] }
15,129
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_v...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 401, 893 ] }
15,130
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race...
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 1519, 1714 ] }
15,131
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
allowance
function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 2038, 2203 ] }
15,132
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
increaseApproval
function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender T...
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 2663, 2973 ] }
15,133
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transf...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
decreaseApproval
function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue...
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender T...
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 3438, 3888 ] }
15,134
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); }
/** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 813, 930 ] }
15,135
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
transferOwnership
function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 1095, 1203 ] }
15,136
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
Ownable
contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * a...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */
NatSpecMultiLine
_transferOwnership
function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 1341, 1519 ] }
15,137
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
Claimable
contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner ad...
/** * @title Claimable * @dev Extension for the Ownable contract, where the ownership needs to be claimed. * This allows the new owner to accept the transfer. */
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { pendingOwner = newOwner; }
/** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 395, 496 ] }
15,138
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
Claimable
contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner ad...
/** * @title Claimable * @dev Extension for the Ownable contract, where the ownership needs to be claimed. * This allows the new owner to accept the transfer. */
NatSpecMultiLine
claimOwnership
function claimOwnership() public onlyPendingOwner { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); }
/** * @dev Allows the pendingOwner address to finalize the transfer. */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 582, 753 ] }
15,139
CBNX
CBNX.sol
0xaef6bd644d6aabc451e90079109db54569632d34
Solidity
CBNX
contract CBNX is StandardToken, Claimable, BurnableToken { using SafeMath for uint256; string public constant name = "CBNX"; string public constant symbol = "CBNX"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 500000000 * (10 ** uint256(decimals)); /*...
/** * @title CBNX * * Symbol : CBNX * Name : CBNX * Total supply: 500,000,000.000000000000000000 * Decimals : 18 * */
NatSpecMultiLine
transferAnyERC20Token
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Basic(tokenAddress).transfer(owner, tokens); }
/** * @dev Owner can transfer out any accidentally sent ERC20 tokens */
NatSpecMultiLine
v0.4.24+commit.e67f0147
bzzr://c0c90284d38849eedc54aee0a7eb25cefe88f141622e01b107bd38bf34e4de07
{ "func_code_index": [ 671, 856 ] }
15,140
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
grantTransferAdmin
function grantTransferAdmin(address addr) external validAddress(addr) onlyContractAdmin { _transferAdmins.add(addr); emit RoleChange(msg.sender, addr, "TransferAdmin", true); }
/// @dev Authorizes an address holder to write transfer restriction rules /// @param addr The address to grant transfer admin rights to
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 3662, 3854 ] }
15,141
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
revokeTransferAdmin
function revokeTransferAdmin(address addr) external validAddress(addr) onlyContractAdmin { _transferAdmins.remove(addr); emit RoleChange(msg.sender, addr, "TransferAdmin", false); }
/// @dev Revokes authorization to write transfer restriction rules /// @param addr The address to grant transfer admin rights to
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 3992, 4190 ] }
15,142
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
checkTransferAdmin
function checkTransferAdmin(address addr) external view returns(bool hasPermission) { return _transferAdmins.has(addr); }
/// @dev Checks if an address is an authorized transfer admin. /// @param addr The address to check for transfer admin privileges. /// @return hasPermission returns true if the address has transfer admin permission and false if not.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 4435, 4567 ] }
15,143
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
grantContractAdmin
function grantContractAdmin(address addr) external validAddress(addr) onlyContractAdmin { _contractAdmins.add(addr); contractAdminCount = contractAdminCount.add(1); emit RoleChange(msg.sender, addr, "ContractAdmin", true); }
/// @dev Authorizes an address holder to be a contract admin. Contract admins grant privileges to accounts. /// Contract admins can mint/burn tokens and freeze accounts. /// @param addr The address to grant transfer admin rights to.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 4812, 5057 ] }
15,144
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
revokeContractAdmin
function revokeContractAdmin(address addr) external validAddress(addr) onlyContractAdmin { require(contractAdminCount > 1, "Must have at least one contract admin"); _contractAdmins.remove(addr); contractAdminCount = contractAdminCount.sub(1); emit RoleChange(msg.sender, addr, "ContractAdmin", false); }
/// @dev Revokes authorization as a contract admin. /// The contract requires there is at least 1 Contract Admin to avoid locking the Contract Admin functionality. /// @param addr The address to remove contract admin rights from
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 5298, 5627 ] }
15,145
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
checkContractAdmin
function checkContractAdmin(address addr) external view returns(bool hasPermission) { return _contractAdmins.has(addr); }
/// @dev Checks if an address is an authorized contract admin. /// @param addr The address to check for contract admin privileges. /// @return hasPermission returns true if the address has contract admin permission and false if not.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 5872, 6004 ] }
15,146
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
enforceTransferRestrictions
function enforceTransferRestrictions(address from, address to, uint256 value) private view { uint8 restrictionCode = detectTransferRestriction(from, to, value); require(transferRules.checkSuccess(restrictionCode), messageForTransferRestriction(restrictionCode)); }
/// @dev Enforces transfer restrictions managed using the ERC-1404 standard functions. /// The TransferRules contract defines what the rules are. The data inputs to those rules remains in the RestrictedToken contract. /// TransferRules is a separate contract so its logic can be upgraded. /// @param from The address the...
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 6493, 6773 ] }
15,147
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
detectTransferRestriction
function detectTransferRestriction(address from, address to, uint256 value) public view returns(uint8) { return transferRules.detectTransferRestriction(address(this), from, to, value); }
/// @dev Calls the TransferRules detectTransferRetriction function to determine if tokens can be transferred. /// detectTransferRestriction returns a status code. /// @param from The address the tokens are transferred from /// @param to The address the tokens would be transferred to /// @param value The quantity of tok...
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 7133, 7330 ] }
15,148
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
messageForTransferRestriction
function messageForTransferRestriction(uint8 restrictionCode) public view returns(string memory) { return transferRules.messageForTransferRestriction(restrictionCode); }
/// @dev Calls TransferRules to lookup a human readable error message that goes with an error code. /// @param restrictionCode is an error code to lookup an error code for
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 7511, 7691 ] }
15,149
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
setMaxBalance
function setMaxBalance(address addr, uint256 updatedValue) public validAddress(addr) onlyTransferAdmin { _maxBalances[addr] = updatedValue; emit AddressMaxBalance(msg.sender, addr, updatedValue); }
/// @dev Sets the maximum number of tokens an address will be allowed to hold. /// Addresses can hold 0 tokens by default. /// @param addr The address to restrict /// @param updatedValue the maximum number of tokens the address can hold
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 7943, 8156 ] }
15,150
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
getMaxBalance
function getMaxBalance(address addr) external view returns(uint256) { return _maxBalances[addr]; }
/// @dev Gets the maximum number of tokens an address is allowed to hold /// @param addr The address to check restrictions for
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 8292, 8401 ] }
15,151
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
setLockUntil
function setLockUntil(address addr, uint256 timestamp) public validAddress(addr) onlyTransferAdmin { _lockUntil[addr] = timestamp; emit AddressTimeLock(msg.sender, addr, timestamp); }
/// @dev Lock tokens in the address from being transfered until the specified time /// @param addr The address to restrict /// @param timestamp The time the tokens will be locked until as a Unix timetsamp. /// Unix timestamp is the number of seconds since the Unix epoch of 00:00:00 UTC on 1 January 1970.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 8722, 8922 ] }
15,152
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
removeLockUntil
function removeLockUntil(address addr) external validAddress(addr) onlyTransferAdmin { _lockUntil[addr] = 0; emit AddressTimeLock(msg.sender, addr, 0); }
/// @dev A convenience method to remove an addresses timelock. It sets the lock date to 0 which corresponds to the /// earliest possible timestamp in the past 00:00:00 UTC on 1 January 1970. /// @param addr The address to remove the timelock for.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 9179, 9348 ] }
15,153
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
getLockUntil
function getLockUntil(address addr) external view returns(uint256 timestamp) { return _lockUntil[addr]; }
/// @dev Check when the address will be locked for transfers until /// @param addr The address to check /// @return timestamp The time the address will be locked until. /// The format is the number of seconds since the Unix epoch of 00:00:00 UTC on 1 January 1970.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 9628, 9744 ] }
15,154
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
setTransferGroup
function setTransferGroup(address addr, uint256 groupID) public validAddress(addr) onlyTransferAdmin { _transferGroups[addr] = groupID; emit AddressTransferGroup(msg.sender, addr, groupID); }
/// @dev Set the one group that the address belongs to, such as a US Reg CF investor group. /// @param addr The address to set the group for. /// @param groupID The uint256 numeric ID of the group.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 9954, 10161 ] }
15,155
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
getTransferGroup
function getTransferGroup(address addr) external view returns(uint256 groupID) { return _transferGroups[addr]; }
/// @dev Gets the transfer group the address belongs to. The default group is 0. /// @param addr The address to check. /// @return groupID The group id of the address.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 10341, 10464 ] }
15,156
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
freeze
function freeze(address addr, bool status) public validAddress(addr) onlyTransferAdminOrContractAdmin { _frozenAddresses[addr] = status; emit AddressFrozen(msg.sender, addr, status); }
/// @dev Freezes or unfreezes an address. /// Tokens in a frozen address cannot be transferred from until the address is unfrozen. /// @param addr The address to be frozen. /// @param status The frozenAddress status of the address. True means frozen false means not frozen.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 10753, 10954 ] }
15,157
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
getFrozenStatus
function getFrozenStatus(address addr) external view returns(bool status) { return _frozenAddresses[addr]; }
/// @dev Checks the status of an address to see if its frozen /// @param addr The address to check /// @return status Returns true if the address is frozen and false if its not frozen.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 11151, 11270 ] }
15,158
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
setAddressPermissions
function setAddressPermissions(address addr, uint256 groupID, uint256 timeLockUntil, uint256 maxBalance, bool status) public validAddress(addr) onlyTransferAdmin { setTransferGroup(addr, groupID); setLockUntil(addr, timeLockUntil); setMaxBalance(addr, maxBalance); freeze(addr, status); }
/// @dev A convenience method for updating the transfer group, lock until, max balance, and freeze status. /// The convenience method also helps to reduce gas costs. /// @param addr The address to set permissions for. /// @param groupID The ID of the address /// @param timeLockUntil The unix timestamp that the address ...
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 11940, 12259 ] }
15,159
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
setAllowGroupTransfer
function setAllowGroupTransfer(uint256 from, uint256 to, uint256 lockedUntil) external onlyTransferAdmin { _allowGroupTransfers[from][to] = lockedUntil; emit AllowGroupTransfer(msg.sender, from, to, lockedUntil); }
/// @dev Sets an allowed transfer from a group to another group beginning at a specific time. /// There is only one definitive rule per from and to group. /// @param from The group the transfer is coming from. /// @param to The group the transfer is going to. /// @param lockedUntil The unix timestamp that the transfer ...
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 12911, 13141 ] }
15,160
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
getAllowTransferTime
function getAllowTransferTime(address from, address to) external view returns(uint timestamp) { return _allowGroupTransfers[_transferGroups[from]][_transferGroups[to]]; }
/// @dev Checks to see when a transfer between two addresses would be allowed. /// @param from The address the transfer is coming from /// @param to The address the transfer is going to /// @return timestamp The Unix timestamp of the time the transfer would be allowed. A 0 means never. /// The format is the number of s...
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 13542, 13723 ] }
15,161
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
getAllowGroupTransferTime
function getAllowGroupTransferTime(uint from, uint to) external view returns(uint timestamp) { return _allowGroupTransfers[from][to]; }
/// @dev Checks to see when a transfer between two groups would be allowed. /// @param from The group id the transfer is coming from /// @param to The group id the transfer is going to /// @return timestamp The Unix timestamp of the time the transfer would be allowed. A 0 means never. /// The format is the number of se...
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 14123, 14269 ] }
15,162
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
burn
function burn(address from, uint256 value) external validAddress(from) onlyContractAdmin { require(value <= balanceOf(from), "Insufficent tokens to burn"); _burn(from, value); }
/// @dev Destroys tokens and removes them from the total supply. Can only be called by an address with a Contract Admin role. /// @param from The address to destroy the tokens from. /// @param value The number of tokens to destroy from the address.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 14530, 14723 ] }
15,163
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
mint
function mint(address to, uint256 value) external validAddress(to) onlyContractAdmin { require(SafeMath.add(totalSupply(), value) <= maxTotalSupply, "Cannot mint more than the max total supply"); _mint(to, value); }
/// @dev Allows the contract admin to create new tokens in a specified address. /// The total number of tokens cannot exceed the maxTotalSupply (the "Hard Cap"). /// @param to The addres to mint tokens into. /// @param value The number of tokens to mint.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 14993, 15225 ] }
15,164
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
pause
function pause() external onlyContractAdmin() { isPaused = true; emit Pause(msg.sender, true); }
/// @dev Allows the contract admin to pause transfers.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 15286, 15398 ] }
15,165
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
unpause
function unpause() external onlyContractAdmin() { isPaused = false; emit Pause(msg.sender, false); }
/// @dev Allows the contract admin to unpause transfers.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 15461, 15577 ] }
15,166
RestrictedToken
contracts/RestrictedToken.sol
0x2c3d7c64e2ada94d9ecb1ee2aef992d127ce43de
Solidity
RestrictedToken
contract RestrictedToken is ERC20 { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; ITransferRules public transferRules; using Roles for Roles.Role; Roles.Role private _contractAdmins; Roles.Role private _transferAdmins; uint256 public maxTot...
/// @title Restricted Token /// @author CoMakery, Inc. /// @notice An ERC-20 token with ERC-1404 transfer restrictions for managing security tokens, etc.
NatSpecSingleLine
upgradeTransferRules
function upgradeTransferRules(ITransferRules newTransferRules) external onlyContractAdmin { require(address(newTransferRules) != address(0x0), "Address cannot be 0x0"); address oldRules = address(transferRules); transferRules = newTransferRules; emit Upgrade(msg.sender, oldRules, address(newTransferRules));...
/// @dev Allows the contrac admin to upgrade the transfer rules. /// The upgraded transfer rules must implement the ITransferRules interface which conforms to the ERC-1404 token standard. /// @param newTransferRules The address of the deployed TransferRules contract.
NatSpecSingleLine
v0.5.12+commit.7709ece9
MIT
bzzr://ccfbc6e4dd4827747e21570ea618016582b01d4b9bb253a408ff0135733064a9
{ "func_code_index": [ 15857, 16193 ] }
15,167
PProxy
diamond-2/contracts/interfaces/IDiamondCut.sol
0x33e18a092a93ff21ad04746c7da12e35d34dc7c4
Solidity
IDiamondCut
interface IDiamondCut { enum FacetCutAction {Add, Replace, Remove} struct FacetCut { address facetAddress; FacetCutAction action; bytes4[] functionSelectors; } /// @notice Add/replace/remove any number of functions and optionally execute /// a function with delegate...
/******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) /******************************************************************************/
NatSpecMultiLine
diamondCut
function diamondCut( FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata ) external;
/// @notice Add/replace/remove any number of functions and optionally execute /// a function with delegatecall /// @param _diamondCut Contains the facet addresses and function selectors /// @param _init The address of the contract or facet to execute _calldata /// @param _calldata A function call, including fun...
NatSpecSingleLine
v0.7.1+commit.f4a555be
{ "func_code_index": [ 641, 778 ] }
15,168
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } /** * @dev Integer division of two numbers, t...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 105, 259 ] }
15,169
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } /** * @dev Integer division of two numbers, t...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 359, 478 ] }
15,170
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } /** * @dev Integer division of two numbers, t...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 610, 730 ] }
15,171
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } /** * @dev Integer division of two numbers, t...
/** * @title SafeMath * @dev Math operations with safety checks that throw on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 810, 962 ] }
15,172
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
owned
contract owned { address public owner; constructor () public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner...
/** * @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 { 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.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 369, 471 ] }
15,173
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
_transfer
function _transfer(address _from, address _to, uint256 _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); ...
/** * Internal transfer, only can be called by this contract */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 1261, 2274 ] }
15,174
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
transfer
function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); }
/** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 2485, 2597 ] }
15,175
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
/** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 2877, 3178 ] }
15,176
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
approve
function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
/** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 3447, 3623 ] }
15,177
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } }
/** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to s...
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 4022, 4374 ] }
15,178
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
freezeAccount
function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); }
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not
NatSpecSingleLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 4559, 4725 ] }
15,179
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
mintToken
function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(this, target, mintedAmount); }
/// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive
NatSpecSingleLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 4921, 5142 ] }
15,180
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
burn
function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender,...
/** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 5317, 5696 ] }
15,181
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
burnFrom
function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Sub...
/** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 5958, 6574 ] }
15,182
TST_ERC
TST_ERC.sol
0x3f7029371a9dc427ed65bff3e09576b4b2c52cb5
Solidity
TST_ERC
contract TST_ERC is owned { using SafeMath for uint; // Public variables of the token string public name = "TRIPSIA blockchain based payment"; string public symbol = "TST"; uint8 public decimals = 0; uint256 public totalSupply = 1 * 10 ** uint256(decimals); // This creates an a...
withdraw
function withdraw(uint withdrawAmount) onlyOwner public { if (withdrawAmount <= address(this).balance) { owner.transfer(withdrawAmount); } }
/** *@notice Withdraw for Ether */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://2a78a2d4b05600d3c98134901441cfdac6bf169e451fcaeb7e722b81cccfa65f
{ "func_code_index": [ 6629, 6825 ] }
15,183
SyntheticRebaseDollar
SyntheticRebaseDollar.sol
0xaa90d9cc2f41a150489da5fffba2060a2938ffdc
Solidity
SyntheticRebaseDollar
contract SyntheticRebaseDollar is ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; // Oracle used for price debt data (external to the AMM balance to avoid internal manipulation) Oracle public constant LINK = Oracle(0x271bf4568fb737cc2e6277e9B1EE...
_withdraw
function _withdraw(address token, uint amount) internal { uint _factor = factor(); // call once to minimize sub calls in getCredit and getUserCredit uint _credit = _getCredit(msg.sender, token, _factor); uint _token = balances[msg.sender][token]; if (_credit < amount) {...
// UNSAFE: No slippage protection, should not be called directly
LineComment
v0.5.17+commit.d19bba13
MIT
bzzr://0369fa52872370a8eda2d6eeb79e0d6ed1a5ee44da663eee82e4372335ac1549
{ "func_code_index": [ 3380, 4254 ] }
15,184
UniswapLPOracleFactory
@uniswap\v2-periphery\contracts\UniswapV2Router02.sol
0x4a224cd0517f08b26608a2f73bf390b01a6618c8
Solidity
UniswapV2Router02
contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMath for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); _; } con...
_addLiquidity
function _addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin ) internal virtual returns (uint amountA, uint amountB) { // create the pair if it doesn't exist yet if (IUniswapV2Factory(factory).getPair(tokenA, ...
// **** ADD LIQUIDITY ****
LineComment
v0.6.6+commit.6c089d02
MIT
ipfs://c8c23e261c3bef34a45970f956d2125743c356257188e13a0501ccc6555b8d4a
{ "func_code_index": [ 600, 1995 ] }
15,185
UniswapLPOracleFactory
@uniswap\v2-periphery\contracts\UniswapV2Router02.sol
0x4a224cd0517f08b26608a2f73bf390b01a6618c8
Solidity
UniswapV2Router02
contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMath for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); _; } con...
removeLiquidity
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountA, uint amountB) { address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB...
// **** REMOVE LIQUIDITY ****
LineComment
v0.6.6+commit.6c089d02
MIT
ipfs://c8c23e261c3bef34a45970f956d2125743c356257188e13a0501ccc6555b8d4a
{ "func_code_index": [ 3757, 4627 ] }
15,186
UniswapLPOracleFactory
@uniswap\v2-periphery\contracts\UniswapV2Router02.sol
0x4a224cd0517f08b26608a2f73bf390b01a6618c8
Solidity
UniswapV2Router02
contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMath for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); _; } con...
removeLiquidityETHSupportingFeeOnTransferTokens
function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) public virtual override ensure(deadline) returns (uint amountETH) { (, amountETH) = removeLiquidity( token, W...
// **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) ****
LineComment
v0.6.6+commit.6c089d02
MIT
ipfs://c8c23e261c3bef34a45970f956d2125743c356257188e13a0501ccc6555b8d4a
{ "func_code_index": [ 6738, 7443 ] }
15,187
UniswapLPOracleFactory
@uniswap\v2-periphery\contracts\UniswapV2Router02.sol
0x4a224cd0517f08b26608a2f73bf390b01a6618c8
Solidity
UniswapV2Router02
contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMath for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); _; } con...
_swap
function _swap(uint[] memory amounts, address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = UniswapV2Library.sortTokens(input, output); uint amountOut = amounts[i + 1];...
// **** SWAP **** // requires the initial amount to have already been sent to the first pair
LineComment
v0.6.6+commit.6c089d02
MIT
ipfs://c8c23e261c3bef34a45970f956d2125743c356257188e13a0501ccc6555b8d4a
{ "func_code_index": [ 8273, 9013 ] }
15,188
UniswapLPOracleFactory
@uniswap\v2-periphery\contracts\UniswapV2Router02.sol
0x4a224cd0517f08b26608a2f73bf390b01a6618c8
Solidity
UniswapV2Router02
contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMath for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); _; } con...
_swapSupportingFeeOnTransferTokens
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = UniswapV2Library.sortTokens(input, output); IUniswapV2Pair pair = IUni...
// **** SWAP (supporting fee-on-transfer tokens) **** // requires the initial amount to have already been sent to the first pair
LineComment
v0.6.6+commit.6c089d02
MIT
ipfs://c8c23e261c3bef34a45970f956d2125743c356257188e13a0501ccc6555b8d4a
{ "func_code_index": [ 13610, 14829 ] }
15,189
UniswapLPOracleFactory
@uniswap\v2-periphery\contracts\UniswapV2Router02.sol
0x4a224cd0517f08b26608a2f73bf390b01a6618c8
Solidity
UniswapV2Router02
contract UniswapV2Router02 is IUniswapV2Router02 { using SafeMath for uint; address public immutable override factory; address public immutable override WETH; modifier ensure(uint deadline) { require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED'); _; } con...
quote
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return UniswapV2Library.quote(amountA, reserveA, reserveB); }
// **** LIBRARY FUNCTIONS ****
LineComment
v0.6.6+commit.6c089d02
MIT
ipfs://c8c23e261c3bef34a45970f956d2125743c356257188e13a0501ccc6555b8d4a
{ "func_code_index": [ 17293, 17486 ] }
15,190
Governor
Governor.sol
0x690e775361ad66d1c4a25d89da9fcd639f5198ed
Solidity
Governor
contract Governor { /// @notice The name of this contract string public constant NAME = "Radicle Governor"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint256) { ...
quorumVotes
function quorumVotes() public pure returns (uint256) { return 4000000e18; } // 4,000,000 = 4% of Token
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
NatSpecSingleLine
v0.7.6+commit.7338295f
GNU GPLv3
ipfs://31a5041528f6ca588e61832ab4f77d6adcffcf2bf8772140a4fccea193c29f20
{ "func_code_index": [ 254, 375 ] }
15,191
Governor
Governor.sol
0x690e775361ad66d1c4a25d89da9fcd639f5198ed
Solidity
Governor
contract Governor { /// @notice The name of this contract string public constant NAME = "Radicle Governor"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint256) { ...
proposalThreshold
function proposalThreshold() public pure returns (uint256) { return 1000000e18; } // 1,000,000 = 1% of Token
/// @notice The number of votes required in order for a voter to become a proposer
NatSpecSingleLine
v0.7.6+commit.7338295f
GNU GPLv3
ipfs://31a5041528f6ca588e61832ab4f77d6adcffcf2bf8772140a4fccea193c29f20
{ "func_code_index": [ 466, 593 ] }
15,192
Governor
Governor.sol
0x690e775361ad66d1c4a25d89da9fcd639f5198ed
Solidity
Governor
contract Governor { /// @notice The name of this contract string public constant NAME = "Radicle Governor"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint256) { ...
proposalMaxOperations
function proposalMaxOperations() public pure returns (uint256) { return 10; } // 10 actions
/// @notice The maximum number of actions that can be included in a proposal
NatSpecSingleLine
v0.7.6+commit.7338295f
GNU GPLv3
ipfs://31a5041528f6ca588e61832ab4f77d6adcffcf2bf8772140a4fccea193c29f20
{ "func_code_index": [ 678, 788 ] }
15,193
Governor
Governor.sol
0x690e775361ad66d1c4a25d89da9fcd639f5198ed
Solidity
Governor
contract Governor { /// @notice The name of this contract string public constant NAME = "Radicle Governor"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint256) { ...
votingDelay
function votingDelay() public pure returns (uint256) { return 1; } // 1 block
/// @notice The delay before voting on a proposal may take place, once proposed
NatSpecSingleLine
v0.7.6+commit.7338295f
GNU GPLv3
ipfs://31a5041528f6ca588e61832ab4f77d6adcffcf2bf8772140a4fccea193c29f20
{ "func_code_index": [ 876, 972 ] }
15,194
Governor
Governor.sol
0x690e775361ad66d1c4a25d89da9fcd639f5198ed
Solidity
Governor
contract Governor { /// @notice The name of this contract string public constant NAME = "Radicle Governor"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint256) { ...
votingPeriod
function votingPeriod() public pure returns (uint256) { return 17280; } // ~3 days in blocks (assuming 15s blocks)
/// @notice The duration of voting on a proposal, in blocks
NatSpecSingleLine
v0.7.6+commit.7338295f
GNU GPLv3
ipfs://31a5041528f6ca588e61832ab4f77d6adcffcf2bf8772140a4fccea193c29f20
{ "func_code_index": [ 1040, 1173 ] }
15,195
Voxel
Voxel.sol
0x16cc8367055ae7e9157dbcb9d86fd6ce82522b31
Solidity
Context
contract Context { constructor() {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address) { return msg.sender; } }
_msgSender
function _msgSender() internal view returns (address) { return msg.sender; }
// solhint-disable-previous-line no-empty-blocks
LineComment
v0.8.10+commit.fc410830
MIT
ipfs://495f2871dce757f660cc496507e38482332e386d13470aae28f5584b6afdecab
{ "func_code_index": [ 100, 195 ] }
15,196
Voxel
Voxel.sol
0x16cc8367055ae7e9157dbcb9d86fd6ce82522b31
Solidity
Ownable
abstract 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() { addr...
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.10+commit.fc410830
MIT
ipfs://495f2871dce757f660cc496507e38482332e386d13470aae28f5584b6afdecab
{ "func_code_index": [ 521, 605 ] }
15,197
LigoToken
LigoToken.sol
0xe04bfe83a49a9a242635c0759df99ea44b0feb06
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
TokenERC20
function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens nam...
/** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://49add7c80496363f9f7bb18fa1ab10561d5e1f715715e2ffaadb4e34a159c24d
{ "func_code_index": [ 840, 1385 ] }
15,198
LigoToken
LigoToken.sol
0xe04bfe83a49a9a242635c0759df99ea44b0feb06
Solidity
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
_transfer
function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to])...
/** * Internal transfer, only can be called by this contract */
NatSpecMultiLine
v0.4.23+commit.124ca40d
bzzr://49add7c80496363f9f7bb18fa1ab10561d5e1f715715e2ffaadb4e34a159c24d
{ "func_code_index": [ 1469, 2316 ] }
15,199