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
NMusic
contracts/core/NPassCore.sol
0xadea332258a8927b2fdbcbec96f826c11d583fdf
Solidity
NPassCore
abstract contract NPassCore is ERC721Enumerable, ReentrancyGuard, Ownable { uint256 public constant MAX_N_TOKEN_ID = 8888; IN public immutable n; bool public immutable onlyNHolders; uint16 public immutable reservedAllowance; uint16 public reserveMinted; uint256 public immutable maxTotalSupply; ...
/** * @title NPassCore contract * @author Tony Snark * @notice This contract provides basic functionalities to allow minting using the NPass * @dev This contract should be used only for testing or testnet deployments */
NatSpecMultiLine
withdrawAll
function withdrawAll() external onlyOwner { payable(owner()).transfer(address(this).balance); }
/** * @notice Allows owner to withdraw amount */
NatSpecMultiLine
v0.8.6+commit.11564f7e
MIT
{ "func_code_index": [ 4536, 4647 ] }
8,107
FifthBountyWPTpayoutPart02
FifthBountyWPTpayoutPart02.sol
0x14c60d21e6383a1e4657b2f1273a8787b9a2ec0a
Solidity
FifthBountyWPTpayoutPart02
contract FifthBountyWPTpayoutPart02 { //storage address public owner; Token public company_token; address[] public addressOfBountyMembers; mapping(address => uint256) bountyMembersAmounts; uint currentBatch; uint addrPerStep; //modifiers modifier onlyOwner { require(owner == msg.sen...
function() public payable { revert(); }
/// @dev Fallback function: don't accept ETH
NatSpecSingleLine
v0.4.24+commit.e67f0147
bzzr://dcbecf73a7594aad2dfc4a442a9d49b22554caf4bfeda3046205f9eb72a2d534
{ "func_code_index": [ 750, 813 ] }
8,108
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 155, 375 ] }
8,109
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 517, 710 ] }
8,110
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 854, 1351 ] }
8,111
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 1496, 1690 ] }
8,112
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 1845, 2039 ] }
8,113
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 2270, 2370 ] }
8,114
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 2637, 2737 ] }
8,115
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 2980, 3080 ] }
8,116
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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.2+commit.661d1103
{ "func_code_index": [ 3365, 3465 ] }
8,117
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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 (consuming a...
NatSpecMultiLine
v0.8.2+commit.661d1103
{ "func_code_index": [ 3914, 4014 ] }
8,118
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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}. * * Counterpart to ...
NatSpecMultiLine
v0.8.2+commit.661d1103
{ "func_code_index": [ 4474, 4709 ] }
8,119
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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 invali...
NatSpecMultiLine
v0.8.2+commit.661d1103
{ "func_code_index": [ 5189, 5423 ] }
8,120
TheRareAntiquitiesToken
@openzeppelin/contracts/utils/math/SafeMath.sol
0x6460b9954a05714a1a8d36bac6d8bc9b657352d7
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) return (f...
/** * @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}. * * C...
NatSpecMultiLine
v0.8.2+commit.661d1103
{ "func_code_index": [ 6065, 6299 ] }
8,121
MxnToken
zeppelin-solidity/contracts/math/SafeMath.sol
0xc4b8d248109ebb821e992a78c3cd05f22ecd073e
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://github.com/...
/** * @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 = _a * _...
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.5.2+commit.1df8f40c
None
bzzr://71c90a89022f384ad335f33792b1eec36e858c975f5eb54ed383fcc8581cbc29
{ "func_code_index": [ 84, 466 ] }
8,122
MxnToken
zeppelin-solidity/contracts/math/SafeMath.sol
0xc4b8d248109ebb821e992a78c3cd05f22ecd073e
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://github.com/...
/** * @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.5.2+commit.1df8f40c
None
bzzr://71c90a89022f384ad335f33792b1eec36e858c975f5eb54ed383fcc8581cbc29
{ "func_code_index": [ 546, 831 ] }
8,123
MxnToken
zeppelin-solidity/contracts/math/SafeMath.sol
0xc4b8d248109ebb821e992a78c3cd05f22ecd073e
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://github.com/...
/** * @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.5.2+commit.1df8f40c
None
bzzr://71c90a89022f384ad335f33792b1eec36e858c975f5eb54ed383fcc8581cbc29
{ "func_code_index": [ 941, 1059 ] }
8,124
MxnToken
zeppelin-solidity/contracts/math/SafeMath.sol
0xc4b8d248109ebb821e992a78c3cd05f22ecd073e
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://github.com/...
/** * @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.5.2+commit.1df8f40c
None
bzzr://71c90a89022f384ad335f33792b1eec36e858c975f5eb54ed383fcc8581cbc29
{ "func_code_index": [ 1119, 1249 ] }
8,125
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
approve
function approve(address operator, uint256 id) external override { address owner = _ownerOf(id); require(owner != address(0), "NONEXISTENT_TOKEN"); require(owner == msg.sender || _operatorsForAll[owner][msg.sender], "UNAUTHORIZED_APPROVAL"); _approveFor(owner, operator, id); }
/// @notice Approve an operator to spend tokens on the senders behalf. /// @param operator The address receiving the approval. /// @param id The id of the token.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 812, 1129 ] }
8,126
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
transferFrom
function transferFrom( address from, address to, uint256 id ) external override { (address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id); require(owner != address(0), "NONEXISTENT_TOKEN"); require(owner == from, "NOT_OWNER"); require(to != address(0), "NOT_TO_ZEROADDRESS"); ...
/// @notice Transfer a token between 2 addresses. /// @param from The sender of the token. /// @param to The recipient of the token. /// @param id The id of the token.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 1315, 1937 ] }
8,127
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
safeTransferFrom
function safeTransferFrom( address from, address to, uint256 id ) external override { safeTransferFrom(from, to, id, ""); }
/// @notice Transfer a token between 2 addresses letting the receiver know of the transfer. /// @param from The send of the token. /// @param to The recipient of the token. /// @param id The id of the token.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 2163, 2330 ] }
8,128
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
setApprovalForAll
function setApprovalForAll(address operator, bool approved) external override { _setApprovalForAll(msg.sender, operator, approved); }
/// @notice Set the approval for an operator to manage all the tokens of the sender. /// @param operator The address receiving the approval. /// @param approved The determination of the approval.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 2540, 2689 ] }
8,129
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
balanceOf
function balanceOf(address owner) external view override returns (uint256 balance) { require(owner != address(0), "ZERO_ADDRESS_OWNER"); balance = _holderTokens[owner].length(); }
/// @notice Get the number of tokens owned by an address. /// @param owner The address to look for. /// @return balance The number of tokens owned by the address.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 2866, 3069 ] }
8,130
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
ownerOf
function ownerOf(uint256 id) external view override returns (address owner) { owner = _ownerOf(id); require(owner != address(0), "NONEXISTANT_TOKEN"); }
/// @notice Get the owner of a token. /// @param id The id of the token. /// @return owner The address of the token owner.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 3206, 3382 ] }
8,131
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
getApproved
function getApproved(uint256 id) external view override returns (address) { (address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id); require(owner != address(0), "NONEXISTENT_TOKEN"); if (operatorEnabled) { return _operators[id]; } else { return address(0); } }
/// @notice Get the approved operator for a specific token. /// @param id The id of the token. /// @return The address of the operator.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 3775, 4123 ] }
8,132
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
isApprovedForAll
function isApprovedForAll(address owner, address operator) external view override returns (bool isOperator) { return _operatorsForAll[owner][operator]; }
/// @notice Check if the sender approved the operator. /// @param owner The address of the owner. /// @param operator The address of the operator. /// @return isOperator The status of the approval.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 4339, 4508 ] }
8,133
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
safeTransferFrom
function safeTransferFrom( address from, address to, uint256 id, bytes memory data ) public override { (address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id); require(owner != address(0), "NONEXISTENT_TOKEN"); require(owner == from, "NOT_OWNER"); require(to != address(0),...
/// @notice Transfer a token between 2 addresses letting the receiver knows of the transfer. /// @param from The sender of the token. /// @param to The recipient of the token. /// @param id The id of the token. /// @param data Additional data.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 4774, 5571 ] }
8,134
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
supportsInterface
function supportsInterface(bytes4 id) public pure virtual override returns (bool) { return id == 0x01ffc9a7 || id == 0x80ac58cd || id == 0x780e9d63; }
/// @notice Check if the contract supports an interface. /// 0x01ffc9a7 is ERC165. /// 0x80ac58cd is ERC721 /// 0x780e9d63 is for ERC721 enumerable /// @param id The id of the interface. /// @return Whether the interface is supported.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 5832, 5998 ] }
8,135
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
_approveFor
function _approveFor( address owner, address operator, uint256 id ) internal { if (operator == address(0)) { _owners[id] = uint256(owner); } else { _owners[id] = OPERATOR_FLAG | uint256(owner); _operators[id] = operator; } emit Approval(owner, operator, id); }
/// @dev See approve.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 6286, 6651 ] }
8,136
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
_setApprovalForAll
function _setApprovalForAll( address sender, address operator, bool approved ) internal { _operatorsForAll[sender][operator] = approved; emit ApprovalForAll(sender, operator, approved); }
/// @dev See setApprovalForAll.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 6689, 6929 ] }
8,137
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
_checkOnERC721Received
function _checkOnERC721Received( address operator, address from, address to, uint256 id, bytes memory data ) internal returns (bool) { bytes4 retval = IERC721Receiver(to).onERC721Received(operator, from, id, data); return (retval == ERC721_RECEIVED); }
/// @dev Check if receiving contract accepts erc721 transfers. /// @param operator The address of the operator. /// @param from The from address, may be different from msg.sender. /// @param to The adddress we want to transfer to. /// @param id The id of the token we would like to transfer. /// @param data Any addition...
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 7380, 7700 ] }
8,138
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
_ownerOf
function _ownerOf(uint256 id) internal view returns (address owner) { owner = address(_owners[id]); require(owner != address(0), "NOT_EXIST"); }
/// @dev See ownerOf
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 7727, 7895 ] }
8,139
MandalaToken
src/ERC721Base.sol
0xdaca87395f3b1bbc46f3fa187e996e03a5dcc985
Solidity
ERC721Base
abstract contract ERC721Base is IERC165, IERC721 { using Address for address; using EnumerableSet for EnumerableSet.UintSet; bytes4 internal constant ERC721_RECEIVED = 0x150b7a02; bytes4 internal constant ERC165ID = 0x01ffc9a7; uint256 internal constant OPERATOR_FLAG = (2**255); uint256 intern...
_ownerAndOperatorEnabledOf
function _ownerAndOperatorEnabledOf(uint256 id) internal view returns (address owner, bool operatorEnabled) { uint256 data = _owners[id]; owner = address(data); operatorEnabled = (data & OPERATOR_FLAG) == OPERATOR_FLAG; }
/// @dev Get the owner and operatorEnabled status of a token. /// @param id The token to query. /// @return owner The owner of the token. /// @return operatorEnabled Whether or not operators are enabled for this token.
NatSpecSingleLine
v0.7.1+commit.f4a555be
MIT
{ "func_code_index": [ 8132, 8385 ] }
8,140
COE
contracts/COE.sol
0x30c92c69d38cfacbb28081490f8cd7558d441903
Solidity
COE
contract COE is MintableToken, BurnableToken, RBAC { using SafeMath for uint256; string public constant name = "Coin Market Cap Coeval"; string public constant symbol = "COE"; uint8 public constant decimals = 18; // this variable represents the total amount of eth raised uint public ethRaised; ...
mine
function mine(uint amount) canMine public { require(amount > 0); require(cycleMintSupply < CYCLE_CAP); require(ERC20(MNY).transferFrom(msg.sender, address(this), amount)); uint refund = _mine(exchangeRateMNY, amount); if(refund > 0) { ERC20(MNY).transfer(msg.sender, refund); } if (cycleMintS...
// first call (mny address).approve(coe address, amount) for COE to transfer on your behalf.
LineComment
v0.4.24+commit.e67f0147
bzzr://aa8ac3c08b4a0b62421ed997aae9582237c035d849922bad70054b0e6926c2c3
{ "func_code_index": [ 4720, 5133 ] }
8,141
COE
contracts/COE.sol
0x30c92c69d38cfacbb28081490f8cd7558d441903
Solidity
COE
contract COE is MintableToken, BurnableToken, RBAC { using SafeMath for uint256; string public constant name = "Coin Market Cap Coeval"; string public constant symbol = "COE"; uint8 public constant decimals = 18; // this variable represents the total amount of eth raised uint public ethRaised; ...
whitelistMine
function whitelistMine(uint amount) canMine onlyIfWhitelisted public { require(amount > 0); require(cycleMintSupply < CYCLE_CAP); require(ERC20(FUTX).transferFrom(msg.sender, address(this), amount)); uint refund = _mine(exchangeRateFUTX, amount); if(refund > 0) { ERC20(FUTX).transfer(msg.sender, r...
// first call (futx address).approve(coe address, amount) for COE to transfer on your behalf.
LineComment
v0.4.24+commit.e67f0147
bzzr://aa8ac3c08b4a0b62421ed997aae9582237c035d849922bad70054b0e6926c2c3
{ "func_code_index": [ 5233, 5676 ] }
8,142
AnnoyingNFT
AnnoyingNFT.sol
0x7ce9581a9dfae3b0df86bbd66a1326407501c799
Solidity
AnnoyingNFT
contract AnnoyingNFT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; address payable public marketingAddress = payable(0x3E8d27e0cdE0d879E443B027a3e529D1De2d5dC0); // Marketing Address address payable public liquidityAddress = payable(0x0000000000000...
enableTrading
function enableTrading() external onlyOwner { tradingActive = true; }
// once enabled, can never be turned off
LineComment
v0.8.9+commit.e5eed63a
MIT
ipfs://c1ef740a869d8cd2f732ee50570d3475d7d488e719c1d116c395dc071b31cd6d
{ "func_code_index": [ 8134, 8222 ] }
8,143
AnnoyingNFT
AnnoyingNFT.sol
0x7ce9581a9dfae3b0df86bbd66a1326407501c799
Solidity
AnnoyingNFT
contract AnnoyingNFT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; address payable public marketingAddress = payable(0x3E8d27e0cdE0d879E443B027a3e529D1De2d5dC0); // Marketing Address address payable public liquidityAddress = payable(0x0000000000000...
disableTransferDelay
function disableTransferDelay() external onlyOwner returns (bool){ transferDelayEnabled = false; return true; }
// disable Transfer delay
LineComment
v0.8.9+commit.e5eed63a
MIT
ipfs://c1ef740a869d8cd2f732ee50570d3475d7d488e719c1d116c395dc071b31cd6d
{ "func_code_index": [ 9176, 9315 ] }
8,144
AnnoyingNFT
AnnoyingNFT.sol
0x7ce9581a9dfae3b0df86bbd66a1326407501c799
Solidity
AnnoyingNFT
contract AnnoyingNFT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; address payable public marketingAddress = payable(0x3E8d27e0cdE0d879E443B027a3e529D1De2d5dC0); // Marketing Address address payable public liquidityAddress = payable(0x0000000000000...
removeLimits
function removeLimits() external onlyOwner returns (bool){ limitsInEffect = false; gasLimitActive = false; transferDelayEnabled = false; return true; }
// remove limits after token is stable - 30-60 minutes
LineComment
v0.8.9+commit.e5eed63a
MIT
ipfs://c1ef740a869d8cd2f732ee50570d3475d7d488e719c1d116c395dc071b31cd6d
{ "func_code_index": [ 9874, 10071 ] }
8,145
AnnoyingNFT
AnnoyingNFT.sol
0x7ce9581a9dfae3b0df86bbd66a1326407501c799
Solidity
AnnoyingNFT
contract AnnoyingNFT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; address payable public marketingAddress = payable(0x3E8d27e0cdE0d879E443B027a3e529D1De2d5dC0); // Marketing Address address payable public liquidityAddress = payable(0x0000000000000...
buyBackTokens
function buyBackTokens(uint256 bnbAmountInWei) external onlyOwner { // generate the uniswap pair path of weth -> eth address[] memory path = new address[](2); path[0] = uniswapV2Router.WETH(); path[1] = address(this); // make the swap uniswapV2Router.swapExactETHForTokensSupportingFeeOnT...
// useful for buybacks or to reclaim any BNB on the contract in a way that helps holders.
LineComment
v0.8.9+commit.e5eed63a
MIT
ipfs://c1ef740a869d8cd2f732ee50570d3475d7d488e719c1d116c395dc071b31cd6d
{ "func_code_index": [ 27337, 27869 ] }
8,146
AnnoyingNFT
AnnoyingNFT.sol
0x7ce9581a9dfae3b0df86bbd66a1326407501c799
Solidity
AnnoyingNFT
contract AnnoyingNFT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; address payable public marketingAddress = payable(0x3E8d27e0cdE0d879E443B027a3e529D1De2d5dC0); // Marketing Address address payable public liquidityAddress = payable(0x0000000000000...
// To receive ETH from uniswapV2Router when swapping
LineComment
v0.8.9+commit.e5eed63a
MIT
ipfs://c1ef740a869d8cd2f732ee50570d3475d7d488e719c1d116c395dc071b31cd6d
{ "func_code_index": [ 27930, 27964 ] }
8,147
USDT
USDT.sol
0x500204277d636bb65d2863d22779a1140c4fcb24
Solidity
USDT
contract USDT { mapping (address => uint256) private balances; mapping (address => uint256[2]) private lockedBalances; string public name = "USDT"; //fancy name: eg Simon Bucks uint8 public decimals = 2; //How many decimals to show. string public symbol = "USDT"...
transfer
function transfer(address _to, uint256 _value) public returns (bool success) { //Before ICO finish, only own could transfer. if(_to != address(0)){ if(lockedBalances[msg.sender][1] >= now) { require((balances[msg.sender] > lockedBalances[msg.sender][0]) && (balances[msg.sen...
/*Checking lock limit and time limit while transfering.*/
Comment
v0.4.23+commit.124ca40d
bzzr://7a377d9eb470b57a982168aae7092fb129fc4d2275dc4e3e264175303023b24b
{ "func_code_index": [ 1380, 2049 ] }
8,148
USDT
USDT.sol
0x500204277d636bb65d2863d22779a1140c4fcb24
Solidity
USDT
contract USDT { mapping (address => uint256) private balances; mapping (address => uint256[2]) private lockedBalances; string public name = "USDT"; //fancy name: eg Simon Bucks uint8 public decimals = 2; //How many decimals to show. string public symbol = "USDT"...
burnFrom
function burnFrom(address _who,uint256 _value)public returns (bool){ require(msg.sender == owner); assert(balances[_who] >= _value); totalSupply -= _value; balances[_who] -= _value; lockedBalances[_who][0] = 0; lockedBalances[_who][1] = 0; return true; }
/*With permission, destory token from an address and minus total amount.*/
Comment
v0.4.23+commit.124ca40d
bzzr://7a377d9eb470b57a982168aae7092fb129fc4d2275dc4e3e264175303023b24b
{ "func_code_index": [ 2130, 2457 ] }
8,149
USDT
USDT.sol
0x500204277d636bb65d2863d22779a1140c4fcb24
Solidity
USDT
contract USDT { mapping (address => uint256) private balances; mapping (address => uint256[2]) private lockedBalances; string public name = "USDT"; //fancy name: eg Simon Bucks uint8 public decimals = 2; //How many decimals to show. string public symbol = "USDT"...
makeCoin
function makeCoin(uint256 _value)public returns (bool){ require(msg.sender == owner); totalSupply += _value; balances[owner] += _value; return true; }
/*With permission, creating coin.*/
Comment
v0.4.23+commit.124ca40d
bzzr://7a377d9eb470b57a982168aae7092fb129fc4d2275dc4e3e264175303023b24b
{ "func_code_index": [ 2499, 2695 ] }
8,150
USDT
USDT.sol
0x500204277d636bb65d2863d22779a1140c4fcb24
Solidity
USDT
contract USDT { mapping (address => uint256) private balances; mapping (address => uint256[2]) private lockedBalances; string public name = "USDT"; //fancy name: eg Simon Bucks uint8 public decimals = 2; //How many decimals to show. string public symbol = "USDT"...
withdraw
function withdraw() public{ require(msg.sender == owner); msg.sender.transfer(address(this).balance); }
/*With permission, withdraw ETH to owner address from smart contract.*/
Comment
v0.4.23+commit.124ca40d
bzzr://7a377d9eb470b57a982168aae7092fb129fc4d2275dc4e3e264175303023b24b
{ "func_code_index": [ 2894, 3025 ] }
8,151
USDT
USDT.sol
0x500204277d636bb65d2863d22779a1140c4fcb24
Solidity
USDT
contract USDT { mapping (address => uint256) private balances; mapping (address => uint256[2]) private lockedBalances; string public name = "USDT"; //fancy name: eg Simon Bucks uint8 public decimals = 2; //How many decimals to show. string public symbol = "USDT"...
withdrawTo
function withdrawTo(address _to) public{ require(msg.sender == owner); address(_to).transfer(address(this).balance); }
/*With permission, withdraw ETH to an address from smart contract.*/
Comment
v0.4.23+commit.124ca40d
bzzr://7a377d9eb470b57a982168aae7092fb129fc4d2275dc4e3e264175303023b24b
{ "func_code_index": [ 3100, 3246 ] }
8,152
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** ...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 96, 303 ] }
8,153
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** ...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 title SafeMath dev Math operations with safety checks that throw on error // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this d...
/** * @dev Integer division of two numbers, truncating the quotient. **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 400, 794 ] }
8,154
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** ...
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.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 921, 1049 ] }
8,155
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** ...
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.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 1126, 1272 ] }
8,156
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. **/ constructor() public { owner = msg.sender; } ...
/** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". **/
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
/** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 671, 862 ] }
8,157
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } ...
/** * @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.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 214, 310 ] }
8,158
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } ...
/** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); ...
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 487, 855 ] }
8,159
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return totalSupply_; } ...
/** * @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.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 1080, 1192 ] }
8,160
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
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 tr...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value)...
/** * @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.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 410, 917 ] }
8,161
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
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 tr...
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * ...
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 1574, 1785 ] }
8,162
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
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 tr...
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.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 2126, 2265 ] }
8,163
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
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 tr...
increaseApproval
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spend...
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 2756, 3041 ] }
8,164
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
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 tr...
decreaseApproval
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); }...
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spend...
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 3537, 3992 ] }
8,165
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ construc...
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; ...
/** * @dev fallback function to send ether to for Crowd sale **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 678, 1851 ] }
8,166
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ construc...
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
startIco
function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; }
/** * @dev startIco starts the public ICO **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 1923, 2063 ] }
8,167
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ construc...
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
endIco
function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); }
/** * @dev endIco closes down the ICO **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 2132, 2480 ] }
8,168
DobermannCoin
DobermannCoin.sol
0xd5e9cdc8446104ce0f0a92da0a4896e9bb7ef0d8
Solidity
CrowdsaleToken
contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ construc...
/** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/
NatSpecMultiLine
finalizeIco
function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); }
/** * @dev finalizeIco closes down the ICO and sets needed varriables **/
NatSpecMultiLine
v0.4.26+commit.4563c3fc
MIT
bzzr://62faf76e44eec44e3a40d6c2580060b8a4690aa5fdd7ab15fa52344f995e2250
{ "func_code_index": [ 2574, 2695 ] }
8,169
Sophia_Token
Sophia_Token.sol
0xdfcbe90d50d97babc04711fdcdf85c527375334e
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256...
/** * @dev Multiplies two numbers, reverts on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://b266f708f0fba2367bafd7aab8e693d811ce56f5b81aaec68daa8102770b24cf
{ "func_code_index": [ 90, 486 ] }
8,170
Sophia_Token
Sophia_Token.sol
0xdfcbe90d50d97babc04711fdcdf85c527375334e
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://b266f708f0fba2367bafd7aab8e693d811ce56f5b81aaec68daa8102770b24cf
{ "func_code_index": [ 598, 877 ] }
8,171
Sophia_Token
Sophia_Token.sol
0xdfcbe90d50d97babc04711fdcdf85c527375334e
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://b266f708f0fba2367bafd7aab8e693d811ce56f5b81aaec68daa8102770b24cf
{ "func_code_index": [ 992, 1131 ] }
8,172
Sophia_Token
Sophia_Token.sol
0xdfcbe90d50d97babc04711fdcdf85c527375334e
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two numbers, reverts on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://b266f708f0fba2367bafd7aab8e693d811ce56f5b81aaec68daa8102770b24cf
{ "func_code_index": [ 1196, 1335 ] }
8,173
Sophia_Token
Sophia_Token.sol
0xdfcbe90d50d97babc04711fdcdf85c527375334e
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://b266f708f0fba2367bafd7aab8e693d811ce56f5b81aaec68daa8102770b24cf
{ "func_code_index": [ 1470, 1587 ] }
8,174
Metacrypt_B_TR_MB_NC_X
/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/tokens/helpers/ERC20Capped.sol
0x4739e8ba220c316b7e47d1a6bf0e190959fc5610
Solidity
ERC20Capped
abstract contract ERC20Capped is ERC20 { uint256 private immutable _cap; /** * @dev Sets the value of the `cap`. This value is immutable, it can only be * set once during construction. */ constructor(uint256 cap_) { require(cap_ > 0, "ERC20Capped: cap is 0"); _cap = ...
/** * @dev Extension of {ERC20} that adds a cap to the supply of tokens. */
NatSpecMultiLine
cap
function cap() public view virtual returns (uint256) { return _cap; }
/** * @dev Returns the cap on the token's total supply. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 412, 500 ] }
8,175
Metacrypt_B_TR_MB_NC_X
/D/MicroSaaS/Metacrypt/code/metacrypt-contracts/contracts/tokens/helpers/ERC20Capped.sol
0x4739e8ba220c316b7e47d1a6bf0e190959fc5610
Solidity
ERC20Capped
abstract contract ERC20Capped is ERC20 { uint256 private immutable _cap; /** * @dev Sets the value of the `cap`. This value is immutable, it can only be * set once during construction. */ constructor(uint256 cap_) { require(cap_ > 0, "ERC20Capped: cap is 0"); _cap = ...
/** * @dev Extension of {ERC20} that adds a cap to the supply of tokens. */
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual override { require(ERC20.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded"); super._mint(account, amount); }
/** * @dev See {ERC20-_mint}. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
{ "func_code_index": [ 553, 765 ] }
8,176
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
usingOraclize
contract usingOraclize { uint constant day = 60*60*24; uint constant week = 60*60*24*7; uint constant month = 60*60*24*30; byte constant proofType_NONE = 0x00; byte constant proofType_TLSNotary = 0x10; byte constant proofType_Android = 0x20; byte constant proofType_Ledger = 0x30; ...
parseInt
function parseInt(string _a) internal returns (uint) { return parseInt(_a, 0); }
// parseInt
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 27498, 27597 ] }
8,177
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
usingOraclize
contract usingOraclize { uint constant day = 60*60*24; uint constant week = 60*60*24*7; uint constant month = 60*60*24*30; byte constant proofType_NONE = 0x00; byte constant proofType_TLSNotary = 0x10; byte constant proofType_Android = 0x20; byte constant proofType_Ledger = 0x30; ...
parseInt
function parseInt(string _a, uint _b) internal returns (uint) { bytes memory bresult = bytes(_a); uint mint = 0; bool decimals = false; for (uint i=0; i<bresult.length; i++){ if ((bresult[i] >= 48)&&(bresult[i] <= 57)){ if (decimals){ if (_b == 0) break; ...
// parseInt(parseFloat*10^_b)
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 27635, 28244 ] }
8,178
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
usingOraclize
contract usingOraclize { uint constant day = 60*60*24; uint constant week = 60*60*24*7; uint constant month = 60*60*24*30; byte constant proofType_NONE = 0x00; byte constant proofType_TLSNotary = 0x10; byte constant proofType_Android = 0x20; byte constant proofType_Ledger = 0x30; ...
copyBytes
function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal returns (bytes) { uint minLength = length + toOffset; if (to.length < minLength) { // Buffer too small throw; // Should be a better way? } // NOTE: the offset 32 is added to skip the ...
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 40329, 41046 ] }
8,179
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
usingOraclize
contract usingOraclize { uint constant day = 60*60*24; uint constant week = 60*60*24*7; uint constant month = 60*60*24*30; byte constant proofType_NONE = 0x00; byte constant proofType_TLSNotary = 0x10; byte constant proofType_Android = 0x20; byte constant proofType_Ledger = 0x30; ...
safer_ecrecover
function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) { // We do our own memory management here. Solidity uses memory offset // 0x40 to store the current end of memory. We write past it (as // writes are memory extensions), but don't update the offset so ...
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license // Duplicate Solidity's ecrecover, but catching the CALL return value
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 41247, 42252 ] }
8,180
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
usingOraclize
contract usingOraclize { uint constant day = 60*60*24; uint constant week = 60*60*24*7; uint constant month = 60*60*24*30; byte constant proofType_NONE = 0x00; byte constant proofType_TLSNotary = 0x10; byte constant proofType_Android = 0x20; byte constant proofType_Ledger = 0x30; ...
ecrecovery
function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) { bytes32 r; bytes32 s; uint8 v; if (sig.length != 65) return (false, 0); // The signature format is a compact form of: // {bytes32 r}{bytes32 s}{uint8 v} // Compact means, uint8 is not padded t...
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 42374, 43800 ] }
8,181
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
toSlice
function toSlice(string self) internal returns (slice) { uint ptr; assembly { ptr := add(self, 0x20) } return slice(bytes(self).length, ptr); }
/* * @dev Returns a slice containing the entire string. * @param self The string to make a slice from. * @return A newly allocated slice containing the entire string. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 855, 1057 ] }
8,182
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
len
function len(bytes32 self) internal returns (uint) { uint ret; if (self == 0) return 0; if (self & 0xffffffffffffffffffffffffffffffff == 0) { ret += 16; self = bytes32(uint(self) / 0x100000000000000000000000000000000); } if (self & 0xffffffffffffffff == 0) { ...
/* * @dev Returns the length of a null-terminated bytes32 string. * @param self The value to find the length of. * @return The length of the string, from 0 to 32. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 1255, 2047 ] }
8,183
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
toSliceB32
function toSliceB32(bytes32 self) internal returns (slice ret) { // Allocate space for `self` in memory, copy it there, and point ret at it assembly { let ptr := mload(0x40) mstore(0x40, add(ptr, 0x20)) mstore(ptr, self) mstore(add(ret, 0x20), ptr) } ret._len = le...
/* * @dev Returns a slice containing the entire bytes32, interpreted as a * null-termintaed utf-8 string. * @param self The bytes32 value to convert to a slice. * @return A new slice containing the value of the input argument up to the * first null. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 2357, 2729 ] }
8,184
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
copy
function copy(slice self) internal returns (slice) { return slice(self._len, self._ptr); }
/* * @dev Returns a new slice containing the same data as the current slice. * @param self The slice to copy. * @return A new slice containing the same data as `self`. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 2932, 3041 ] }
8,185
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
toString
function toString(slice self) internal returns (string) { var ret = new string(self._len); uint retptr; assembly { retptr := add(ret, 32) } memcpy(retptr, self._ptr, self._len); return ret; }
/* * @dev Copies a slice to a new string. * @param self The slice to copy. * @return A newly allocated string containing the slice's text. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 3215, 3463 ] }
8,186
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
len
function len(slice self) internal returns (uint) { // Starting at ptr-31 means the LSB will be the byte we care about var ptr = self._ptr - 31; var end = ptr + self._len; for (uint len = 0; ptr < end; len++) { uint8 b; assembly { b := and(mload(ptr), 0xFF) } if (b < 0x80) ...
/* * @dev Returns the length in runes of the slice. Note that this operation * takes time proportional to the length of the slice; avoid using it * in loops, and call `slice.empty()` if you only need to know whether * the slice is empty or not. * @param self The slice to operate on. * @return...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 3859, 4591 ] }
8,187
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
empty
function empty(slice self) internal returns (bool) { return self._len == 0; }
/* * @dev Returns true if the slice is empty (has a length of 0). * @param self The slice to operate on. * @return True if the slice is empty, False otherwise. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 4786, 4882 ] }
8,188
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
compare
function compare(slice self, slice other) internal returns (int) { uint shortest = self._len; if (other._len < self._len) shortest = other._len; var selfptr = self._ptr; var otherptr = other._ptr; for (uint idx = 0; idx < shortest; idx += 32) { uint a; uint b; ...
/* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two slices are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first slice to compare. * @param other Th...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 5316, 6204 ] }
8,189
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
equals
function equals(slice self, slice other) internal returns (bool) { return compare(self, other) == 0; }
/* * @dev Returns true if the two slices contain the same text. * @param self The first slice to compare. * @param self The second slice to compare. * @return True if the slices are equal, false otherwise. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 6451, 6572 ] }
8,190
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
nextRune
function nextRune(slice self, slice rune) internal returns (slice) { rune._ptr = self._ptr; if (self._len == 0) { rune._len = 0; return rune; } uint len; uint b; // Load the first byte of the rune into the LSBs of b assembly { b := and(mload(sub(mload(add(self, 3...
/* * @dev Extracts the first rune in the slice into `rune`, advancing the * slice to point to the next rune and returning `self`. * @param self The slice to operate on. * @param rune The slice that will contain the first rune. * @return `rune`. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 6869, 7778 ] }
8,191
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
nextRune
function nextRune(slice self) internal returns (slice ret) { nextRune(self, ret); }
/* * @dev Returns the first rune in the slice, advancing the slice to point * to the next rune. * @param self The slice to operate on. * @return A slice containing only the first rune from `self`. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 8021, 8123 ] }
8,192
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
ord
function ord(slice self) internal returns (uint ret) { if (self._len == 0) { return 0; } uint word; uint len; uint div = 2 ** 248; // Load the rune into the MSBs of b assembly { word:= mload(mload(add(self, 32))) } var b = word / div; if (b < 0x80) { re...
/* * @dev Returns the number of the first codepoint in the slice. * @param self The slice to operate on. * @return The number of the first codepoint in the slice. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 8321, 9392 ] }
8,193
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
keccak
function keccak(slice self) internal returns (bytes32 ret) { assembly { ret := sha3(mload(add(self, 32)), mload(self)) } }
/* * @dev Returns the keccak-256 hash of the slice. * @param self The slice to hash. * @return The hash of the slice. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 9545, 9708 ] }
8,194
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
startsWith
function startsWith(slice self, slice needle) internal returns (bool) { if (self._len < needle._len) { return false; } if (self._ptr == needle._ptr) { return true; } bool equal; assembly { let len := mload(needle) let selfptr := mload(add(self, 0x20)...
/* * @dev Returns true if `self` starts with `needle`. * @param self The slice to operate on. * @param needle The slice to search for. * @return True if the slice starts with the provided text, false otherwise. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 9960, 10489 ] }
8,195
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
beyond
function beyond(slice self, slice needle) internal returns (slice) { if (self._len < needle._len) { return self; } bool equal = true; if (self._ptr != needle._ptr) { assembly { let len := mload(needle) let selfptr := mload(add(self, 0x20)) l...
/* * @dev If `self` starts with `needle`, `needle` is removed from the * beginning of `self`. Otherwise, `self` is unmodified. * @param self The slice to operate on. * @param needle The slice to search for. * @return `self` */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 10765, 11407 ] }
8,196
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
endsWith
function endsWith(slice self, slice needle) internal returns (bool) { if (self._len < needle._len) { return false; } var selfptr = self._ptr + self._len - needle._len; if (selfptr == needle._ptr) { return true; } bool equal; assembly { let len := mload...
/* * @dev Returns true if the slice ends with `needle`. * @param self The slice to operate on. * @param needle The slice to search for. * @return True if the slice starts with the provided text, false otherwise. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 11660, 12198 ] }
8,197
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
until
function until(slice self, slice needle) internal returns (slice) { if (self._len < needle._len) { return self; } var selfptr = self._ptr + self._len - needle._len; bool equal = true; if (selfptr != needle._ptr) { assembly { let len := mload(needle) ...
/* * @dev If `self` ends with `needle`, `needle` is removed from the * end of `self`. Otherwise, `self` is unmodified. * @param self The slice to operate on. * @param needle The slice to search for. * @return `self` */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 12466, 13071 ] }
8,198
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
findPtr
function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) { uint ptr; uint idx; if (needlelen <= selflen) { if (needlelen <= 32) { // Optimized assembly for 68 gas per byte on short strings assembly { let mask...
// Returns the memory address of the first byte of the first occurrence of // `needle` in `self`, or the first byte after `self` if not found.
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 13227, 14695 ] }
8,199
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rfindPtr
function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) { uint ptr; if (needlelen <= selflen) { if (needlelen <= 32) { // Optimized assembly for 69 gas per byte on short strings assembly { let mask := not(sub(ex...
// Returns the memory address of the first byte after the last occurrence of // `needle` in `self`, or the address of `self` if not found.
LineComment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 14847, 16352 ] }
8,200
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
find
function find(slice self, slice needle) internal returns (slice) { uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); self._len -= ptr - self._ptr; self._ptr = ptr; return self; }
/* * @dev Modifies `self` to contain everything from the first occurrence of * `needle` to the end of the slice. `self` is set to the empty slice * if `needle` is not found. * @param self The slice to search and modify. * @param needle The text to search for. * @return `self`. */
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 16693, 16935 ] }
8,201
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rfind
function rfind(slice self, slice needle) internal returns (slice) { uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr); self._len = ptr - self._ptr; return self; }
/* * @dev Modifies `self` to contain the part of the string from the start of * `self` to the end of the first occurrence of `needle`. If `needle` * is not found, `self` is set to the empty slice. * @param self The slice to search and modify. * @param needle The text to search for. * @return `self...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 17299, 17516 ] }
8,202
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
split
function split(slice self, slice needle, slice token) internal returns (slice) { uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr); token._ptr = self._ptr; token._len = ptr - self._ptr; if (ptr == self._ptr + self._len) { // Not found self._len = 0; } else { ...
/* * @dev Splits the slice, setting `self` to everything after the first * occurrence of `needle`, and `token` to everything before it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and `token` is set to the entirety of `self`. * @param self The slice to split. *...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 18029, 18517 ] }
8,203
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
split
function split(slice self, slice needle) internal returns (slice token) { split(self, needle, token); }
/* * @dev Splits the slice, setting `self` to everything after the first * occurrence of `needle`, and returning everything before it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and the entirety of `self` is returned. * @param self The slice to split. * @param...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 18994, 19116 ] }
8,204
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rsplit
function rsplit(slice self, slice needle, slice token) internal returns (slice) { uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr); token._ptr = ptr; token._len = self._len - (ptr - self._ptr); if (ptr == self._ptr) { // Not found self._len = 0; } else { ...
/* * @dev Splits the slice, setting `self` to everything before the last * occurrence of `needle`, and `token` to everything after it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and `token` is set to the entirety of `self`. * @param self The slice to split. * ...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 19628, 20070 ] }
8,205
Eth2x
Eth2x.sol
0x88c8e21fd5509af42109f9cd40423f1c365a46c7
Solidity
strings
library strings { struct slice { uint _len; uint _ptr; } function memcpy(uint dest, uint src, uint len) private { // Copy word-length chunks while possible for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } ...
/* * @title String & slice utility library for Solidity contracts. * @author Nick Johnson <arachnid@notdot.net> * * @dev Functionality in this library is largely implemented using an * abstraction called a 'slice'. A slice represents a part of a string - * anything from the entire string to a sing...
Comment
rsplit
function rsplit(slice self, slice needle) internal returns (slice token) { rsplit(self, needle, token); }
/* * @dev Splits the slice, setting `self` to everything before the last * occurrence of `needle`, and returning everything after it. If * `needle` does not occur in `self`, `self` is set to the empty slice, * and the entirety of `self` is returned. * @param self The slice to split. * @param ...
Comment
v0.4.18+commit.9cf6e910
None
bzzr://97596762d0cdb0978841279c5455689bee4470e7b1f2ec842907fbf57970a659
{ "func_code_index": [ 20545, 20669 ] }
8,206