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
PreICO
PreICO.sol
0xa0df980a587b141bfda8cded13af737d96efb934
Solidity
PreICO
contract PreICO is Ownable { using SafeMath for uint256; Showcoin public token; uint256 public constant rate = 2000; uint256 public endTime; address public wallet; uint256 public constant tokenSaleLimit = 4000000 * (10 ** 18); uint256 public tokenRaised; bool public...
buyTokens
function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state tokenRaised = tokenRaised.add(token...
// low level token purchase function
LineComment
v0.4.19+commit.c4cbbb05
bzzr://62f7508d308572fc489c4ef4b8e89a92a9cd3f9e5afb436397dd7898362e8f76
{ "func_code_index": [ 1990, 2587 ] }
21,800
PreICO
PreICO.sol
0xa0df980a587b141bfda8cded13af737d96efb934
Solidity
PreICO
contract PreICO is Ownable { using SafeMath for uint256; Showcoin public token; uint256 public constant rate = 2000; uint256 public endTime; address public wallet; uint256 public constant tokenSaleLimit = 4000000 * (10 ** 18); uint256 public tokenRaised; bool public...
forwardFunds
function forwardFunds() internal { wallet.transfer(msg.value); }
// send ether to the fund collection wallet // override to create custom fund forwarding mechanisms
LineComment
v0.4.19+commit.c4cbbb05
bzzr://62f7508d308572fc489c4ef4b8e89a92a9cd3f9e5afb436397dd7898362e8f76
{ "func_code_index": [ 2700, 2783 ] }
21,801
PreICO
PreICO.sol
0xa0df980a587b141bfda8cded13af737d96efb934
Solidity
PreICO
contract PreICO is Ownable { using SafeMath for uint256; Showcoin public token; uint256 public constant rate = 2000; uint256 public endTime; address public wallet; uint256 public constant tokenSaleLimit = 4000000 * (10 ** 18); uint256 public tokenRaised; bool public...
validPurchase
function validPurchase() internal view returns (bool) { bool nonZeroPurchase = msg.value != 0; return nonZeroPurchase; }
// @return true if the transaction can buy tokens
LineComment
v0.4.19+commit.c4cbbb05
bzzr://62f7508d308572fc489c4ef4b8e89a92a9cd3f9e5afb436397dd7898362e8f76
{ "func_code_index": [ 2841, 2989 ] }
21,802
PreICO
PreICO.sol
0xa0df980a587b141bfda8cded13af737d96efb934
Solidity
PreICO
contract PreICO is Ownable { using SafeMath for uint256; Showcoin public token; uint256 public constant rate = 2000; uint256 public endTime; address public wallet; uint256 public constant tokenSaleLimit = 4000000 * (10 ** 18); uint256 public tokenRaised; bool public...
hasEnded
function hasEnded() public view returns (bool) { return now > endTime || tokenRaised >= tokenSaleLimit; }
// @return true if crowdsale event has ended
LineComment
v0.4.19+commit.c4cbbb05
bzzr://62f7508d308572fc489c4ef4b8e89a92a9cd3f9e5afb436397dd7898362e8f76
{ "func_code_index": [ 3042, 3166 ] }
21,803
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 94, 154 ] }
21,804
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 237, 310 ] }
21,805
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 534, 616 ] }
21,806
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 895, 983 ] }
21,807
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1647, 1726 ] }
21,808
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2039, 2141 ] }
21,809
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 259, 445 ] }
21,810
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 723, 864 ] }
21,811
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1162, 1359 ] }
21,812
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1613, 2089 ] }
21,813
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2560, 2697 ] }
21,814
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 3188, 3471 ] }
21,815
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 3931, 4066 ] }
21,816
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 4546, 4717 ] }
21,817
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codeha...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 606, 1230 ] }
21,818
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2160, 2562 ] }
21,819
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 3318, 3498 ] }
21,820
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 3723, 3924 ] }
21,821
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 4294, 4525 ] }
21,822
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 4776, 5097 ] }
21,823
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
safeApprove
function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line ...
/** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 747, 1374 ] }
21,824
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
_callOptionalReturn
function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target ad...
/** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2393, 3159 ] }
21,825
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 497, 581 ] }
21,826
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1139, 1292 ] }
21,827
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1442, 1691 ] }
21,828
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 902, 990 ] }
21,829
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1104, 1196 ] }
21,830
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1829, 1917 ] }
21,831
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public view override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 1977, 2082 ] }
21,832
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2140, 2264 ] }
21,833
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2472, 2652 ] }
21,834
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 2710, 2866 ] }
21,835
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 3008, 3182 ] }
21,836
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amou...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 3651, 3977 ] }
21,837
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 4381, 4604 ] }
21,838
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 5102, 5376 ] }
21,839
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sen...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 5861, 6405 ] }
21,840
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfe...
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 6681, 7064 ] }
21,841
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _to...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 7391, 7814 ] }
21,842
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 8249, 8600 ] }
21,843
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_setupDecimals
function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; }
/** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 8927, 9022 ] }
21,844
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 9620, 9717 ] }
21,845
LondonCityToken
LondonCityToken.sol
0xe441b0a7609605c713b7e532e17dcd65d2f34516
Solidity
LondonCityToken
contract LondonCityToken is ERC20("LONDON.cityswap.io", "LONDON"), Ownable { uint256 public constant MAX_SUPPLY = 7878000 * 10**18; /** * @notice Creates `_amount` token to `_to`. Must only be called by the owner (TravelAgency). */ function mint(address _to, uint256 _amount) ...
// CityToken with Governance.
LineComment
mint
function mint(address _to, uint256 _amount) public onlyOwner { uint256 _totalSupply = totalSupply(); if(_totalSupply.add(_amount) > MAX_SUPPLY) { _amount = MAX_SUPPLY.sub(_totalSupply); } require(_totalSupply.add(_amount) <= MAX_SUPPLY); _mint(_to, _amount); }
/** * @notice Creates `_amount` token to `_to`. Must only be called by the owner (TravelAgency). */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://3074a7314a34be4a1aebb03c2ecea254646b602b9c36665aae0c7226c1dd6f2d
{ "func_code_index": [ 272, 622 ] }
21,846
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, 'SafeMath: addition overflow'); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 259, 445 ] }
21,847
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, 'SafeMath: subtraction overflow'); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 723, 864 ] }
21,848
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1162, 1393 ] }
21,849
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1647, 2123 ] }
21,850
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, 'SafeMath: division by zero'); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 2594, 2731 ] }
21,851
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 3222, 3539 ] }
21,852
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, 'SafeMath: modulo by zero'); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 3999, 4134 ] }
21,853
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 4614, 4819 ] }
21,854
MasterChef
@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sqrt
function sqrt(uint256 y) internal pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } }
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
LineComment
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 5045, 5362 ] }
21,855
geneverse
@openzeppelin/contracts/access/Ownable.sol
0xc67a55c009fd516cbda4502de26d1326eb0028f2
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
GNU GPLv3
ipfs://606a12f9f5bfa4ceb2aa0b981d866bae754329431183d9340b5e752cf9b63d76
{ "func_code_index": [ 399, 491 ] }
21,856
geneverse
@openzeppelin/contracts/access/Ownable.sol
0xc67a55c009fd516cbda4502de26d1326eb0028f2
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
renounceOwnership
function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); }
/** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
GNU GPLv3
ipfs://606a12f9f5bfa4ceb2aa0b981d866bae754329431183d9340b5e752cf9b63d76
{ "func_code_index": [ 1050, 1149 ] }
21,857
geneverse
@openzeppelin/contracts/access/Ownable.sol
0xc67a55c009fd516cbda4502de26d1326eb0028f2
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
transferOwnership
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
GNU GPLv3
ipfs://606a12f9f5bfa4ceb2aa0b981d866bae754329431183d9340b5e752cf9b63d76
{ "func_code_index": [ 1299, 1496 ] }
21,858
geneverse
@openzeppelin/contracts/access/Ownable.sol
0xc67a55c009fd516cbda4502de26d1326eb0028f2
Solidity
geneverse
contract geneverse is ERC721Enumerable, Ownable { using Strings for uint256; string public baseURI; string public baseExtension = ".json"; string public notRevealedUri; uint256 public cost = 0.2 ether; uint256 public maxSupply = 888; uint256 public maxMintAmount = 25; uint256 public nftPerAddr...
_baseURI
function _baseURI() internal view virtual override returns (string memory) { return baseURI; }
// internal
LineComment
v0.8.4+commit.c7e474f2
GNU GPLv3
ipfs://606a12f9f5bfa4ceb2aa0b981d866bae754329431183d9340b5e752cf9b63d76
{ "func_code_index": [ 825, 930 ] }
21,859
geneverse
@openzeppelin/contracts/access/Ownable.sol
0xc67a55c009fd516cbda4502de26d1326eb0028f2
Solidity
geneverse
contract geneverse is ERC721Enumerable, Ownable { using Strings for uint256; string public baseURI; string public baseExtension = ".json"; string public notRevealedUri; uint256 public cost = 0.2 ether; uint256 public maxSupply = 888; uint256 public maxMintAmount = 25; uint256 public nftPerAddr...
mint
function mint(uint256 _mintAmount) public payable { require(!paused, "the contract is paused"); uint256 supply = totalSupply(); require(_mintAmount > 0, "need to mint at least 1 NFT"); require(_mintAmount <= maxMintAmount, "max mint amount per session exceeded"); require(supply + _mintAmount <= maxSupply...
// public
LineComment
v0.8.4+commit.c7e474f2
GNU GPLv3
ipfs://606a12f9f5bfa4ceb2aa0b981d866bae754329431183d9340b5e752cf9b63d76
{ "func_code_index": [ 946, 1880 ] }
21,860
geneverse
@openzeppelin/contracts/access/Ownable.sol
0xc67a55c009fd516cbda4502de26d1326eb0028f2
Solidity
geneverse
contract geneverse is ERC721Enumerable, Ownable { using Strings for uint256; string public baseURI; string public baseExtension = ".json"; string public notRevealedUri; uint256 public cost = 0.2 ether; uint256 public maxSupply = 888; uint256 public maxMintAmount = 25; uint256 public nftPerAddr...
reveal
function reveal() public onlyOwner() { revealed = true; }
//only owner
LineComment
v0.8.4+commit.c7e474f2
GNU GPLv3
ipfs://606a12f9f5bfa4ceb2aa0b981d866bae754329431183d9340b5e752cf9b63d76
{ "func_code_index": [ 3003, 3073 ] }
21,861
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
balanceOf
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; }
/** * @dev See {IERC1155-balanceOf}. * * Rbaequirements: * * - `account` cannot be the zero address. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1464, 1700 ] }
21,862
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
balanceOfBatch
function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accoun...
/** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 1861, 2415 ] }
21,863
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
setApprovalForAll
function setApprovalForAll(address operator, bool approved) public virtual override { require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); }
/** * @dev See {IERC1155-setApprovalForAll}. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 2483, 2799 ] }
21,864
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
isApprovedForAll
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; }
/** * @dev See {IERC1155-isApprovedForAll}. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 2866, 3039 ] }
21,865
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
safeTransferFrom
function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require(to != address(0), "ERC1155: transfer to the zero address"); require( from == _msgSender() || isApprovedForAll(from, _msgSend...
/** * @dev See {IERC1155-safeTransferFrom}. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 3106, 3845 ] }
21,866
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
safeBatchTransferFrom
function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC115...
/** * @dev See {IERC1155-safeBatchTransferFrom}. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 3917, 4981 ] }
21,867
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
_mint
function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _balances[id][account] = _balances[id][account].add(amount); emit TransferSingle(operator, addre...
/** * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`. * * Emits a {TransferSingle} event. * * Requirements: * * - `account` cannot be the zero address. * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * a...
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 5377, 5753 ] }
21,868
NFTMarket
contracts/token/ERC1155.sol
0x9e490c44f5c10225782468d19ee060523525e3cb
Solidity
ERC1155
contract ERC1155 is Context, ERC165, IERC1155 { using SafeMath for uint256; using Address for address; // Mapping from token ID to account balances mapping (uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping (address => mapp...
/** * * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */
NatSpecMultiLine
_mintBatch
function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); ...
/** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 6104, 6653 ] }
21,869
ZPets
contracts/ZPets.sol
0xf455aac43e2e5452b1848993be5067f362d459d2
Solidity
ZPets
contract ZPets is Ownable, ERC721Enumerable, ERC721Burnable, ReentrancyGuard { using Strings for uint256; Zunks private zunks; enum Slot { eyes, hat, leftEar, neck, rightEar, smoke } mapping(uint256 => string) public serialIdToPet; mapping(string => bool) public existingPets; map...
rerollPet
function rerollPet(uint256 serialId) public { require(isRerollAllEnabled, "Reroll is not enabled"); require(msg.sender == ownerOf(serialId), "Only owner can reroll."); require( block.timestamp - serialIdToTimeRedeemed[serialId] <= ONE_DAY, "Can not reroll after one day" ); string memory pet = serialI...
// this rerolls all the slots of a pet besides skin/type
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 5410, 6863 ] }
21,870
ZPets
contracts/ZPets.sol
0xf455aac43e2e5452b1848993be5067f362d459d2
Solidity
ZPets
contract ZPets is Ownable, ERC721Enumerable, ERC721Burnable, ReentrancyGuard { using Strings for uint256; Zunks private zunks; enum Slot { eyes, hat, leftEar, neck, rightEar, smoke } mapping(uint256 => string) public serialIdToPet; mapping(string => bool) public existingPets; map...
isSlotSelected
function isSlotSelected( Slot prospectiveSlot, uint256 seed1, uint256 seed2, uint256 seed3 ) internal view returns (bool) { uint256 randomNumber = getRandomNumber(seed1, seed2, seed3); return petSlotProbabilities[uint256(prospectiveSlot)] >= randomNumber; }
// prospective slots are 0-4
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 19282, 19569 ] }
21,871
ZPets
contracts/ZPets.sol
0xf455aac43e2e5452b1848993be5067f362d459d2
Solidity
ZPets
contract ZPets is Ownable, ERC721Enumerable, ERC721Burnable, ReentrancyGuard { using Strings for uint256; Zunks private zunks; enum Slot { eyes, hat, leftEar, neck, rightEar, smoke } mapping(uint256 => string) public serialIdToPet; mapping(string => bool) public existingPets; map...
convertToUint
function convertToUint(string memory s) internal pure returns (uint256) { string memory tensDigit = substring(s, 0, 1); string memory onesDigit = substring(s, 1, 2); return stringToUint(tensDigit) * 10 + stringToUint(onesDigit); }
// s will always be len 2
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 23148, 23394 ] }
21,872
ZPets
contracts/ZPets.sol
0xf455aac43e2e5452b1848993be5067f362d459d2
Solidity
ZPets
contract ZPets is Ownable, ERC721Enumerable, ERC721Burnable, ReentrancyGuard { using Strings for uint256; Zunks private zunks; enum Slot { eyes, hat, leftEar, neck, rightEar, smoke } mapping(uint256 => string) public serialIdToPet; mapping(string => bool) public existingPets; map...
editProbabilities
function editProbabilities( uint256 slot, uint256[] memory updatedProbabilities ) public onlyOwner { probabilities[slot] = updatedProbabilities; }
// will be used for fun stuff in the future, stay tuned!
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 26215, 26379 ] }
21,873
ZPets
contracts/ZPets.sol
0xf455aac43e2e5452b1848993be5067f362d459d2
Solidity
ZPets
contract ZPets is Ownable, ERC721Enumerable, ERC721Burnable, ReentrancyGuard { using Strings for uint256; Zunks private zunks; enum Slot { eyes, hat, leftEar, neck, rightEar, smoke } mapping(uint256 => string) public serialIdToPet; mapping(string => bool) public existingPets; map...
devSingleMint
function devSingleMint(uint256[] memory serialIds) public onlyOwner { require(!hasDevSingleMinted, "Can only dev single mint once"); require(serialIds.length == 1, "Can only mint one pet"); _mint(serialIds); hasDevSingleMinted = true; }
// Devs own zunk #10000, mint pet #10000 so we can set up OS
LineComment
v0.8.4+commit.c7e474f2
{ "func_code_index": [ 26444, 26700 ] }
21,874
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
underlying
function underlying() external view returns (address) { return cToken.underlying(); }
/// @dev ISavingStrategy.underlying implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 328, 432 ] }
21,875
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
exchangeRateStored
function exchangeRateStored() external view returns (uint256) { return cToken.exchangeRateStored(); }
/// @dev ISavingStrategy.exchangeRateStored implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 499, 619 ] }
21,876
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
accrueInterest
function accrueInterest() external returns (bool) { return cToken.accrueInterest() == 0; }
/// @dev ISavingStrategy.accrueInterest implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 682, 791 ] }
21,877
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
supplyAndBorrowApy
function supplyAndBorrowApy() external view returns (uint256, uint256) { uint256 supplyRatePerBlock = cToken.supplyRatePerBlock(); uint256 borrowRatePerBlock = cToken.borrowRatePerBlock(); return (supplyRatePerBlock, borrowRatePerBlock); }
/// @dev ISavingStrategy.supplyAndBorrowApy implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 858, 1134 ] }
21,878
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
investUnderlying
function investUnderlying(uint256 investAmount) external onlyOwner returns (uint256) { token.transferFrom(msg.sender, address(this), investAmount); token.approve(address(cToken), investAmount); uint256 cTotalBefore = cToken.totalSupply(); // TODO should we handle mint failure? require(cToken.mi...
/// @dev ISavingStrategy.investUnderlying implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 1199, 1846 ] }
21,879
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
redeemUnderlying
function redeemUnderlying(uint256 redeemAmount) external onlyOwner returns (uint256) { uint256 cTotalBefore = cToken.totalSupply(); // TODO should we handle redeem failure? require(cToken.redeemUnderlying(redeemAmount) == 0, "cToken.redeemUnderlying failed"); uint256 cTotalAfter = cToken.totalSupply...
/// @dev ISavingStrategy.redeemUnderlying implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 1911, 2515 ] }
21,880
CompoundAllocationStrategyV2
contracts/CompoundAllocationStrategy.sol
0x2b695860d1b69e51ef65681ddbb520b5f892bf9b
Solidity
CompoundAllocationStrategy
contract CompoundAllocationStrategy is IAllocationStrategy, Ownable { CErc20Interface private cToken; IERC20 private token; constructor(CErc20Interface cToken_) public { cToken = cToken_; token = IERC20(cToken.underlying()); } /// @dev ISavingStrategy.underlying implemen...
redeemAll
function redeemAll() external onlyOwner returns (uint256 savingsAmount, uint256 underlyingAmount) { savingsAmount = cToken.balanceOf(address(this)); require(cToken.redeem(savingsAmount) == 0, "cToken.redeem failed"); underlyingAmount = token.balanceOf(address(this)); token.transfer(msg.sender, ...
/// @dev ISavingStrategy.redeemAll implementation
NatSpecSingleLine
v0.5.12+commit.7709ece9
None
bzzr://f0357abafc17e1bea25a9dafeebfd0e9857dcb79e1f5cdb35eada4afda817038
{ "func_code_index": [ 2573, 2943 ] }
21,881
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
getOwner
function getOwner() external override view returns (address) { return owner(); }
/** * @dev Returns the bep token owner. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 905, 1004 ] }
21,882
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public override view returns (string memory) { return _name; }
/** * @dev Returns the token name. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1062, 1159 ] }
21,883
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public override view returns (uint8) { return _decimals; }
/** * @dev Returns the token decimals. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1221, 1318 ] }
21,884
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public override view returns (string memory) { return _symbol; }
/** * @dev Returns the token symbol. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1378, 1479 ] }
21,885
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public override view returns (uint256) { return _totalSupply; }
/** * @dev See {BEP20-totalSupply}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1538, 1643 ] }
21,886
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public override view returns (uint256) { return _balances[account]; }
/** * @dev See {BEP20-balanceOf}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 1700, 1824 ] }
21,887
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {BEP20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 2031, 2203 ] }
21,888
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public override view returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {BEP20-allowance}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 2260, 2408 ] }
21,889
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {BEP20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 2549, 2715 ] }
21,890
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, 'BEP20: transfer amount exceeds allowance')...
/** * @dev See {BEP20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {BEP20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amoun...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 3181, 3583 ] }
21,891
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {BEP20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` ca...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 3986, 4201 ] }
21,892
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, 'BEP20: decreased allowance below zero') ); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {BEP20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` ca...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 4698, 5014 ] }
21,893
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
mint
function mint(uint256 amount) public onlyOwner returns (bool) { _mint(_msgSender(), amount); return true; }
/** * @dev Creates `amount` tokens and assigns them to `msg.sender`, increasing * the total supply. * * Requirements * * - `msg.sender` must be the token owner */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 5227, 5362 ] }
21,894
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer( address sender, address recipient, uint256 amount ) internal { require(sender != address(0), 'BEP20: transfer from the zero address'); require(recipient != address(0), 'BEP20: transfer to the zero address'); _balances[sender] = _balances[sender].sub(amount, 'BEP20: t...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 5847, 6357 ] }
21,895
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal { require(account != address(0), 'BEP20: mint to the zero address'); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 6633, 6946 ] }
21,896
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal { require(account != address(0), 'BEP20: burn from the zero address'); _balances[account] = _balances[account].sub(amount, 'BEP20: burn amount exceeds balance'); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amo...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 7273, 7626 ] }
21,897
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve( address owner, address spender, uint256 amount ) internal { require(owner != address(0), 'BEP20: approve from the zero address'); require(spender != address(0), 'BEP20: approve to the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spen...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 8061, 8438 ] }
21,898
MasterChef
@pancakeswap/pancake-swap-lib/contracts/token/BEP20/BEP20.sol
0x7dbe40ac6bb41a5fe4fa2c74f31d7defbc793b58
Solidity
BEP20
contract BEP20 is Context, IBEP20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string pr...
/** * @dev Implementation of the {IBEP20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {BEP20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_burnFrom
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve( account, _msgSender(), _allowances[account][_msgSender()].sub(amount, 'BEP20: burn amount exceeds allowance') ); }
/** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */
NatSpecMultiLine
v0.6.12+commit.27d51765
MIT
ipfs://819243db1918f8129995fc0b7826dea17e377a7daecdcc79bcb97fc18e7fe2ac
{ "func_code_index": [ 8619, 8906 ] }
21,899