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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | 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 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
606,
1252
]
} | 1,200 |
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | 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 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
2182,
2582
]
} | 1,201 |
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | 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 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
3338,
3518
]
} | 1,202 |
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | 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 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
3743,
3978
]
} | 1,203 |
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | 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 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
4348,
4613
]
} | 1,204 |
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | 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, errorMessa... | /**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
4864,
5228
]
} | 1,205 |
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | getMultiplier | function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
if (_to <= bonusEndBlock) {
return _to.sub(_from);
} else if (_from >= bonusEndBlock) {
return 0;
} else {
return bonusEndBlock.sub(_from);
}
}
| // Return reward multiplier over the given _from to _to block. | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
2826,
3137
]
} | 1,206 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | pendingReward | function pendingReward(address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[_user];
uint256 accCakePerShare = pool.accCakePerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (block.number > pool.lastRewardBlock... | // View function to see pending Reward on frontend. | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
3197,
3942
]
} | 1,207 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | updatePool | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;
return;
}
... | // Update reward variables of the given pool to be up-to-date. | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
4013,
4705
]
} | 1,208 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | massUpdatePools | function massUpdatePools() public {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
updatePool(pid);
}
}
| // Update reward variables for all pools. Be careful of gas spending! | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
4783,
4968
]
} | 1,209 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | deposit | function deposit(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[msg.sender];
// require (_amount.add(user.amount) <= maxStaking, 'exceed max stake');
updatePool(0);
if (user.amount > 0) {
uint256 pending = user.amount.mul(pool.accCak... | // Stake SYRUP tokens to SmartChef | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
5013,
6099
]
} | 1,210 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | withdraw | function withdraw(uint256 _amount) public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(0);
uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt);
if(pe... | // Withdraw SYRUP tokens from STAKING. | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
6146,
6878
]
} | 1,211 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | emergencyWithdraw | function emergencyWithdraw() public {
PoolInfo storage pool = poolInfo[0];
UserInfo storage user = userInfo[msg.sender];
pool.lpToken.safeTransfer(address(msg.sender), user.amount);
user.amount = 0;
user.rewardDebt = 0;
emit EmergencyWithdraw(msg.sender, user.amount);
}
| // Withdraw without caring about rewards. EMERGENCY ONLY. | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
6944,
7278
]
} | 1,212 | ||
SmartChef | SmartChef.sol | 0x2e79b43206ea1dbfd91519741a9d76c3195c9a85 | Solidity | SmartChef | contract SmartChef is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Info of eac... | emergencyRewardWithdraw | function emergencyRewardWithdraw(uint256 _amount) public onlyOwner {
require(_amount < rewardToken.balanceOf(address(this)), 'not enough token');
rewardToken.safeTransfer(address(msg.sender), _amount);
}
| // Withdraw reward. EMERGENCY ONLY. | LineComment | v0.6.12+commit.27d51765 | None | ipfs://805fed17de5c1312a8e8b3dd05d8cf0577eb32703424cd6e7bb1f55ab91ac6dc | {
"func_code_index": [
7452,
7683
]
} | 1,213 | ||
ALCXRewarder | contracts/libraries/math/SignedSafeMath.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SignedSafeMath | library SignedSafeMath {
int256 private constant _INT256_MIN = -2**255;
/**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(int256 a, int256 b) int... | mul | function mul(int256 a, int256 b) internal pure returns (int256) {
// 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;
}
require(!(a == -1 && b ==... | /**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
283,
772
]
} | 1,214 | ||||
ALCXRewarder | contracts/libraries/math/SignedSafeMath.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SignedSafeMath | library SignedSafeMath {
int256 private constant _INT256_MIN = -2**255;
/**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(int256 a, int256 b) int... | div | function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "SignedSafeMath: division by zero");
require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");
int256 c = a / b;
return c;
}
| /**
* @dev Returns the integer division of two signed 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 ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1192,
1430
]
} | 1,215 | ||||
ALCXRewarder | contracts/libraries/math/SignedSafeMath.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SignedSafeMath | library SignedSafeMath {
int256 private constant _INT256_MIN = -2**255;
/**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(int256 a, int256 b) int... | sub | function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");
return c;
}
| /**
* @dev Returns the subtraction of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1635,
1828
]
} | 1,216 | ||||
ALCXRewarder | contracts/libraries/math/SignedSafeMath.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SignedSafeMath | library SignedSafeMath {
int256 private constant _INT256_MIN = -2**255;
/**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(int256 a, int256 b) int... | add | function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2027,
2217
]
} | 1,217 | ||||
ALCXRewarder | contracts/libraries/tokens/ERC20/ERC20.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ERC20 | contract ERC20 is ERC20Data, Domain {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a differen... | transfer | function transfer(address to, uint256 amount) public returns (bool) {
// If `amount` is 0, or `msg.sender` is `to` nothing happens
if (amount != 0) {
uint256 srcBalance = balanceOf[msg.sender];
require(srcBalance >= amount, "ERC20::transfer: balance too low");
if (msg.sender != to) {
require(to != address(0)... | /// @notice Transfers `amount` tokens from `msg.sender` to `to`.
/// @param to The address to move the tokens.
/// @param amount of the tokens to move.
/// @return (bool) Returns True if succeeded. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
799,
1452
]
} | 1,218 | ||||
ALCXRewarder | contracts/libraries/tokens/ERC20/ERC20.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ERC20 | contract ERC20 is ERC20Data, Domain {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a differen... | transferFrom | function transferFrom(
address from,
address to,
uint256 amount
) public returns (bool) {
// If `amount` is 0, or `from` is `to` nothing happens
if (amount != 0) {
uint256 srcBalance = balanceOf[from];
require(srcBalance >= amount, "ERC20::transferFrom: balance too low");
if (from != to) {
uint256 spende... | /// @notice Transfers `amount` tokens from `from` to `to`. Caller needs approval for `from`.
/// @param from Address to draw tokens from.
/// @param to The address to move the tokens.
/// @param amount The token amount to move.
/// @return (bool) Returns True if succeeded. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1733,
2767
]
} | 1,219 | ||||
ALCXRewarder | contracts/libraries/tokens/ERC20/ERC20.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ERC20 | contract ERC20 is ERC20Data, Domain {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a differen... | approve | function approve(address spender, uint256 amount) public returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
| /// @notice Approves `amount` from sender to be spend by `spender`.
/// @param spender Address of the party that can draw from msg.sender's account.
/// @param amount The maximum collective amount that `spender` can draw.
/// @return (bool) Returns True if approved. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3040,
3221
]
} | 1,220 | ||||
ALCXRewarder | contracts/libraries/tokens/ERC20/ERC20.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ERC20 | contract ERC20 is ERC20Data, Domain {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a differen... | DOMAIN_SEPARATOR | function DOMAIN_SEPARATOR() external view returns (bytes32) {
return _domainSeparator();
}
| // solhint-disable-next-line func-name-mixedcase | LineComment | v0.6.12+commit.27d51765 | {
"func_code_index": [
3273,
3367
]
} | 1,221 | ||||
ALCXRewarder | contracts/libraries/tokens/ERC20/ERC20.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ERC20 | contract ERC20 is ERC20Data, Domain {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a differen... | permit | function permit(
address owner_,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(owner_ != address(0), "ERC20::permit: Owner cannot be 0");
require(block.timestamp < deadline, "ERC20: Expired");
require(
ecrecover(
_getDigest(
keccak256(abi.encode(... | /// @notice Approves `value` from `owner_` to be spend by `spender`.
/// @param owner_ Address of the owner.
/// @param spender The address of the spender that gets approved to draw from `owner_`.
/// @param value The maximum collective amount that `spender` can draw.
/// @param deadline This permit must be redeemed be... | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3961,
4539
]
} | 1,222 | ||||
ALCXRewarder | contracts/ALCXRewarder.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ALCXRewarder | contract ALCXRewarder is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 private immutable rewardToken;
IMasterChefV2 private immutable MC_V2;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
... | addPool | function addPool(uint256 _pid, uint256 allocPoint) public onlyOwner {
require(poolInfo[_pid].lastRewardBlock == 0, "ALCXRewarder::add: cannot add existing pool");
uint256 lastRewardBlock = block.number;
totalAllocPoint = totalAllocPoint.add(allocPoint);
poolInfo[_pid] = PoolInfo({
allocPoint: allocPoint.to64(),... | /// @notice Add a new LP to the pool. Can only be called by the owner.
/// DO NOT add the same LP token more than once. Rewards will be messed up if you do.
/// @param allocPoint AP of the new pool.
/// @param _pid Pid on MCV2 | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2292,
2753
]
} | 1,223 | ||||
ALCXRewarder | contracts/ALCXRewarder.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ALCXRewarder | contract ALCXRewarder is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 private immutable rewardToken;
IMasterChefV2 private immutable MC_V2;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
... | setPool | function setPool(uint256 _pid, uint256 _allocPoint) public onlyOwner {
totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
poolInfo[_pid].allocPoint = _allocPoint.to64();
emit PoolSet(_pid, _allocPoint);
}
| /// @notice Update the given pool's SUSHI allocation point and `IRewarder` contract. Can only be called by the owner.
/// @param _pid The index of the pool. See `poolInfo`.
/// @param _allocPoint New AP of the pool. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2974,
3219
]
} | 1,224 | ||||
ALCXRewarder | contracts/ALCXRewarder.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ALCXRewarder | contract ALCXRewarder is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 private immutable rewardToken;
IMasterChefV2 private immutable MC_V2;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
... | updatePool | function updatePool(uint256 pid) public returns (PoolInfo memory pool) {
pool = poolInfo[pid];
if (block.number > pool.lastRewardBlock) {
uint256 lpSupply = MC_V2.lpToken(pid).balanceOf(address(MC_V2));
if (lpSupply > 0) {
uint256 blocks = block.number.sub(pool.lastRewardBlock);
uint256 tokenReward = bloc... | /// @notice Update reward variables of the given pool.
/// @param pid The index of the pool. See `poolInfo`.
/// @return pool Returns the pool that was updated. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3385,
4065
]
} | 1,225 | ||||
ALCXRewarder | contracts/ALCXRewarder.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ALCXRewarder | contract ALCXRewarder is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 private immutable rewardToken;
IMasterChefV2 private immutable MC_V2;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
... | massUpdatePools | function massUpdatePools(uint256[] calldata pids) public {
uint256 len = pids.length;
for (uint256 i = 0; i < len; ++i) {
updatePool(pids[i]);
}
}
| /// @notice Update reward variables for all pools
/// @dev Be careful of gas spending!
/// @param pids Pool IDs of all to be updated. Make sure to update all active pools. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4242,
4399
]
} | 1,226 | ||||
ALCXRewarder | contracts/ALCXRewarder.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ALCXRewarder | contract ALCXRewarder is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 private immutable rewardToken;
IMasterChefV2 private immutable MC_V2;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
... | setRewardRate | function setRewardRate(uint256 _tokenPerBlock, uint256[] calldata _pids) external onlyOwner {
massUpdatePools(_pids);
uint256 oldRate = tokenPerBlock;
tokenPerBlock = _tokenPerBlock;
emit RewardRateUpdated(oldRate, _tokenPerBlock);
}
| /// @dev Sets the distribution reward rate. This will also update all of the pools.
/// @param _tokenPerBlock The number of tokens to distribute per block | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4558,
4803
]
} | 1,227 | ||||
ALCXRewarder | contracts/ALCXRewarder.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | ALCXRewarder | contract ALCXRewarder is IRewarder, BoringOwnable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
IERC20 private immutable rewardToken;
IMasterChefV2 private immutable MC_V2;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
... | pendingToken | function pendingToken(uint256 _pid, address _user) public view returns (uint256 pending) {
PoolInfo memory pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accTokenPerShare = pool.accTokenPerShare;
uint256 lpSupply = MC_V2.lpToken(_pid).balanceOf(address(MC_V2));
if (block.number > p... | /// @notice View function to see pending Token
/// @param _pid The index of the pool. See `poolInfo`.
/// @param _user Address of user.
/// @return pending SUSHI reward for a given user. | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5957,
6666
]
} | 1,228 | ||||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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 override view returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
328,
433
]
} | 1,229 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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 override view returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
491,
615
]
} | 1,230 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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.2+commit.bacdbe57 | {
"func_code_index": [
823,
1044
]
} | 1,231 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | allowance | function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
1102,
1308
]
} | 1,232 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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.2+commit.bacdbe57 | {
"func_code_index": [
1450,
1665
]
} | 1,233 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | transferFrom | function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: ... | /**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amou... | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
2134,
2593
]
} | 1,234 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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.2+commit.bacdbe57 | {
"func_code_index": [
2997,
3302
]
} | 1,235 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"ERC20: decreased allowance below zero"
)
... | /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
3800,
4205
]
} | 1,236 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _transfer | function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
... | /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
*... | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
4690,
5305
]
} | 1,237 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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.2+commit.bacdbe57 | {
"func_code_index": [
5581,
5964
]
} | 1,238 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _burn | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(
amount,
"ERC20: burn amount exceeds balance"
)... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
6291,
6751
]
} | 1,239 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our... | NatSpecMultiLine | _approve | function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(own... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero... | NatSpecMultiLine | v0.6.2+commit.bacdbe57 | {
"func_code_index": [
7186,
7571
]
} | 1,240 | ||
Redeem | contracts/option/primitives/ERC20.sol | 0x6376e02af48c7e0e76941295f48a92b66379a60e | 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;
/**
* @dev See {IERC20-totalSupply}.
... | /**
* @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.2+commit.bacdbe57 | {
"func_code_index": [
8892,
9022
]
} | 1,241 | ||
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | SafeMath | library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "... | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
1509,
1646
]
} | 1,242 | ||
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | SafeMath | library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "... | div | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
... | /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2171,
2521
]
} | 1,243 | ||
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | SafeMath | library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "... | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2973,
3108
]
} | 1,244 | ||
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | SafeMath | library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "... | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
3622,
3793
]
} | 1,245 | ||
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
606,
1230
]
} | 1,246 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2160,
2562
]
} | 1,247 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
3318,
3496
]
} | 1,248 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
3721,
3922
]
} | 1,249 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
4292,
4523
]
} | 1,250 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | 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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
4774,
5095
]
} | 1,251 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
94,
154
]
} | 1,252 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
237,
310
]
} | 1,253 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
534,
616
]
} | 1,254 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
895,
983
]
} | 1,255 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
1647,
1726
]
} | 1,256 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2039,
2141
]
} | 1,257 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
1473,
1561
]
} | 1,258 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
1675,
1767
]
} | 1,259 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2400,
2488
]
} | 1,260 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2548,
2653
]
} | 1,261 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
2711,
2835
]
} | 1,262 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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) {
_approveCheck(_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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
3043,
3227
]
} | 1,263 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
3774,
3930
]
} | 1,264 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
4072,
4246
]
} | 1,265 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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) {
_approveCheck(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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
4715,
5045
]
} | 1,266 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
| /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
5449,
5740
]
} | 1,267 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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 safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
| /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
6238,
6386
]
} | 1,268 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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 | addApprove | function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
| /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
6801,
7085
]
} | 1,269 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
7572,
8120
]
} | 1,270 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
8396,
8702
]
} | 1,271 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
9029,
9452
]
} | 1,272 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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, amount)... | /**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero... | NatSpecMultiLine | v0.6.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
9887,
10236
]
} | 1,273 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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 | _approveCheck | function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(send... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
10681,
11273
]
} | 1,274 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
12992,
13087
]
} | 1,275 |
ETH2_0 | ETH2_0.sol | 0xd4226608c0409f0fad770f7701ba34244b46fa8e | Solidity | ETH2_0 | contract ETH2_0 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... | /**
* @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.6+commit.6c089d02 | None | ipfs://13a76e60278571a135341170847190e0dab75782b9fc89a40ac79afa1b750647 | {
"func_code_index": [
13685,
13782
]
} | 1,276 |
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | /**
* @dev Fallback function revert your fund.
* Only buy Cell token with the buyToken function.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
1483,
1587
]
} | 1,277 | ||||
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | cellToken | function cellToken() public view returns (IERC721) {
return _cellToken;
}
| /**
* @return The token being sold.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
1646,
1738
]
} | 1,278 | ||
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | weiPerToken | function weiPerToken() public view returns (uint256) {
return _weiPerToken;
}
| /**
* @return Amount of wei to be pay for a Cell token
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
1816,
1912
]
} | 1,279 | ||
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | wallet | function wallet() public view returns (address payable) {
return _wallet;
}
| /**
* @return The address where tokens amounts are collected.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
1997,
2091
]
} | 1,280 | ||
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | cellById | function cellById(uint256 tokenId) public pure returns (uint256 x, uint256 y){
y = tokenId / 90;
x = tokenId - (y * 90);
}
| /**
* @dev Returns x and y where represent the position of the cell.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
2183,
2333
]
} | 1,281 | ||
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | buyToken | function buyToken(address beneficiary, uint256 tokenId) public payable{
require(beneficiary != address(0), "Presale: beneficiary is the zero address");
require(weiPerToken() == msg.value, "Presale: Not enough Eth");
require(!_cellToken.exists(tokenId), "Presale: token already minted");
require(token... | /**
* @dev token purchase with pay Land tokens
* @param beneficiary Recipient of the token purchase
* @param tokenId uint256 ID of the token to be purchase
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
2524,
3252
]
} | 1,282 | ||
Presale | contracts/Presale.sol | 0xf2adcac7d4cd117879849b0983fe89e1b1675931 | Solidity | Presale | contract Presale is Context {
// The token being sold
IERC721 private _cellToken;
// Address where fund are collected
address payable private _wallet;
// Amount of wei raised
uint256 private _weiRaised;
// Amount of token to be pay for one ERC721 token
uint256 private _weiP... | /**
* @title Presale
* @dev Presale contract allowing investors to purchase the cell token.
* This contract implements such functionality in its most fundamental form and can be extended
* to provide additional functionality and/or custom behavior.
*/ | NatSpecMultiLine | buyBatchTokens | function buyBatchTokens(address beneficiary, uint256[] memory tokenIds) public payable{
require(beneficiary != address(0), "Presale: beneficiary is the zero address");
uint256 weiAmount = weiPerToken() * tokenIds.length;
require(weiAmount == msg.value, "Presale: Not enough Eth");
for (uint256 i = 0;... | /**
* @dev batch token purchase with pay our ERC20 tokens
* @param beneficiary Recipient of the token purchase
* @param tokenIds uint256 IDs of the token to be purchase
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | {
"func_code_index": [
3460,
4442
]
} | 1,283 | ||
KeeperIncentive | contracts/core/utils/KeeperIncentive.sol | 0xafaca2ad8dad766bcc274bf16039088a7ea493bf | Solidity | KeeperIncentive | contract KeeperIncentive is ACLAuth, ContractRegistryAccess {
using SafeERC20 for IERC20;
struct Incentive {
uint256 reward; //pop reward for calling the function
bool enabled;
bool openToEveryone; //can everyone call the function to get the reward or only approved?
}
/* ========== STATE VARIABLES... | handleKeeperIncentive | function handleKeeperIncentive(
bytes32 _contractName,
uint8 _i,
address _keeper
) external {
require(msg.sender == controllerContracts[_contractName], "Can only be called by the controlling contract");
require(
IStaking(_getContract(keccak256("PopLocker"))).balanceOf(_keeper) >= requiredKeeperStake,
... | /* ========== MUTATIVE FUNCTIONS ========== */ | Comment | v0.8.1+commit.df193b15 | GNU GPLv3 | {
"func_code_index": [
1714,
2641
]
} | 1,284 | |||
KeeperIncentive | contracts/core/utils/KeeperIncentive.sol | 0xafaca2ad8dad766bcc274bf16039088a7ea493bf | Solidity | KeeperIncentive | contract KeeperIncentive is ACLAuth, ContractRegistryAccess {
using SafeERC20 for IERC20;
struct Incentive {
uint256 reward; //pop reward for calling the function
bool enabled;
bool openToEveryone; //can everyone call the function to get the reward or only approved?
}
/* ========== STATE VARIABLES... | createIncentive | function createIncentive(
bytes32 _contractName,
uint256 _reward,
bool _enabled,
bool _openToEveryone
) public onlyRole(DAO_ROLE) {
incentives[_contractName].push(Incentive({ reward: _reward, enabled: _enabled, openToEveryone: _openToEveryone }));
emit IncentiveCreated(_contractName, _reward, _openToEveryon... | /**
* @notice Create Incentives for keeper to call a function
* @param _contractName Name of contract that uses ParticipationRewards in bytes32
* @param _reward The amount in POP the Keeper receives for calling the function
* @param _enabled Is this Incentive currently enabled?
* @param _openToEveryone Can anyone ... | NatSpecMultiLine | v0.8.1+commit.df193b15 | GNU GPLv3 | {
"func_code_index": [
3256,
3599
]
} | 1,285 | |||
KeeperIncentive | contracts/core/utils/KeeperIncentive.sol | 0xafaca2ad8dad766bcc274bf16039088a7ea493bf | Solidity | KeeperIncentive | contract KeeperIncentive is ACLAuth, ContractRegistryAccess {
using SafeERC20 for IERC20;
struct Incentive {
uint256 reward; //pop reward for calling the function
bool enabled;
bool openToEveryone; //can everyone call the function to get the reward or only approved?
}
/* ========== STATE VARIABLES... | updateIncentive | function updateIncentive(
bytes32 _contractName,
uint8 _i,
uint256 _reward,
bool _enabled,
bool _openToEveryone
) external onlyRole(DAO_ROLE) {
Incentive storage incentive = incentives[_contractName][_i];
uint256 oldReward = incentive.reward;
bool oldOpenToEveryone = incentive.openToEveryone;
incentiv... | /* ========== RESTRICTED FUNCTIONS ========== */ | Comment | v0.8.1+commit.df193b15 | GNU GPLv3 | {
"func_code_index": [
3653,
4198
]
} | 1,286 | |||
KeeperIncentive | contracts/core/utils/KeeperIncentive.sol | 0xafaca2ad8dad766bcc274bf16039088a7ea493bf | Solidity | KeeperIncentive | contract KeeperIncentive is ACLAuth, ContractRegistryAccess {
using SafeERC20 for IERC20;
struct Incentive {
uint256 reward; //pop reward for calling the function
bool enabled;
bool openToEveryone; //can everyone call the function to get the reward or only approved?
}
/* ========== STATE VARIABLES... | addControllerContract | function addControllerContract(bytes32 _contractName, address contract_) external onlyRole(DAO_ROLE) {
controllerContracts[_contractName] = contract_;
emit ControllerContractAdded(_contractName, contract_);
}
| /**
* @notice In order to allow a contract to use ParticipationReward they need to be added as a controller contract
* @param _contractName the name of the controller contract in bytes32
* @param contract_ the address of the controller contract
* @dev all critical functions to init/open vaults and add shares to the... | NatSpecMultiLine | v0.8.1+commit.df193b15 | GNU GPLv3 | {
"func_code_index": [
5369,
5589
]
} | 1,287 | |||
KeeperIncentive | contracts/core/utils/KeeperIncentive.sol | 0xafaca2ad8dad766bcc274bf16039088a7ea493bf | Solidity | KeeperIncentive | contract KeeperIncentive is ACLAuth, ContractRegistryAccess {
using SafeERC20 for IERC20;
struct Incentive {
uint256 reward; //pop reward for calling the function
bool enabled;
bool openToEveryone; //can everyone call the function to get the reward or only approved?
}
/* ========== STATE VARIABLES... | updateBurnRate | function updateBurnRate(uint256 _burnRate) external onlyRole(DAO_ROLE) {
emit BurnRateChanged(burnRate, _burnRate);
burnRate = _burnRate;
}
| /**
* @notice Sets the current burn rate as a percentage of the incentive reward.
* @param _burnRate Percentage in Mantissa. (1e14 = 1 Basis Point)
*/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | GNU GPLv3 | {
"func_code_index": [
5753,
5904
]
} | 1,288 | |||
KeeperIncentive | contracts/core/utils/KeeperIncentive.sol | 0xafaca2ad8dad766bcc274bf16039088a7ea493bf | Solidity | KeeperIncentive | contract KeeperIncentive is ACLAuth, ContractRegistryAccess {
using SafeERC20 for IERC20;
struct Incentive {
uint256 reward; //pop reward for calling the function
bool enabled;
bool openToEveryone; //can everyone call the function to get the reward or only approved?
}
/* ========== STATE VARIABLES... | updateRequiredKeeperStake | function updateRequiredKeeperStake(uint256 _amount) external onlyRole(DAO_ROLE) {
emit RequiredKeeperStakeChanged(requiredKeeperStake, _amount);
requiredKeeperStake = _amount;
}
| /**
* @notice Sets the required amount of POP a keeper needs to have staked to handle incentivized functions.
* @param _amount Amount of POP a keeper needs to stake
*/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | GNU GPLv3 | {
"func_code_index": [
6236,
6425
]
} | 1,289 | |||
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | /*
_____ ___ ______ _____ _____ _____ _____ ___ ____________ _____
|_ _/ _ \| ___ | __ | ___|_ _| _ | / _ \| ___ | ___ / ___|
| |/ /_\ | |_/ | | \| |__ | | | | | | / /_\ | |_/ | |_/ \ `--.
| || _ | /| | __| __| | | | | | | | _ | __/| __/ `--. \
| || | | | |\ \| |_\ | |___ | | \ ... | Comment | totalSupply | function totalSupply() constant returns (uint256 supply) {}
| /// @return total amount of tokens | NatSpecSingleLine | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
60,
124
]
} | 1,290 | |
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | /*
_____ ___ ______ _____ _____ _____ _____ ___ ____________ _____
|_ _/ _ \| ___ | __ | ___|_ _| _ | / _ \| ___ | ___ / ___|
| |/ /_\ | |_/ | | \| |__ | | | | | | / /_\ | |_/ | |_/ \ `--.
| || _ | /| | __| __| | | | | | | | _ | __/| __/ `--. \
| || | | | |\ \| |_\ | |___ | | \ ... | Comment | balanceOf | function balanceOf(address _owner) constant returns (uint256 balance) {}
| /// @param _owner The address from which the balance will be retrieved
/// @return The balance | NatSpecSingleLine | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
232,
309
]
} | 1,291 | |
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | /*
_____ ___ ______ _____ _____ _____ _____ ___ ____________ _____
|_ _/ _ \| ___ | __ | ___|_ _| _ | / _ \| ___ | ___ / ___|
| |/ /_\ | |_/ | | \| |__ | | | | | | / /_\ | |_/ | |_/ \ `--.
| || _ | /| | __| __| | | | | | | | _ | __/| __/ `--. \
| || | | | |\ \| |_\ | |___ | | \ ... | Comment | transfer | function transfer(address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
546,
623
]
} | 1,292 | |
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | /*
_____ ___ ______ _____ _____ _____ _____ ___ ____________ _____
|_ _/ _ \| ___ | __ | ___|_ _| _ | / _ \| ___ | ___ / ___|
| |/ /_\ | |_/ | | \| |__ | | | | | | / /_\ | |_/ | |_/ \ `--.
| || _ | /| | __| __| | | | | | | | _ | __/| __/ `--. \
| || | | | |\ \| |_\ | |___ | | \ ... | Comment | transferFrom | function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
| /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
946,
1042
]
} | 1,293 | |
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | /*
_____ ___ ______ _____ _____ _____ _____ ___ ____________ _____
|_ _/ _ \| ___ | __ | ___|_ _| _ | / _ \| ___ | ___ / ___|
| |/ /_\ | |_/ | | \| |__ | | | | | | / /_\ | |_/ | |_/ \ `--.
| || _ | /| | __| __| | | | | | | | _ | __/| __/ `--. \
| || | | | |\ \| |_\ | |___ | | \ ... | Comment | approve | function approve(address _spender, uint256 _value) returns (bool success) {}
| /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not | NatSpecSingleLine | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
1326,
1407
]
} | 1,294 | |
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | Token | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | /*
_____ ___ ______ _____ _____ _____ _____ ___ ____________ _____
|_ _/ _ \| ___ | __ | ___|_ _| _ | / _ \| ___ | ___ / ___|
| |/ /_\ | |_/ | | \| |__ | | | | | | / /_\ | |_/ | |_/ \ `--.
| || _ | /| | __| __| | | | | | | | _ | __/| __/ `--. \
| || | | | |\ \| |_\ | |___ | | \ ... | Comment | allowance | function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
| /// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent | NatSpecSingleLine | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
1615,
1712
]
} | 1,295 | |
AtpcCoin | AtpcCoin.sol | 0x244fac342166ca01f262b7b16105699fab783cb4 | Solidity | AtpcCoin | contract AtpcCoin is StandardToken {
/* Public variables of the token */
string public name;
uint8 public decimals;
string public symbol;
string public version = 'H1.0';
uint256 public unitsOneEthCanBuy; // How many units of your coin can be bought by 1 ETH?
uint256 public tot... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signatur... | /* Approves and then calls the receiving contract */ | Comment | v0.4.25-nightly.2018.5.30+commit.3f3d6df2 | bzzr://1d59b7cdb48da781e300d5de61fdbfddfa02ba291aff95490ca58cb9a7cbd85e | {
"func_code_index": [
2294,
3111
]
} | 1,296 | |||
ALCXRewarder | contracts/SushiToken.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SushiToken | contract SushiToken is ERC20("SushiToken", "SUSHI"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
// Copied and m... | // SushiToken with Governance. | LineComment | mint | function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
| /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
157,
302
]
} | 1,297 | ||
ALCXRewarder | contracts/SushiToken.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SushiToken | contract SushiToken is ERC20("SushiToken", "SUSHI"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
// Copied and m... | // SushiToken with Governance. | LineComment | delegates | function delegates(address delegator) external view returns (address) {
return _delegates[delegator];
}
| /**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegator The address to get delegatee for
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2165,
2272
]
} | 1,298 | ||
ALCXRewarder | contracts/SushiToken.sol | 0xd101479ce045b903ae14ec6afa7a11171afb5dfa | Solidity | SushiToken | contract SushiToken is ERC20("SushiToken", "SUSHI"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
_moveDelegates(address(0), _delegates[_to], _amount);
}
// Copied and m... | // SushiToken with Governance. | LineComment | delegate | function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
| /**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2398,
2492
]
} | 1,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.