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
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @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 += amount; _balances[account] += 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.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 6899, 7242 ] }
15,700
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds ba...
/** * @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.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 7570, 8069 ] }
15,701
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This 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 a...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 8502, 8853 ] }
15,702
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20
contract ERC20 is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values fo...
/** * @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.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 9451, 9548 ] }
15,703
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Burnable
abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`...
/** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */
NatSpecMultiLine
burn
function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); }
/** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 161, 257 ] }
15,704
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Burnable
abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`...
/** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */
NatSpecMultiLine
burnFrom
function burnFrom(address account, uint256 amount) public virtual { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), currentAllowance - amount); _burn(account, amount); }
/** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 571, 908 ] }
15,705
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure r...
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
max
function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; }
/** * @dev Returns the largest of two numbers. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 83, 195 ] }
15,706
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure r...
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
min
function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; }
/** * @dev Returns the smallest of two numbers. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 266, 377 ] }
15,707
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Math
library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure r...
/** * @dev Standard math utilities missing in the Solidity language. */
NatSpecMultiLine
average
function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); }
/** * @dev Returns the average of two numbers. The result is rounded towards * zero. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 491, 689 ] }
15,708
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Arrays
library Arrays { /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). ...
/** * @dev Collection of functions related to array types. */
NatSpecMultiLine
findUpperBound
function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { if (array.length == 0) { return 0; } uint256 low = 0; uint256 high = array.length; while (low < high) { uint256 mid = Math.average(low, high); // Note that mid wi...
/** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * `array` is expected to be sorted in...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 438, 1361 ] }
15,709
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Snapshot
abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using Arrays for uint256[]; using Counters for Counters.Counter; /...
/** * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive ...
NatSpecMultiLine
_snapshot
function _snapshot() internal virtual returns (uint256) { _currentSnapshotId.increment(); uint256 currentId = _currentSnapshotId.current(); emit Snapshot(currentId); return currentId; }
/** * @dev Creates a new snapshot and returns its snapshot id. * * Emits a {Snapshot} event that contains the same id. * * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a * set of accounts, for example using {AccessControl}, or it may be open to...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2129, 2362 ] }
15,710
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Snapshot
abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using Arrays for uint256[]; using Counters for Counters.Counter; /...
/** * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive ...
NatSpecMultiLine
balanceOfAt
function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]); return snapshotted ? value : balanceOf(account); }
/** * @dev Retrieves the balance of `account` at the time `snapshotId` was created. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2469, 2740 ] }
15,711
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Snapshot
abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using Arrays for uint256[]; using Counters for Counters.Counter; /...
/** * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive ...
NatSpecMultiLine
totalSupplyAt
function totalSupplyAt(uint256 snapshotId) public view virtual returns(uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots); return snapshotted ? value : totalSupply(); }
/** * @dev Retrieves the total supply at the time `snapshotId` was created. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2839, 3077 ] }
15,712
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Snapshot
abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using Arrays for uint256[]; using Counters for Counters.Counter; /...
/** * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive ...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); if (from == address(0)) { // mint _updateAccountSnapshot(to); _updateTotalSupplySnapshot(); } else if (to == address(0)) { // burn _update...
// Update balance and/or total supply snapshots before the values are modified. This is implemented // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.
LineComment
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 3291, 3838 ] }
15,713
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC165
abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
/** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interface...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 103, 265 ] }
15,714
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1953, 2175 ] }
15,715
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
hasRole
function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; }
/** * @dev Returns `true` if `account` has been granted `role`. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2262, 2406 ] }
15,716
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
_checkRole
function _checkRole(bytes32 role, address account) internal view { if(!hasRole(role, account)) { revert(string(abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role),...
/** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2691, 3080 ] }
15,717
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
getRoleAdmin
function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; }
/** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 3264, 3392 ] }
15,718
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
grantRole
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); }
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 3649, 3801 ] }
15,719
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
revokeRole
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); }
/** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 4041, 4195 ] }
15,720
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
renounceRole
function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); }
/** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 4697, 4920 ] }
15,721
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
_setupRole
function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); }
/** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor w...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 5498, 5615 ] }
15,722
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
AccessControl
abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `...
/** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for t...
NatSpecMultiLine
_setRoleAdmin
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; }
/** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 5742, 5942 ] }
15,723
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Pausable
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** ...
/** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your co...
NatSpecMultiLine
paused
function paused() public view virtual returns (bool) { return _paused; }
/** * @dev Returns true if the contract is paused, and false otherwise. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 531, 622 ] }
15,724
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Pausable
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** ...
/** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your co...
NatSpecMultiLine
_pause
function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); }
/** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1331, 1454 ] }
15,725
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
Pausable
abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** ...
/** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your co...
NatSpecMultiLine
_unpause
function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); }
/** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1590, 1715 ] }
15,726
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
IERC20Permit
interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event...
/** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed b...
NatSpecMultiLine
permit
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
/** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the ...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 844, 970 ] }
15,727
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
IERC20Permit
interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event...
/** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed b...
NatSpecMultiLine
nonces
function nonces(address owner) external view returns (uint256);
/** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1279, 1347 ] }
15,728
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
IERC20Permit
interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event...
/** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed b...
NatSpecMultiLine
DOMAIN_SEPARATOR
function DOMAIN_SEPARATOR() external view returns (bytes32);
// solhint-disable-next-line func-name-mixedcase
LineComment
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1540, 1605 ] }
15,729
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
EIP712
abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARAT...
/** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols ...
NatSpecMultiLine
_domainSeparatorV4
function _domainSeparatorV4() internal view returns (bytes32) { if (block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } }
/** * @dev Returns the domain separator for the current chain. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1777, 2063 ] }
15,730
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
EIP712
abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARAT...
/** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols ...
NatSpecMultiLine
_hashTypedDataV4
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); }
/** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```sol...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 3045, 3217 ] }
15,731
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ECDSA
library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the ...
/** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */
NatSpecMultiLine
recover
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eip...
/** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half ord...
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 811, 2308 ] }
15,732
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ECDSA
library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the ...
/** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */
NatSpecMultiLine
recover
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), de...
/** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2442, 3876 ] }
15,733
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ECDSA
library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the ...
/** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */
NatSpecMultiLine
toEthSignedMessageHash
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); }
/** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 4171, 4445 ] }
15,734
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ECDSA
library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the ...
/** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */
NatSpecMultiLine
toTypedDataHash
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); }
/** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 4790, 4991 ] }
15,735
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping (address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
permit
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override { // solhint-disable-next-line not-rely-on-time require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256( abi.enc...
/** * @dev See {IERC20Permit-permit}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 726, 1502 ] }
15,736
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping (address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
nonces
function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); }
/** * @dev See {IERC20Permit-nonces}. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1563, 1696 ] }
15,737
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping (address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
DOMAIN_SEPARATOR
function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); }
// solhint-disable-next-line func-name-mixedcase
LineComment
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 1821, 1941 ] }
15,738
CMKToken
CMKToken.sol
0x68cfb82eacb9f198d508b514d898a403c449533e
Solidity
ERC20Permit
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping (address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,...
/** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message sig...
NatSpecMultiLine
_useNonce
function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); }
/** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
MIT
ipfs://a98d9eb8541d9b91fc6d74ffd2ae2be42ebcaf311c8a877d6f545c1d7282eb9e
{ "func_code_index": [ 2074, 2286 ] }
15,739
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Utils
contract Utils { /** constructor */ function Utils() internal { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different t...
Utils
function Utils() internal { }
/** constructor */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 56, 95 ] }
15,740
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Utils
contract Utils { /** constructor */ function Utils() internal { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different t...
safeAdd
function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x + _y; assert(z >= _x); return z; }
/** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 680, 841 ] }
15,741
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Utils
contract Utils { /** constructor */ function Utils() internal { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different t...
safeSub
function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) { assert(_x >= _y); return _x - _y; }
/** @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 1063, 1201 ] }
15,742
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Utils
contract Utils { /** constructor */ function Utils() internal { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different t...
safeMul
function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x * _y; assert(_x == 0 || z / _x == _y); return z; }
/** @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 1406, 1583 ] }
15,743
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
IERC20Token
contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string) { name; } function symbol() public constant returns (string) { symbol; } function decimals() public constant return...
/* ERC20 Standard Token interface */
Comment
name
function name() public constant returns (string) { name; }
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
LineComment
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 142, 205 ] }
15,744
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
StandardERC20Token
contract StandardERC20Token is IERC20Token, Utils { string public name = ""; string public symbol = ""; uint8 public decimals = 0; uint256 public totalSupply = 0; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event...
/** ERC20 Standard Token implementation */
NatSpecMultiLine
StandardERC20Token
function StandardERC20Token(string _name, string _symbol, uint8 _decimals) public{ require(bytes(_name).length > 0 && bytes(_symbol).length > 0); // validate input name = _name; symbol = _symbol; decimals = _decimals; }
/** @dev constructor @param _name token name @param _symbol token symbol @param _decimals decimal points, for display purposes */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 682, 949 ] }
15,745
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
StandardERC20Token
contract StandardERC20Token is IERC20Token, Utils { string public name = ""; string public symbol = ""; uint8 public decimals = 0; uint256 public totalSupply = 0; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event...
/** ERC20 Standard Token implementation */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public validAddress(_to) returns (bool success) { require(balanceOf[msg.sender] >= _value && _value > 0); balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], _value); balanceOf[_to] = safeAdd(balanceOf[_to], _value); Transfer(msg.send...
/** @dev send coins throws on any error rather then return a false flag to minimize user errors @param _to target address @param _value transfer amount @return true if the transfer was successful, false if it wasn't */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 1488, 1891 ] }
15,746
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
StandardERC20Token
contract StandardERC20Token is IERC20Token, Utils { string public name = ""; string public symbol = ""; uint8 public decimals = 0; uint256 public totalSupply = 0; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event...
/** ERC20 Standard Token implementation */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public validAddress(_from) validAddress(_to) returns (bool success) { require(balanceOf[_from] >= _value && _value > 0); require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] = safeSub(allowance...
/** @dev an account/contract attempts to get the coins throws on any error rather then return a false flag to minimize user errors @param _from source address @param _to target address @param _value transfer amount @return true if the transfer was successful, false if it wasn't */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 2254, 2830 ] }
15,747
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
StandardERC20Token
contract StandardERC20Token is IERC20Token, Utils { string public name = ""; string public symbol = ""; uint8 public decimals = 0; uint256 public totalSupply = 0; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event...
/** ERC20 Standard Token implementation */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public validAddress(_spender) returns (bool success) { // if the allowance isn't 0, it can only be updated to 0 to prevent an allowance change immediately after withdrawal require(_value == 0 || allowance[msg.sender][_spender] == 0); al...
/** @dev allow another account/contract to spend some tokens on your behalf throws on any error rather then return a false flag to minimize user errors also, to minimize the risk of the approve/transferFrom attack vector (see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/), ...
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 3510, 3980 ] }
15,748
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
IOwned
contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public constant returns (address) { owner; } function transferOwnership(address _newOwner) public; function acceptOwnership() public; }
/* Owned contract interface */
Comment
owner
function owner() public constant returns (address) { owner; }
// this function isn't abstract since the compiler emits automatically generated getter functions as external
LineComment
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 134, 200 ] }
15,749
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Owned
contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() public { owner = msg.sender; } // allows execution by the owner only modifier ...
/* Provides support and utilities for contract ownership */
Comment
Owned
function Owned() public { owner = msg.sender; }
/** @dev constructor */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 195, 261 ] }
15,750
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Owned
contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() public { owner = msg.sender; } // allows execution by the owner only modifier ...
/* Provides support and utilities for contract ownership */
Comment
transferOwnership
function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; }
/** @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 624, 769 ] }
15,751
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
Owned
contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() public { owner = msg.sender; } // allows execution by the owner only modifier ...
/* Provides support and utilities for contract ownership */
Comment
acceptOwnership
function acceptOwnership() public { require(msg.sender == newOwner); OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = 0x0; }
/** @dev used by a new owner to accept an ownership transfer */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 855, 1035 ] }
15,752
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
YOOBAToken
function YOOBAToken(address _airdropAddress, address _ecosystemAddress, address _backupAddress, address _yoobaTeamAddress,address _earlyCommunityAddress) StandardERC20Token("Yooba token", "YOO", 18) public { airdropAddress = _airdropAddress; yoobaTeamAddress = _yoobaTeamAddress; ecosystemAddress = _ec...
/** @dev constructor */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 2260, 2752 ] }
15,753
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
initAirdropAndEarlyAlloc
function initAirdropAndEarlyAlloc() public ownerOnly stoppable returns(bool success){ require(!isInitAirdropAndEarlyAlloc); require(airdropAddress != 0x0 && earlyCommunityAddress != 0x0); require((currentSupply + earlyCommunitySupply + airdropSupply) <= totalSupply); balanceOf[earlyCommunityAddres...
/** @dev the tokens at the airdropAddress will be airdroped before 2018.12.31 */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 2875, 3598 ] }
15,754
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
transfer
function transfer(address _to, uint256 _value) public stoppable returns (bool success) { return super.transfer(_to, _value); }
/** @dev send tokens throws on any error rather then return a false flag to minimize user errors in addition to the standard checks, the function throws if transfers are disabled @param _to target address @param _value transfer amount @return true if the transfer was successful, throws if it wa...
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 3987, 4132 ] }
15,755
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public stoppable returns (bool success) { return super.transferFrom(_from, _to, _value); }
/** @dev throws on any error rather then return a false flag to minimize user errors in addition to the standard checks, the function throws if transfers are disabled @param _from source address @param _to target address @param _value transfer amount @return true if the transfer was succe...
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 4542, 4721 ] }
15,756
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
releaseForEcosystem
function releaseForEcosystem() public ownerOnly stoppable returns(bool success) { require(now >= createTime + 12 weeks); require(tokensReleasedToEcosystem < ecosystemSupply); uint256 temp = ecosystemSupply / 10000; uint256 allocAmount = safeMul(temp, 625); uint256 currentTranche = uint256(n...
/** @dev Release one tranche of the ecosystemSupply allocation to Yooba team,6.25% every tranche.About 4 years ecosystemSupply release over. @return true if successful, throws if not */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 4950, 5866 ] }
15,757
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
releaseForYoobaTeam
function releaseForYoobaTeam() public ownerOnly stoppable returns(bool success) { require(now >= createTime + 12 weeks); require(tokensReleasedToTeam < teamSupply); uint256 temp = teamSupply / 10000; uint256 allocAmount = safeMul(temp, 625); uint256 currentTranche = uint256(now - createTime...
/** @dev Release one tranche of the teamSupply allocation to Yooba team,6.25% every tranche.About 4 years Yooba team will get teamSupply Tokens. @return true if successful, throws if not */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 6104, 6979 ] }
15,758
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
releaseForIco
function releaseForIco(address _icoAddress, uint256 _value) public ownerOnly stoppable returns(bool success) { require(_icoAddress != address(0x0) && _value > 0 && (tokensReleasedToIco + _value) <= icoReservedSupply && (currentSupply + _value) <= totalSupply); balanceOf[_icoAddress] = safeAdd(balanceOf[...
/** @dev release ico Tokens @return true if successful, throws if not */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 7100, 7610 ] }
15,759
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
releaseForEarlyInvestor
function releaseForEarlyInvestor(address _investorAddress, uint256 _value) public ownerOnly stoppable returns(bool success) { require(_investorAddress != address(0x0) && _value > 0 && (tokensReleasedToEarlyInvestor + _value) <= earlyInvestorSupply && (currentSupply + _value) <= totalSupply); balanceOf...
/** @dev release earlyInvestor Tokens @return true if successful, throws if not */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 7732, 8301 ] }
15,760
YOOBAToken
YOOBAToken.sol
0x1d4105534da120da243281cfc3f26aaf038e2d6f
Solidity
YOOBAToken
contract YOOBAToken is StandardERC20Token, Owned,YooStop { uint256 constant public YOO_UNIT = 10 ** 18; uint256 public totalSupply = 100 * (10**8) * YOO_UNIT; // Constants uint256 constant public airdropSupply = 20 * 10**8 * YOO_UNIT; uint256 constant public earlyInvestorSu...
processWhenStop
function processWhenStop() public ownerOnly returns(bool success) { require(currentSupply <= totalSupply && stopped); balanceOf[backupAddress] += (totalSupply - currentSupply); currentSupply = totalSupply; Transfer(0x0, backupAddress, (totalSupply - currentSupply)); return true; }
/** @dev This only run for urgent situation.Or Yooba mainnet is run well and all tokens release over. @return true if successful, throws if not */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://36cacabf707cca6d28db68feb5d2fa867dcb9762f3862cd7472ca6327db4f446
{ "func_code_index": [ 8478, 8817 ] }
15,761
PolkalokrToken
/C/projects/lokr/lkr-token/contracts/fair-launch/ILocker.sol
0xcd4e9b3c016257fc4b0cb66e7586e8881d7086ae
Solidity
ILocker
interface ILocker { /** * @dev Fails if transaction is not allowed. Otherwise returns the penalty. * @return a bool and a uint256, bool clarifying the penalty applied, and uint256 the penaltyOver1000 */ function lockOrGetPenalty(address source, address dest) external returns (bool, uint256);...
lockOrGetPenalty
function lockOrGetPenalty(address source, address dest) external returns (bool, uint256);
/** * @dev Fails if transaction is not allowed. Otherwise returns the penalty. * @return a bool and a uint256, bool clarifying the penalty applied, and uint256 the penaltyOver1000 */
NatSpecMultiLine
v0.7.6+commit.7338295f
{ "func_code_index": [ 227, 321 ] }
15,762
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
IMigratorChef
interface IMigratorChef { // Perform LP token migration from legacy UniswapV2 to LessSwap. // Take the current LP token address and return the new LP token address. // Migrator should have full access to the caller's LP token. // Return the new LP token address. // // XXX Migrator must have allo...
migrate
function migrate(IERC20 token) external returns (IERC20);
// Perform LP token migration from legacy UniswapV2 to LessSwap. // Take the current LP token address and return the new LP token address. // Migrator should have full access to the caller's LP token. // Return the new LP token address. // // XXX Migrator must have allowance access to UniswapV2 LP tokens. // LessSwap m...
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 532, 593 ] }
15,763
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
add
function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); p...
// Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 3065, 3667 ] }
15,764
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
set
function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add( _allocPoint ); poolInfo[_pid].allocPoint = _allocPoint; }
// Update the given pool's xLESS allocation point. Can only be called by the owner.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 3757, 4111 ] }
15,765
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
setMigrator
function setMigrator(IMigratorChef _migrator) public onlyOwner { migrator = _migrator; }
// Set the migrator contract. Can only be called by the owner.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 4444, 4548 ] }
15,766
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
migrate
function migrate(uint256 _pid) public { require(address(migrator) != address(0), "migrate: no migrator"); PoolInfo storage pool = poolInfo[_pid]; IERC20 lpToken = pool.lpToken; uint256 bal = lpToken.balanceOf(address(this)); lpToken.safeApprove(address(migrator), bal); IERC20 newLpToken = migrat...
// Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 4664, 5150 ] }
15,767
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
getMultiplier
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { if (_to <= bonusEndBlock) { return _to.sub(_from).mul(BONUS_MULTIPLIER); } else if (_from >= bonusEndBlock) { return _to.sub(_from); } else { return bonusEndBlock.sub(_from).mul...
// Return reward multiplier over the given _from to _to block.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 5219, 5688 ] }
15,768
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
pendingXLess
function pendingXLess(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accXLessPerShare = pool.accXLessPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (bloc...
// View function to see pending xLESSs on frontend.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 5746, 6662 ] }
15,769
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
massUpdatePools
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
// Update reward vairables for all pools. Be careful of gas spending!
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 6738, 6917 ] }
15,770
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
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; } uint2...
// Update reward variables of the given pool to be up-to-date.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 6986, 7825 ] }
15,771
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
deposit
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user .amount .mul(pool.accXLessPerShare) .div(1e12) ...
// Deposit LP tokens to MasterChef for xLESS allocation.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 7888, 8653 ] }
15,772
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
withdraw
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accXLessPerShare).div(1e12).sub( ...
// Withdraw LP tokens from MasterChef.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 8698, 9368 ] }
15,773
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
emergencyWithdraw
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; pool.lpToken.safeTransfer(address(msg.sender), user.amount); emit EmergencyWithdraw(msg.sender, _pid, user.amount); user.amount = 0; user.rewardDebt = 0; ...
// Withdraw without caring about rewards. EMERGENCY ONLY.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 9432, 9785 ] }
15,774
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
safeXLessTransfer
function safeXLessTransfer(address _to, uint256 _amount) internal { uint256 xlessBal = xless.balanceOf(address(this)); if (_amount > xlessBal) { xless.transfer(_to, xlessBal); } else { xless.transfer(_to, _amount); } }
// Safe xless transfer function, just in case if rounding error causes pool to not have enough xLESSs.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 9894, 10176 ] }
15,775
MasterChef
/Volumes/Data/Projects/Less/lessswap-contracts/contracts/MasterChef.sol
0x0cab43bd1f6f34220feed5bdc72dd0b09c5701a1
Solidity
MasterChef
contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy ...
// MasterChef is the master of xLess. He can make xLess and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once xLESS is sufficiently // distributed and the community can show to govern itself. // // Have fun read...
LineComment
dev
function dev(address _devaddr) public { require(msg.sender == devaddr, "dev: wut?"); devaddr = _devaddr; }
// Update dev address by the previous dev.
LineComment
v0.6.12+commit.27d51765
{ "func_code_index": [ 10225, 10355 ] }
15,776
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
function() public payable { revert(); }
/** * @dev This contract does not accept ETH */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 728, 786 ] }
15,777
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return totalSupply; }
// ---- ERC20 START ----
LineComment
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 819, 914 ] }
15,778
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
approve
function approve(address spender, uint256 value) public returns (bool) { allowed[msg.sender][spender] = value; Approval(msg.sender, spender, value); return true; }
/** * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * ...
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 1708, 1908 ] }
15,779
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
increaseApproval
function increaseApproval(address spender, uint256 addedValue) public returns (bool success) { allowed[msg.sender][spender] = safeAdd(allowed[msg.sender][spender], addedValue); Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; }
/** * @dev Increase the amount of tokens that an owner allowed to a spender. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 2572, 2861 ] }
15,780
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
decreaseApproval
function decreaseApproval(address spender, uint256 subtractedValue) public returns (bool success) { uint256 oldValue = allowed[msg.sender][spender]; if (subtractedValue > oldValue) { allowed[msg.sender][spender] = 0; } else { allowed[msg.sender][spender] = safeSub(oldValue, subtractedVa...
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 2961, 3423 ] }
15,781
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
transferArray
function transferArray(address[] tos, uint256[] values) public returns (bool) { for (uint8 i = 0; i < tos.length; i++) { require(transfer(tos[i], values[i])); } return true; }
/** * @dev Same functionality as transfer. Accepts an array of recipients and values. Can be used to save gas. * @dev both arrays requires to have the same length */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 3619, 3846 ] }
15,782
MilcToken
MilcToken.sol
0xd717b75404022fb1c8582adf1c66b9a553811754
Solidity
MilcToken
contract MilcToken is ERC20Interface, Ownable, SafeMath { /** * Max Tokens: 40 Millions MILC with 18 Decimals. * The smallest unit is called "Hey". 1'000'000'000'000'000'000 Hey = 1 MILC */ uint256 constant public MAX_TOKENS = 40 * 1000 * 1000 * 10 ** uint256(18); string public symbol ...
/** * @title The MILC Token Contract * * @dev The MILC Token is an ERC20 Token * @dev https://github.com/ethereum/EIPs/issues/20 */
NatSpecMultiLine
mint
function mint(address[] recipients, uint256[] tokens) public returns (bool) { require(msg.sender == owner); for (uint8 i = 0; i < recipients.length; i++) { address recipient = recipients[i]; uint256 token = tokens[i]; totalSupply = safeAdd(totalSupply, token); require...
/** * @dev Bulk mint function to save gas. * @dev both arrays requires to have the same length */
NatSpecMultiLine
v0.4.18+commit.9cf6e910
bzzr://33db21044de8a4e909beb5af473d9f7b7ca05db05aa40206733593b41a62bc8d
{ "func_code_index": [ 4045, 4630 ] }
15,783
OasisMakerBroker
contracts/market-making/OasisMakerBroker.sol
0x6ce73a96a957408e72322823ee848ddd90c01424
Solidity
OasisMakerBroker
contract OasisMakerBroker is MakerBrokerBase { Oasis public oasis; address public loopringProtocol; constructor(address _loopringProtocol, address _oasis) public { oasis = Oasis(_oasis); loopringProtocol = _loopringProtocol; } function setLoopringProtocol(address _loopringProtocol) extern...
/* * Inherits Loopring's IBrokerDelegate and sources liquidity from Oasis * when the Loopring protocol requests a token approval. Because the Loopring * protocol expects the taker order to precede maker orders, and non-brokered * transfers occur before before brokered transfers, it is guaranteed that this * b...
Comment
enableToken
function enableToken(address token) external { ERC20(token).approve(address(loopringProtocol), 10 ** 70); ERC20(token).approve(address(oasis), 10 ** 70); }
// -------------------------------- // Loopring Broker Delegate
LineComment
v0.5.7+commit.6da8b019
None
bzzr://3e40bc8508abb0c2a6a372b5aaac4f0f46d48907a244beaa87b4d02ebbe19216
{ "func_code_index": [ 551, 722 ] }
15,784
OasisMakerBroker
contracts/market-making/OasisMakerBroker.sol
0x6ce73a96a957408e72322823ee848ddd90c01424
Solidity
OasisMakerBroker
contract OasisMakerBroker is MakerBrokerBase { Oasis public oasis; address public loopringProtocol; constructor(address _loopringProtocol, address _oasis) public { oasis = Oasis(_oasis); loopringProtocol = _loopringProtocol; } function setLoopringProtocol(address _loopringProtocol) extern...
/* * Inherits Loopring's IBrokerDelegate and sources liquidity from Oasis * when the Loopring protocol requests a token approval. Because the Loopring * protocol expects the taker order to precede maker orders, and non-brokered * transfers occur before before brokered transfers, it is guaranteed that this * b...
Comment
brokerRequestAllowance
function brokerRequestAllowance(BrokerData.BrokerApprovalRequest memory request) public returns (bool) { require(msg.sender == loopringProtocol, "Oasis MakerBroker: Unauthorized caller"); require(request.totalRequestedFeeAmount == 0, "Oasis MakerBroker: Cannot be charged a fee"); for (uint i = 0; i < request...
// --------------------------------
LineComment
v0.5.7+commit.6da8b019
None
bzzr://3e40bc8508abb0c2a6a372b5aaac4f0f46d48907a244beaa87b4d02ebbe19216
{ "func_code_index": [ 1046, 2094 ] }
15,785
OasisMakerBroker
contracts/market-making/OasisMakerBroker.sol
0x6ce73a96a957408e72322823ee848ddd90c01424
Solidity
OasisMakerBroker
contract OasisMakerBroker is MakerBrokerBase { Oasis public oasis; address public loopringProtocol; constructor(address _loopringProtocol, address _oasis) public { oasis = Oasis(_oasis); loopringProtocol = _loopringProtocol; } function setLoopringProtocol(address _loopringProtocol) extern...
/* * Inherits Loopring's IBrokerDelegate and sources liquidity from Oasis * when the Loopring protocol requests a token approval. Because the Loopring * protocol expects the taker order to precede maker orders, and non-brokered * transfers occur before before brokered transfers, it is guaranteed that this * b...
Comment
brokerBalanceOf
function brokerBalanceOf(address owner, address tokenAddress) public view returns (uint) { return 10 ** 70; }
/* * Balance is unknown as it is entirely dependent on the offer in Oasis being filled. * Thus we send down a very large number to ensure the relayer/matching engine believes * orders from this broker have enough WETH/DAI to be filled */
Comment
v0.5.7+commit.6da8b019
None
bzzr://3e40bc8508abb0c2a6a372b5aaac4f0f46d48907a244beaa87b4d02ebbe19216
{ "func_code_index": [ 2473, 2593 ] }
15,786
JGOToken
JGOToken.sol
0x1dbd84f903a81018ec2cc47a63f456cb756efbbc
Solidity
Token
contract Token { uint256 public totalSupply; //代币总量 function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function ap...
balanceOf
function balanceOf(address _owner) constant returns (uint256 balance);
//代币总量
LineComment
v0.4.21+commit.dfe3193c
MIT
bzzr://45e4f4b9b6a8847bf09735bbf4965d0cfee7b755a67806f5c866bb5aa2f75020
{ "func_code_index": [ 58, 133 ] }
15,787
JGOToken
JGOToken.sol
0x1dbd84f903a81018ec2cc47a63f456cb756efbbc
Solidity
JGOToken
contract JGOToken is StandardToken, SafeMath { string public constant name = "Aunt Token"; //名称 string public constant symbol = "YFIH"; //符号 uint256 public constant decimals = 6; //小数位 string public version = "1.0"; //版本 address public ethFundDeposit; ...
//JGO代币合约
LineComment
JGOToken
function JGOToken(address _ethFundDeposit, uint256 _totalSupply) { ethFundDeposit = _ethFundDeposit; currentSupply = formatDecimals(_totalSupply); //当前供应量 totalSupply = formatDecimals(_totalSupply); //代币总量 balances[msg.sender] = totalSupply; if(currentSupply > totalS...
//JGO合约初始化函数(合约所有人地址, 当前供应量, 代币总量)
LineComment
v0.4.21+commit.dfe3193c
MIT
bzzr://45e4f4b9b6a8847bf09735bbf4965d0cfee7b755a67806f5c866bb5aa2f75020
{ "func_code_index": [ 637, 1002 ] }
15,788
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
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); /**...
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 94, 154 ] }
15,789
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
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); /**...
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 237, 310 ] }
15,790
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
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); /**...
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
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 534, 616 ] }
15,791
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
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); /**...
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
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 895, 983 ] }
15,792
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
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); /**...
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
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 1647, 1726 ] }
15,793
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
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); /**...
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
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 2039, 2141 ] }
15,794
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 259, 445 ] }
15,795
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 723, 864 ] }
15,796
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 1162, 1359 ] }
15,797
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.6+commit.6c089d02
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 1613, 2089 ] }
15,798
YFIALPHA
YFIALPHA.sol
0xca959514b07e93bc80d5377d7f8ac820eaa934ef
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
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
MIT
ipfs://5e06734668028202cb4ea12a315927a49c8fcad873c196dd5cd5ced7ddce8c1f
{ "func_code_index": [ 2560, 2697 ] }
15,799