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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Token | Token.sol | 0x80f7415dac9a37e168047eb56a25032b5fe216cc | Solidity | Token | contract Token is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "PBN";
string public name = "Pluton Blogging Network";
uint256 public decimals = 18;
uint256 _totalSupply = 300000 * 10 ** (decimals);
uint256 _deployedOn;
mapping(address => uint256) ba... | // ----------------------------------------------------------------------------
// 'Pluton Blogging Network' token contract
// Symbol : PBN
// Name : Pluton Blogging Network
// Total supply: 300,000
// Decimals : 18
// ----------------------------------------------------------------------------
// ------... | LineComment | approve | function approve(address spender, uint256 tokens) public override returns (bool success){
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender,spender,tokens);
return true;
}
| // ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------ | LineComment | v0.6.12+commit.27d51765 | Unlicense | ipfs://64ff669035616ec25e84335e569a4c39206ec846ce81363f22c6aeaca74651a4 | {
"func_code_index": [
2664,
2886
]
} | 14,600 |
Token | Token.sol | 0x80f7415dac9a37e168047eb56a25032b5fe216cc | Solidity | Token | contract Token is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "PBN";
string public name = "Pluton Blogging Network";
uint256 public decimals = 18;
uint256 _totalSupply = 300000 * 10 ** (decimals);
uint256 _deployedOn;
mapping(address => uint256) ba... | // ----------------------------------------------------------------------------
// 'Pluton Blogging Network' token contract
// Symbol : PBN
// Name : Pluton Blogging Network
// Total supply: 300,000
// Decimals : 18
// ----------------------------------------------------------------------------
// ------... | LineComment | transferFrom | function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(balances[from] >= tokens);
if ((from == owner) && (balances[from].sub(tokens) < 50000 * 10 ** decimals)){
require(no... | // ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer... | LineComment | v0.6.12+commit.27d51765 | Unlicense | ipfs://64ff669035616ec25e84335e569a4c39206ec846ce81363f22c6aeaca74651a4 | {
"func_code_index": [
3422,
4109
]
} | 14,601 |
Token | Token.sol | 0x80f7415dac9a37e168047eb56a25032b5fe216cc | Solidity | Token | contract Token is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol = "PBN";
string public name = "Pluton Blogging Network";
uint256 public decimals = 18;
uint256 _totalSupply = 300000 * 10 ** (decimals);
uint256 _deployedOn;
mapping(address => uint256) ba... | // ----------------------------------------------------------------------------
// 'Pluton Blogging Network' token contract
// Symbol : PBN
// Name : Pluton Blogging Network
// Total supply: 300,000
// Decimals : 18
// ----------------------------------------------------------------------------
// ------... | LineComment | allowance | function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
return allowed[tokenOwner][spender];
}
| // ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------ | LineComment | v0.6.12+commit.27d51765 | Unlicense | ipfs://64ff669035616ec25e84335e569a4c39206ec846ce81363f22c6aeaca74651a4 | {
"func_code_index": [
4395,
4559
]
} | 14,602 |
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _tokenCounts[owner];
}
| /**
* @dev See {IERC721-balanceOf}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2824,
3029
]
} | 14,603 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | ownerOf | function ownerOf(uint256 tokenId) public view override returns (address) {
return _tokenOwners[tokenId];
}
| /**
* @dev See {IERC721-ownerOf}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3082,
3204
]
} | 14,604 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | name | function name() public view override returns (string memory) {
return _name;
}
| /**
* @dev See {IERC721Metadata-name}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3262,
3356
]
} | 14,605 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | symbol | function symbol() public view override returns (string memory) {
return _symbol;
}
| /**
* @dev See {IERC721Metadata-symbol}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3416,
3514
]
} | 14,606 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | tokenURI | function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
// If there is no base URI, return the token URI.
if (bytes(_baseURI).length == 0) {
re... | /**
* @dev See {IERC721Metadata-tokenURI}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3576,
4320
]
} | 14,607 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | baseURI | function baseURI() public view returns (string memory) {
return _baseURI;
}
| /**
* @dev Returns the base URI set via {_setBaseURI}. This will be
* automatically added as a prefix in {tokenURI} to each token's URI, or
* to the token ID if no specific URI is set for that token ID.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4548,
4639
]
} | 14,608 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | approve | function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
... | /**
* @dev See {IERC721-approve}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4692,
5077
]
} | 14,609 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | getApproved | function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
| /**
* @dev See {IERC721-getApproved}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5134,
5347
]
} | 14,610 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | setApprovalForAll | function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
| /**
* @dev See {IERC721-setApprovalForAll}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5410,
5704
]
} | 14,611 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | isApprovedForAll | function isApprovedForAll(address owner, address operator) public view override returns (bool) {
return _operatorApprovals[owner][operator];
}
| /**
* @dev See {IERC721-isApprovedForAll}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5766,
5924
]
} | 14,612 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
| /**
* @dev See {IERC721-transferFrom}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
5982,
6286
]
} | 14,613 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | safeTransferFrom | function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
| /**
* @dev See {IERC721-safeTransferFrom}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
6348,
6501
]
} | 14,614 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | safeTransferFrom | function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
| /**
* @dev See {IERC721-safeTransferFrom}.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
6563,
6849
]
} | 14,615 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _safeTransfer | function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
| /**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivale... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
7707,
7980
]
} | 14,616 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _exists | function _exists(uint256 tokenId) internal view returns (bool) {
return _tokenOwners[tokenId] != address(0);
}
| /**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8279,
8405
]
} | 14,617 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _isApprovedOrOwner | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
| /**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
8559,
8892
]
} | 14,618 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _safeMint | function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
| /**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
d*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9219,
9331
]
} | 14,619 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _safeMint | function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
| /**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
9548,
9799
]
} | 14,620 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _mint | function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_tokenCounts[to] = _tokenCounts[to].add(1);
_tokenOwners[tokenId... | /**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
10117,
10523
]
} | 14,621 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _burn | function _burn(uint256 tokenId) internal virtual {
address owner = ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
// Clear metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];... | /**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
10736,
11254
]
} | 14,622 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _transfer | function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previ... | /**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
11574,
12157
]
} | 14,623 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _setTokenURI | function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
| /**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
12300,
12516
]
} | 14,624 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _setBaseURI | function _setBaseURI(string memory baseURI_) internal virtual {
_baseURI = baseURI_;
}
| /**
* @dev Internal function to set the base URI for all token IDs. It is
* automatically added as a prefix to the value returned in {tokenURI},
* or to the token ID if {tokenURI} is empty.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
12735,
12837
]
} | 14,625 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _checkOnERC721Received | function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes memory returndata = to.functionCall(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSend... | /**
* @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 tokenId ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
13386,
13979
]
} | 14,626 | ||
ERC721Ownable | contracts/external/openzeppelin/ERC721.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | ERC721 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using SafeMath for uint256;
using Address for address;
using Strings for uint256;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.... | /**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721.
*
* NOTE: This is a modified version of the OpenZeppelin ERC721 contract. ERC721Enumerable has been removed.
*
*/ | NatSpecMultiLine | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
| /**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
14732,
14829
]
} | 14,627 | ||
CoinCrowdExchangeRates | CoinCrowdExchangeRates.sol | 0xaf0e27602eaa73fdf4849806d75bdfc77fb95217 | 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() internal {
owner = msg.sender;
}... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | Ownable | function Ownable() internal {
owner = msg.sender;
}
| /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.20+commit.3155dd80 | bzzr://4daf46bbcf273c0decaa00b7df65cb44ffd4a2c1a667a7476fe9eb4b8b467133 | {
"func_code_index": [
259,
321
]
} | 14,628 | |
CoinCrowdExchangeRates | CoinCrowdExchangeRates.sol | 0xaf0e27602eaa73fdf4849806d75bdfc77fb95217 | 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() internal {
owner = msg.sender;
}... | /**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/ | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) onlyOwner public {
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.20+commit.3155dd80 | bzzr://4daf46bbcf273c0decaa00b7df65cb44ffd4a2c1a667a7476fe9eb4b8b467133 | {
"func_code_index": [
640,
816
]
} | 14,629 | |
CoinCrowdExchangeRates | CoinCrowdExchangeRates.sol | 0xaf0e27602eaa73fdf4849806d75bdfc77fb95217 | Solidity | Authorizable | contract Authorizable is Ownable {
mapping(address => bool) public authorized;
event AuthorizationSet(address indexed addressAuthorized, bool indexed authorization);
/**
* @dev The Authorizable constructor sets the first `authorized` of the contract to the sender
* account.
*/
function Au... | /**
* @title Authorizable
* @dev The Authorizable contract has authorized addresses, and provides basic authorization control
* functions, this simplifies the implementation of "multiple user permissions".
*/ | NatSpecMultiLine | Authorizable | function Authorizable() public {
uthorized[msg.sender] = true;
}
| /**
* @dev The Authorizable constructor sets the first `authorized` of the contract to the sender
* account.
*/ | NatSpecMultiLine | v0.4.20+commit.3155dd80 | bzzr://4daf46bbcf273c0decaa00b7df65cb44ffd4a2c1a667a7476fe9eb4b8b467133 | {
"func_code_index": [
307,
380
]
} | 14,630 | |
CoinCrowdExchangeRates | CoinCrowdExchangeRates.sol | 0xaf0e27602eaa73fdf4849806d75bdfc77fb95217 | Solidity | Authorizable | contract Authorizable is Ownable {
mapping(address => bool) public authorized;
event AuthorizationSet(address indexed addressAuthorized, bool indexed authorization);
/**
* @dev The Authorizable constructor sets the first `authorized` of the contract to the sender
* account.
*/
function Au... | /**
* @title Authorizable
* @dev The Authorizable contract has authorized addresses, and provides basic authorization control
* functions, this simplifies the implementation of "multiple user permissions".
*/ | NatSpecMultiLine | setAuthorized | function setAuthorized(address addressAuthorized, bool authorization) onlyOwner public {
AuthorizationSet(addressAuthorized, authorization);
authorized[addressAuthorized] = authorization;
}
| /**
* @dev Allows the current owner to set an authorization.
* @param addressAuthorized The address to change authorization.
*/ | NatSpecMultiLine | v0.4.20+commit.3155dd80 | bzzr://4daf46bbcf273c0decaa00b7df65cb44ffd4a2c1a667a7476fe9eb4b8b467133 | {
"func_code_index": [
693,
898
]
} | 14,631 | |
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | executeCalls | function executeCalls(Call[] calldata calls) external returns (bytes[] memory) {
bytes[] memory response = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
response[i] = _executeCall(calls[i].to, calls[i].value, calls[i].data);
}
return response;
}
| /// @notice Executes calls on behalf of this contract.
/// @param calls The array of calls to be executed.
/// @return An array of the return values for each of the calls | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1149,
1446
]
} | 14,632 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | transferEther | function transferEther(address payable to, uint256 amount) public {
to.transfer(amount);
emit TransferredEther(to, amount);
}
| /// @notice Transfers ether held by the contract to another account
/// @param to The account to transfer Ether to
/// @param amount The amount of Ether to transfer | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
1619,
1757
]
} | 14,633 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | plunder | function plunder(
IERC20[] memory erc20,
WithdrawERC721[] memory erc721,
WithdrawERC1155[] memory erc1155,
address payable to
) external {
_withdrawERC20(erc20, to);
_withdrawERC721(erc721, to);
_withdrawERC1155(erc1155, to);
transferEther(to, address(this).balance);
}
| /// @notice Transfers tokens to another account
/// @param erc20 Array of ERC20 token addresses whose entire balance should be transferred
/// @param erc721 Array of WithdrawERC721 structs whose tokens should be transferred
/// @param erc1155 Array of WithdrawERC1155 structs whose tokens should be transferred
/// @para... | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2127,
2434
]
} | 14,634 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | destroy | function destroy(address payable to) external {
selfdestruct(to);
}
| /// @notice Destroys this contract using `selfdestruct`
/// @param to The address to send remaining Ether to | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2549,
2624
]
} | 14,635 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | _executeCall | function _executeCall(address to, uint256 value, bytes memory data) internal returns (bytes memory) {
(bool succeeded, bytes memory returnValue) = to.call{value: value}(data);
require(succeeded, string(returnValue));
return returnValue;
}
| /// @notice Executes a call to another contract
/// @param to The address to call
/// @param value The Ether to pass along with the call
/// @param data The call data
/// @return The return data from the call | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
2845,
3099
]
} | 14,636 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | _withdrawERC20 | function _withdrawERC20(IERC20[] memory tokens, address to) internal {
for (uint256 i = 0; i < tokens.length; i++) {
uint256 balance = tokens[i].balanceOf(address(this));
tokens[i].transfer(to, balance);
emit WithdrewERC20(address(tokens[i]), balance);
}
}
| /// @notice Transfers the entire balance of ERC20s to an account
/// @param tokens An array of ERC20 tokens to transfer out. The balance of each will be transferred.
/// @param to The recipient of the transfers | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3319,
3606
]
} | 14,637 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | _withdrawERC721 | function _withdrawERC721(WithdrawERC721[] memory withdrawals, address to) internal {
for (uint256 i = 0; i < withdrawals.length; i++) {
for (uint256 tokenIndex = 0; tokenIndex < withdrawals[i].tokenIds.length; tokenIndex++) {
withdrawals[i].token.transferFrom(address(this), to, withdrawals[i].tokenIds[token... | /// @notice Transfers ERC721 tokens to an account
/// @param withdrawals An array of WithdrawERC721 structs that each include the ERC721 token to transfer and the corresponding token ids.
/// @param to The recipient of the transfers | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
3847,
4285
]
} | 14,638 | ||
ERC721Ownable | contracts/LootBox.sol | 0xc5b84025e49e1ed2a61b8db7340fda576f300288 | Solidity | LootBox | contract LootBox {
/// @notice A structure to define arbitrary contract calls
struct Call {
address to;
uint256 value;
bytes data;
}
/// @notice A structure to define ERC721 transfer contents
struct WithdrawERC721 {
IERC721 token;
uint256[] tokenIds;
}
/// @notice A structure to def... | /// @title Allows anyone to "loot" an address
/// @author Brendan Asselstine
/// @notice A LootBox allows anyone to withdraw all tokens or execute calls on behalf of the contract.
/// @dev This contract is intended to be counterfactually instantiated via CREATE2. | NatSpecSingleLine | _withdrawERC1155 | function _withdrawERC1155(WithdrawERC1155[] memory withdrawals, address to) internal {
for (uint256 i = 0; i < withdrawals.length; i++) {
withdrawals[i].token.safeBatchTransferFrom(address(this), to, withdrawals[i].ids, withdrawals[i].amounts, withdrawals[i].data);
emit WithdrewERC1155(address(withdrawals[i]... | /// @notice Transfers ERC1155 tokens to an account
/// @param withdrawals An array of WithdrawERC1155 structs that each include the ERC1155 to transfer and it's corresponding token ids and amounts.
/// @param to The recipient of the transfers | NatSpecSingleLine | v0.6.12+commit.27d51765 | {
"func_code_index": [
4536,
4948
]
} | 14,639 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getTotalSupply | function getTotalSupply() public view returns(uint) {
return totalSupply() + stakedSupply;
}
| /* Set the token contract for which to call for the stake reward
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
1534,
1645
]
} | 14,640 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getMyBalance | function getMyBalance() public view returns(uint) {
return balanceOf(msg.sender);
}
| /* Get available tokens
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
1698,
1800
]
} | 14,641 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getMyFullBalance | function getMyFullBalance() public view returns(uint) {
uint balance = balanceOf(msg.sender);
for (uint i = 0; i < _staking[msg.sender].length; i++){
balance += getStakeAmount(i);
}
return balance;
}
| /* Get all tokens inkl staked
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
1859,
2118
]
} | 14,642 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | setTokenContract | function setTokenContract(address _address) public {
require(_msgSender() == _owner,"Only owner can set token contract!");
_tokenContract = _address;
}
| /* Set the token contract for which to call for the stake reward
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
2212,
2391
]
} | 14,643 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | setMinter | function setMinter(address minter_) public {
require(msg.sender == _owner, "Only owner can set minter!");
_minter = minter_;
}
| /* Sets the address allowed to mint
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
2456,
2610
]
} | 14,644 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | setSales | function setSales(address sales_) public {
require(msg.sender == _owner, "Only owner can set minter!");
_sales = sales_;
}
| /*
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
2643,
2793
]
} | 14,645 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | mint | function mint(address address_, uint256 amount_) public {
require(msg.sender == _minter || msg.sender == _sales, "Only minter can mint tokens!");
_mint(address_, amount_);
}
| /* Mint an amount of tokens to an address
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
2864,
3065
]
} | 14,646 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | mintToMultipleAddresses | function mintToMultipleAddresses(address[] memory _addresses, uint _amount) public {
require(_msgSender() == _owner,"Only owner can mint to multiple addresses!");
for(uint i = 0; i < _addresses.length; i++){
_mint(_addresses[i], _amount);
}
}
| /*
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
3097,
3390
]
} | 14,647 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | stake | function stake(uint amount_, uint stakeType_) public {
_burn(msg.sender, amount_);
stakedSupply += amount_;
Stake memory temp;
temp.amount = amount_;
temp.startTime = now;
temp.stakeType = stakeType_;
_staking[msg.sender].push(temp);
emit staked(msg.sender, amount_, _stakingOptio... | /* Stake
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
3428,
3819
]
} | 14,648 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getStakes | function getStakes() public view returns (uint[3][] memory) {
uint[3][] memory tempStakeList = new uint[3][](_staking[msg.sender].length);
for (uint i = 0; i < _staking[msg.sender].length; i++){
tempStakeList[i][0] = getStakeAmount(i);
tempStakeList[i][1] = getRemainingLockTime(i);
... | /* Get all stakes a address holds
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
3882,
4317
]
} | 14,649 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getStakeAmount | function getStakeAmount(uint stake_) public view returns (uint) {
return _staking[msg.sender][stake_].amount;
}
| /* Returns the amount of token provided with a stake.
*
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
4400,
4531
]
} | 14,650 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | isStakeLocked | function isStakeLocked(uint stake_) private view returns (bool) {
uint stakingTime = now - _staking[msg.sender][stake_].startTime;
return stakingTime < _stakingOptions[_staking[msg.sender][stake_].stakeType].lockedTime;
}
| /* returns true or false depending on if a stake is locked
* or free to withdraw.
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
4640,
4889
]
} | 14,651 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getRemainingLockTime | function getRemainingLockTime(uint stake_) public view returns (uint) {
uint stakingTime = now - _staking[msg.sender][stake_].startTime;
if (stakingTime < _stakingOptions[_staking[msg.sender][stake_].stakeType].lockedTime) {
return _stakingOptions[_staking[msg.sender][stake_].stakeType].lockedTime - ... | /* Returns the remaining lock time of a stake, if unlocked
* returns 0.
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
4988,
5396
]
} | 14,652 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | getStakeReward | function getStakeReward(uint stake_) public view returns (uint) {
uint stakingTime = now - _staking[msg.sender][stake_].startTime;
uint buffededStakingTime = stakingTime * stakeBuffer;
uint periods = buffededStakingTime / yearInMs;
uint buffedRewardPeriodPercent = periods * _stakingOptions[_staking[... | /* Calculates the current reward of a stake.
* Get time staked
* Add a buffer to circumvent float calculations
* Gets amount of periods staked
* Multiplies the periods staked with the reward percent amount
* Multiplies the reward by the amount staked
* Removed the buffer
* Removes the percent buffer
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
5760,
6367
]
} | 14,653 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | unstake | function unstake(uint stake_) public {
require(isStakeLocked(stake_) != true, "Stake still locked!");
_mint(msg.sender, _staking[msg.sender][stake_].amount);
stakedSupply -= _staking[msg.sender][stake_].amount;
uint _amount = getStakeReward(stake_);
(bool success, bytes memory returnData) = add... | /* Unstake previous stake, mints back the original tokens,
* sends mint function call to reward contract to mint the
* reward to the sender address.
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
6549,
7129
]
} | 14,654 | ||
SteakToken | SteakToken.sol | 0xf9af121db28db18833057b82b6527902162bb623 | Solidity | SteakToken | contract SteakToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
... | _removeIndexInArray | function _removeIndexInArray(Stake[] storage _array, uint _index) private {
if (_index >= _array.length) return;
for (uint i = _index; i<_array.length-1; i++){
_array[i] = _array[i+1];
}
_array.pop();
}
| /* Walks through an array from index, moves all values down one
* step the pops the last value.
*/ | Comment | v0.6.12+commit.27d51765 | Unlicense | ipfs://6a4ba59466ed023e63152471aa5d78a18111d33671602e2913cacc7813266441 | {
"func_code_index": [
7252,
7513
]
} | 14,655 | ||
AuctionPotato | AuctionPotato.sol | 0x8ac132345132d3c36b55b375f04d22029e71547e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
| /**
* @dev Multiplies two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://504f9a4a0cc90ef5fa864d0b8cc03bc17e6368c45f451988d83cb4df98ff5dc3 | {
"func_code_index": [
95,
308
]
} | 14,656 | |
AuctionPotato | AuctionPotato.sol | 0x8ac132345132d3c36b55b375f04d22029e71547e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Integer division of two numbers, truncating the quotient.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://504f9a4a0cc90ef5fa864d0b8cc03bc17e6368c45f451988d83cb4df98ff5dc3 | {
"func_code_index": [
398,
691
]
} | 14,657 | |
AuctionPotato | AuctionPotato.sol | 0x8ac132345132d3c36b55b375f04d22029e71547e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
if (b >= a) {
return 0;
}
return a - b;
}
| /**
* @dev Substracts two numbers, returns 0 if it would go into minus range.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://504f9a4a0cc90ef5fa864d0b8cc03bc17e6368c45f451988d83cb4df98ff5dc3 | {
"func_code_index": [
790,
950
]
} | 14,658 | |
AuctionPotato | AuctionPotato.sol | 0x8ac132345132d3c36b55b375f04d22029e71547e | Solidity | SafeMath | library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
... | /**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/ | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
| /**
* @dev Adds two numbers, throws on overflow.
*/ | NatSpecMultiLine | v0.4.25+commit.59dbf8f1 | bzzr://504f9a4a0cc90ef5fa864d0b8cc03bc17e6368c45f451988d83cb4df98ff5dc3 | {
"func_code_index": [
1020,
1172
]
} | 14,659 | |
AuctionPotato | AuctionPotato.sol | 0x8ac132345132d3c36b55b375f04d22029e71547e | Solidity | AuctionPotato | contract AuctionPotato {
using SafeMath for uint256;
// static
address public owner;
uint public startTime;
uint public endTime;
string name;
// pototo
uint public potato;
uint oldPotato;
uint oldHighestBindingBid;
// state
bool public canceled;
... | nextBid | function nextBid() public view returns (uint _nextBid) {
return highestBindingBid.add(potato);
}
| // calculates the next bid amount to you can have a oneclick buy button | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://504f9a4a0cc90ef5fa864d0b8cc03bc17e6368c45f451988d83cb4df98ff5dc3 | {
"func_code_index": [
1513,
1628
]
} | 14,660 | |||
AuctionPotato | AuctionPotato.sol | 0x8ac132345132d3c36b55b375f04d22029e71547e | Solidity | AuctionPotato | contract AuctionPotato {
using SafeMath for uint256;
// static
address public owner;
uint public startTime;
uint public endTime;
string name;
// pototo
uint public potato;
uint oldPotato;
uint oldHighestBindingBid;
// state
bool public canceled;
... | nextNextBid | function nextNextBid() public view returns (uint _nextBid) {
return highestBindingBid.add(potato).add((highestBindingBid.add(potato)).mul(4).div(9));
}
| // calculates the bid after the current bid so nifty hackers can skip the queue
// this is not in our frontend and no one knows if it actually works | LineComment | v0.4.25+commit.59dbf8f1 | bzzr://504f9a4a0cc90ef5fa864d0b8cc03bc17e6368c45f451988d83cb4df98ff5dc3 | {
"func_code_index": [
1800,
1970
]
} | 14,661 | |||
NPM_Offical_Collection | @openzeppelin/contracts/access/Ownable.sol | 0x5268c793f88d3033916edc807b11d0bb0c1edd7b | Solidity | Ownable | abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
addr... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | owner | function owner() public view virtual returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://2dfd7aed89cf4eb837b23087b323bb0c56e237ec830c479225caa8787f0ba6da | {
"func_code_index": [
521,
613
]
} | 14,662 |
NPM_Offical_Collection | @openzeppelin/contracts/access/Ownable.sol | 0x5268c793f88d3033916edc807b11d0bb0c1edd7b | Solidity | Ownable | abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
addr... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | renounceOwnership | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://2dfd7aed89cf4eb837b23087b323bb0c56e237ec830c479225caa8787f0ba6da | {
"func_code_index": [
1172,
1325
]
} | 14,663 |
NPM_Offical_Collection | @openzeppelin/contracts/access/Ownable.sol | 0x5268c793f88d3033916edc807b11d0bb0c1edd7b | Solidity | Ownable | abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
addr... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | transferOwnership | function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://2dfd7aed89cf4eb837b23087b323bb0c56e237ec830c479225caa8787f0ba6da | {
"func_code_index": [
1475,
1761
]
} | 14,664 |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | TokenERC20 | function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply ; // Update total supply
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.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
848,
1344
]
} | 14,665 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | _transfer | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to])... | /**
* Internal transfer, only can be called by this contract
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
1428,
2270
]
} | 14,666 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | transfer | function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
| /**
* 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.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
2476,
2588
]
} | 14,667 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| /**
* 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.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
2863,
3164
]
} | 14,668 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | approveAndCall | function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
| /**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to s... | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
4120,
4472
]
} | 14,669 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | burn | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _val... | /**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
4642,
5016
]
} | 14,670 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | TokenERC20 | contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 2;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mappin... | burnFrom | function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Sub... | /**
* Destroy tokens from other account
*
* 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.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
5274,
5885
]
} | 14,671 | |||
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | Pausable | contract Pausable is owned {
event Pause();
event Unpause();
bool public paused = true;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function cal... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | pause | function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
| /**
* @dev called by the owner to pause, triggers stopped state
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
510,
601
]
} | 14,672 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | Pausable | contract Pausable is owned {
event Pause();
event Unpause();
bool public paused = true;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function cal... | /**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/ | NatSpecMultiLine | unpause | function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
| /**
* @dev called by the owner to unpause, returns to normal state
*/ | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
685,
778
]
} | 14,673 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | CryptoLeu | function CryptoLeu() TokenERC20(60000000, "CryptoLeu", "LEU") public {}
| /* Initializes contract with initial supply tokens to the creator of the contract */ | Comment | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
402,
478
]
} | 14,674 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | _transfer | function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanc... | /* Internal transfer, only can be called by this contract */ | Comment | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
547,
1329
]
} | 14,675 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | mintToken | function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
| /// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
1521,
1779
]
} | 14,676 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | freezeAccount | function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
| /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
1960,
2121
]
} | 14,677 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | setPrices | function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
| /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
2364,
2524
]
} | 14,678 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | buy | function buy() whenNotPaused payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
| /// @notice Buy tokens from contract by sending ether | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
2586,
2809
]
} | 14,679 | |
CryptoLeu | CryptoLeu.sol | 0x369d0db2c7d56b095d758379b75f64085953528a | Solidity | CryptoLeu | contract CryptoLeu is owned, TokenERC20, Pausable {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* I... | /******************************************/ | NatSpecMultiLine | sell | function sell(uint256 amount) whenNotPaused public {
require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy
_transfer(msg.sender, this, amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller.... | /// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://c48ff2c0737d1bb0946686c84a1dfbfc1432553d55431d001a27064aa96244bd | {
"func_code_index": [
2913,
3315
]
} | 14,680 | |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
251,
437
]
} | 14,681 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
707,
848
]
} | 14,682 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | sub | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
1180,
1377
]
} | 14,683 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
... | /**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
1623,
2099
]
} | 14,684 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to reve... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
2562,
2699
]
} | 14,685 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | div | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
... | /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
3224,
3574
]
} | 14,686 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consumi... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
4026,
4161
]
} | 14,687 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | 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 la... | NatSpecMultiLine | mod | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcod... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
4675,
4846
]
} | 14,688 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | isContract | function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codeha... | /**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
606,
1230
]
} | 14,689 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | sendValue | function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address... | /**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `tr... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
2160,
2562
]
} | 14,690 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCall | function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
| /**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
3318,
3496
]
} | 14,691 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCall | function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
| /**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
3721,
3922
]
} | 14,692 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCallWithValue | function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| /**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
4292,
4523
]
} | 14,693 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | /**
* @dev Collection of functions related to the address type
*/ | NatSpecMultiLine | functionCallWithValue | function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
| /**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
4774,
5095
]
} | 14,694 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
94,
154
]
} | 14,695 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
237,
310
]
} | 14,696 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
534,
616
]
} | 14,697 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
895,
983
]
} | 14,698 |
TOKO | TOKO.sol | 0x8cce694cb6c8b310b18d0a335b5a79fccb1c0402 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**... | /**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://e8cff259f737168c18bddfcd1d7480972a9ed77ada14ca575fc3b0915288d635 | {
"func_code_index": [
1647,
1726
]
} | 14,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.