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
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 2560, 2697 ] }
24,100
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 3188, 3471 ] }
24,101
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 3931, 4066 ] }
24,102
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 4546, 4717 ] }
24,103
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
Context
abstract contract Context { //function _msgSender() internal view virtual returns (address payable) { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mut...
_msgSender
function _msgSender() internal view virtual returns (address) { return msg.sender; }
//function _msgSender() internal view virtual returns (address payable) {
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 108, 211 ] }
24,104
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
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.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 606, 1230 ] }
24,105
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
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.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 2160, 2562 ] }
24,106
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
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.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 3318, 3496 ] }
24,107
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
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.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 3721, 3922 ] }
24,108
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
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.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 4292, 4523 ] }
24,109
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
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.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 4774, 5095 ] }
24,110
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 557, 641 ] }
24,111
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 1200, 1353 ] }
24,112
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 1503, 1752 ] }
24,113
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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
lock
function lock(uint256 time) public virtual onlyOwner { _previousOwner = _owner; _owner = address(0); _lockTime = block.timestamp + time; emit OwnershipTransferred(_owner, address(0)); }
//Locks the contract for owner for the amount of time provided
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 1920, 2151 ] }
24,114
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
Ownable
contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */...
/** * @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
unlock
function unlock() public virtual { require(_previousOwner == msg.sender, "You don't have permission to unlock"); require(block.timestamp > _lockTime , "Contract is locked until 7 days"); emit OwnershipTransferred(_owner, _previousOwner); _owner = _previousOwner; }
//Unlocks the contract for owner when _lockTime is exceeds
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 2222, 2532 ] }
24,115
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
RocketRaccoonInu
contract RocketRaccoonInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (add...
//to recieve ETH from uniswapV2Router when swaping
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 11135, 11169 ] }
24,116
RocketRaccoonInu
RocketRaccoonInu.sol
0xe379b211a0dfe13b694863f57fdbff54a25d3b94
Solidity
RocketRaccoonInu
contract RocketRaccoonInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (add...
_tokenTransfer
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { if(!canTrade){ require(sender == owner()); // only owner allowed to trade or add liquidity } if(botWallets[sender] || botWallets[recipient]){ require(botscantrade, "bots arent all...
//this method is responsible for taking all fee, if takeFee is true
LineComment
v0.8.9+commit.e5eed63a
None
ipfs://1919cb98602597274b428492d51645d830aef293d60628907a2649fecdd42c47
{ "func_code_index": [ 19343, 20462 ] }
24,117
DreamGardensNFT
contracts/ERC721Tradable.sol
0xbcc103900a50f469dbcffad8a15e71ee5d9e1ce4
Solidity
ERC721Tradable
abstract contract ERC721Tradable is ERC721, ContextMixin, NativeMetaTransaction, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _nextTokenId; address proxyRegistryAddress; constructor( string memory _name, string memor...
/** * @title ERC721Tradable * ERC721Tradable - ERC721 contract that whitelists a trading address, and has minting functionality. */
NatSpecMultiLine
mintTo
function mintTo(address _to) internal { uint256 currentTokenId = _nextTokenId.current(); _nextTokenId.increment(); _safeMint(_to, currentTokenId); }
/** * @dev Mints a token to an address with a tokenURI. * @param _to address of the future owner of the token */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
{ "func_code_index": [ 784, 969 ] }
24,118
DreamGardensNFT
contracts/ERC721Tradable.sol
0xbcc103900a50f469dbcffad8a15e71ee5d9e1ce4
Solidity
ERC721Tradable
abstract contract ERC721Tradable is ERC721, ContextMixin, NativeMetaTransaction, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _nextTokenId; address proxyRegistryAddress; constructor( string memory _name, string memor...
/** * @title ERC721Tradable * ERC721Tradable - ERC721 contract that whitelists a trading address, and has minting functionality. */
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _nextTokenId.current() - 1; }
/** @dev Returns the total tokens minted so far. 1 is always subtracted from the Counter since it tracks the next available tokenId. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
{ "func_code_index": [ 1137, 1247 ] }
24,119
DreamGardensNFT
contracts/ERC721Tradable.sol
0xbcc103900a50f469dbcffad8a15e71ee5d9e1ce4
Solidity
ERC721Tradable
abstract contract ERC721Tradable is ERC721, ContextMixin, NativeMetaTransaction, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _nextTokenId; address proxyRegistryAddress; constructor( string memory _name, string memor...
/** * @title ERC721Tradable * ERC721Tradable - ERC721 contract that whitelists a trading address, and has minting functionality. */
NatSpecMultiLine
isApprovedForAll
function isApprovedForAll(address owner, address operator) override public view returns (bool) { // Whitelist OpenSea proxy contract for easy trading. ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(owner)) == operator) { ...
/** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
{ "func_code_index": [ 1374, 1824 ] }
24,120
DreamGardensNFT
contracts/ERC721Tradable.sol
0xbcc103900a50f469dbcffad8a15e71ee5d9e1ce4
Solidity
ERC721Tradable
abstract contract ERC721Tradable is ERC721, ContextMixin, NativeMetaTransaction, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _nextTokenId; address proxyRegistryAddress; constructor( string memory _name, string memor...
/** * @title ERC721Tradable * ERC721Tradable - ERC721 contract that whitelists a trading address, and has minting functionality. */
NatSpecMultiLine
_msgSender
function _msgSender() internal override view returns (address sender) { return ContextMixin.msgSender(); }
/** * This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea. */
NatSpecMultiLine
v0.8.0+commit.c7dfd78e
{ "func_code_index": [ 1963, 2129 ] }
24,121
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } ...
/** * @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() public { owner = msg.sender; }
/** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 257, 317 ] }
24,122
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
Ownable
contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } ...
/** * @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)); emit 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.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 636, 817 ] }
24,123
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; // store tokens mapping(address => uint256) balances; // uint256 public totalSupply; /** * @dev transfer token for a specified address * @param _to The add...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transfer
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); e...
/** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 397, 793 ] }
24,124
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; // store tokens mapping(address => uint256) balances; // uint256 public totalSupply; /** * @dev transfer token for a specified address * @param _to The add...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
balanceOf
function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 999, 1115 ] }
24,125
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; // store tokens mapping(address => uint256) balances; // uint256 public totalSupply; /** * @dev transfer token for a specified address * @param _to The add...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_...
/** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 1397, 1854 ] }
24,126
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; // store tokens mapping(address => uint256) balances; // uint256 public totalSupply; /** * @dev transfer token for a specified address * @param _to The add...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
approve
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
/** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * ...
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 2486, 2681 ] }
24,127
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
StandardToken
contract StandardToken is ERC20Basic { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; // store tokens mapping(address => uint256) balances; // uint256 public totalSupply; /** * @dev transfer token for a specified address * @param _to The add...
/** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */
NatSpecMultiLine
allowance
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 3005, 3150 ] }
24,128
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
BurnableToken
contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_valu...
/** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */
NatSpecMultiLine
burn
function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; ...
/** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 225, 718 ] }
24,129
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that ...
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
mint
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(0x0, _to, _amount); return true; }
/** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 483, 757 ] }
24,130
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
MintableToken
contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that ...
/** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */
NatSpecMultiLine
finishMinting
function finishMinting() onlyOwner public returns (bool) { mintingFinished = true; emit MintFinished(); return true; }
/** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 874, 1013 ] }
24,131
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
pause
function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); }
/** * @dev called by the owner to pause, triggers stopped state */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 513, 609 ] }
24,132
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
Pausable
contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function ...
/** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */
NatSpecMultiLine
unpause
function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); }
/** * @dev called by the owner to unpause, returns to normal state */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 693, 791 ] }
24,133
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
VICToken
contract VICToken is BurnableToken, MintableToken, PausableToken { // Public variables of the token string public name; string public symbol; // decimals is the strongly suggested default, avoid changing it uint8 public decimals; function VICToken() public { name = "Venture Investment Coin"; ...
/* * @title Venture Investment Coin */
Comment
withdrawEther
function withdrawEther() onlyOwner public { address addr = this; owner.transfer(addr.balance); }
// transfer balance to owner
LineComment
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 544, 663 ] }
24,134
VICToken
VICToken.sol
0xe384e1780b2e7f3148345433345de6e5c037ce48
Solidity
VICToken
contract VICToken is BurnableToken, MintableToken, PausableToken { // Public variables of the token string public name; string public symbol; // decimals is the strongly suggested default, avoid changing it uint8 public decimals; function VICToken() public { name = "Venture Investment Coin"; ...
/* * @title Venture Investment Coin */
Comment
function() payable public { }
// can accept ether
LineComment
v0.4.21+commit.dfe3193c
bzzr://7529ea940015e4fd75e39d742edd3d974cad35fcb3b9b8d81ffe03a87d9bf272
{ "func_code_index": [ 689, 724 ] }
24,135
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
/** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 259, 445 ] }
24,136
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); }
/** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 723, 864 ] }
24,137
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
/** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 1162, 1359 ] }
24,138
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; ...
/** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 1613, 2089 ] }
24,139
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); }
/** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to reve...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 2560, 2697 ] }
24,140
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
div
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an in...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 3188, 3471 ] }
24,141
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consumi...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 3931, 4066 ] }
24,142
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
SafeMath
library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns ...
/** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming la...
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
/** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcod...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 4546, 4717 ] }
24,143
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
totalSupply
function totalSupply() external view returns (uint256);
/** * @dev Returns the amount of tokens in existence. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 94, 154 ] }
24,144
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
balanceOf
function balanceOf(address account) external view returns (uint256);
/** * @dev Returns the amount of tokens owned by `account`. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 237, 310 ] }
24,145
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 534, 616 ] }
24,146
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
allowance
function allowance(address owner, address spender) external view returns (uint256);
/** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 895, 983 ] }
24,147
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) external returns (bool);
/** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate ...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 1647, 1726 ] }
24,148
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
IERC20
interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /**...
/** * @dev Interface of the ERC20 standard as defined in the EIP. */
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 2039, 2141 ] }
24,149
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
name
function name() public view returns (string memory) { return _name; }
/** * @dev Returns the name of the token. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 994, 1082 ] }
24,150
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
symbol
function symbol() public view returns (string memory) { return _symbol; }
/** * @dev Returns the symbol of the token, usually a shorter version of the * name. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 1196, 1288 ] }
24,151
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decimals
function decimals() public view returns (uint8) { return _decimals; }
/** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 1921, 2009 ] }
24,152
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
totalSupply
function totalSupply() public view override returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 2069, 2174 ] }
24,153
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 2232, 2356 ] }
24,154
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 2564, 2744 ] }
24,155
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 2802, 2958 ] }
24,156
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 3100, 3274 ] }
24,157
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); _transfer(sender, recipient, amount); return true; }
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 3751, 4077 ] }
24,158
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 4481, 4704 ] }
24,159
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 5202, 5476 ] }
24,160
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_balances[sender] >= amount, "ERC20: the sender balance must la...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 6080, 6732 ] }
24,161
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amoun...
/** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero a...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 7167, 7518 ] }
24,162
ERC20
ERC20.sol
0xce2db5a92c150d8f0860f6fbdc49d3230e69b769
Solidity
ERC20
contract ERC20 is Context, IERC20, Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 priva...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our...
NatSpecMultiLine
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
/** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * -...
NatSpecMultiLine
v0.6.0+commit.26b70077
None
ipfs://ef1383e262dfd42ba5ac6838e038fa9b171ebb7e3519970399b7fac0ba69003f
{ "func_code_index": [ 8405, 8502 ] }
24,163
Ballot
Ballot.sol
0xf45ebf13ef373c971c2182b01976c1a47161c8c6
Solidity
Ballot
contract Ballot { struct Voter { uint weight; bool voted; uint8 vote; address delegate; } struct Proposal { uint voteCount; } address chairperson; mapping(address => Voter) voters; Proposal[] proposals; /// Create a new ballot wi...
giveRightToVote
function giveRightToVote(address toVoter) public { if (msg.sender != chairperson || voters[toVoter].voted) return; voters[toVoter].weight = 1; }
/// Give $(toVoter) the right to vote on this ballot. /// May only be called by $(chairperson).
NatSpecSingleLine
v0.5.11+commit.c082d0b4
None
bzzr://c01bcdcbacd4c629bae1cc7a070a19b620ae6bb692a7ce1961242e060abc950e
{ "func_code_index": [ 643, 815 ] }
24,164
Ballot
Ballot.sol
0xf45ebf13ef373c971c2182b01976c1a47161c8c6
Solidity
Ballot
contract Ballot { struct Voter { uint weight; bool voted; uint8 vote; address delegate; } struct Proposal { uint voteCount; } address chairperson; mapping(address => Voter) voters; Proposal[] proposals; /// Create a new ballot wi...
delegate
function delegate(address to) public { Voter storage sender = voters[msg.sender]; // assigns reference if (sender.voted) return; while (voters[to].delegate != address(0) && voters[to].delegate != msg.sender) to = voters[to].delegate; if (to == msg.sender) return; sender.voted = true; ...
/// Delegate your vote to the voter $(to).
NatSpecSingleLine
v0.5.11+commit.c082d0b4
None
bzzr://c01bcdcbacd4c629bae1cc7a070a19b620ae6bb692a7ce1961242e060abc950e
{ "func_code_index": [ 866, 1461 ] }
24,165
Ballot
Ballot.sol
0xf45ebf13ef373c971c2182b01976c1a47161c8c6
Solidity
Ballot
contract Ballot { struct Voter { uint weight; bool voted; uint8 vote; address delegate; } struct Proposal { uint voteCount; } address chairperson; mapping(address => Voter) voters; Proposal[] proposals; /// Create a new ballot wi...
vote
function vote(uint8 toProposal) public { Voter storage sender = voters[msg.sender]; if (sender.voted || toProposal >= proposals.length) return; sender.voted = true; sender.vote = toProposal; proposals[toProposal].voteCount += sender.weight; }
/// Give a single vote to proposal $(toProposal).
NatSpecSingleLine
v0.5.11+commit.c082d0b4
None
bzzr://c01bcdcbacd4c629bae1cc7a070a19b620ae6bb692a7ce1961242e060abc950e
{ "func_code_index": [ 1519, 1816 ] }
24,166
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
totalSupply
function totalSupply() public view returns (uint256) { return _totalSupply; }
/** * @dev See {IERC20-totalSupply}. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 299, 395 ] }
24,167
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
balanceOf
function balanceOf(address account) public view returns (uint256) { return _balances[account]; }
/** * @dev See {IERC20-balanceOf}. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 453, 568 ] }
24,168
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
transfer
function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; }
/** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 776, 939 ] }
24,169
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
allowance
function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; }
/** * @dev See {IERC20-allowance}. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 997, 1136 ] }
24,170
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
approve
function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; }
/** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 1278, 1435 ] }
24,171
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
transferFrom
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; }
/** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amou...
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 1902, 2211 ] }
24,172
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
/** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 2615, 2830 ] }
24,173
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; }
/** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` c...
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 3328, 3594 ] }
24,174
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_transfer
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exc...
/** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. *...
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 4079, 4555 ] }
24,175
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_mint
function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 4831, 5144 ] }
24,176
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_burn
function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amo...
/** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 5471, 5824 ] }
24,177
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_approve
function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); }
/** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero...
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 6259, 6602 ] }
24,178
GammaCrowdsale
@openzeppelin/contracts/token/ERC20/ERC20.sol
0x4418b24c80e91b40e4f0b94fbd52a35ee0278c70
Solidity
ERC20
contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSup...
/** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide *...
NatSpecMultiLine
_burnFrom
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); }
/** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */
NatSpecMultiLine
v0.5.5+commit.47a71e8f
MIT
bzzr://3110f86b1ab9ff7e78d98b93e6d8b14426478effd8aaae111299032b775e3d09
{ "func_code_index": [ 6783, 7020 ] }
24,179
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
Ownable
contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public{ owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier...
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { 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.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 545, 641 ] }
24,180
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
function () external payable { tokensale(msg.sender); }
// Payable method // @notice Anyone can buy the tokens on tokensale by paying ether
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 1106, 1180 ] }
24,181
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
tokensale
function tokensale(address recipient) public payable { price = getPrice(); require(price != 0 && recipient != 0x0); uint256 weiAmount = msg.value; uint256 tokenToSend = weiAmount.mul(price); balances[owner] = balances[owner].sub(tokenToSend); balances[recipient] = balances[recipi...
// @notice tokensale // @param recipient The address of the recipient // @return the transaction address and send the event as Transfer
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 1334, 1826 ] }
24,182
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
totalSupply
function totalSupply() public constant returns (uint256) { return _totalSupply; }
// @return total tokens supplied
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 1867, 1967 ] }
24,183
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
balanceOf
function balanceOf(address who) public constant returns (uint256) { return balances[who]; }
// What is the balance of a particular account? // @param who The address of the particular account // @return the balanace the particular account
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 2136, 2246 ] }
24,184
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
transfer
function transfer(address to, uint256 value) public returns (bool success) { require ( balances[msg.sender] >= value && value > 0 ); balances[msg.sender] = balances[msg.sender].sub(value); balances[to] = balances[to].add(value); emit Transfer(msg.sender, to, value); return true; ...
// @notice send `value` token to `to` from `msg.sender` // @param to The address of the recipient // @param value The amount of token to be transferred // @return the transaction address and send the event as Transfer
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 2487, 2846 ] }
24,185
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
transferFrom
function transferFrom(address from, address to, uint256 value) public returns (bool success) { require ( allowed[from][msg.sender] >= value && balances[from] >= value && value > 0 ); balances[from] = balances[from].sub(value); balances[to] = balances[to].add(value); allowed[from][msg....
// @notice send `value` token to `to` from `from` // @param from The address of the sender // @param to The address of the recipient // @param value The amount of token to be transferred // @return the transaction address and send the event as Transfer
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 3127, 3593 ] }
24,186
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
approve
function approve(address spender, uint256 value) public returns (bool success) { require (balances[msg.sender] >= value && value > 0); allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; }
// Allow spender to withdraw from your account, multiple times, up to the value amount. // If this function is called again it overwrites the current allowance with value. // @param spender The address of the sender // @param value The amount to be approved // @return the transaction address and send the event as Appro...
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 3945, 4222 ] }
24,187
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
allowance
function allowance(address _owner, address spender) public constant returns (uint256) { return allowed[_owner][spender]; }
// Check the allowed value for the spender to withdraw from owner // @param owner The address of the owner // @param spender The address of the spender // @return the amount which spender is still allowed to withdraw from owner
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 4473, 4614 ] }
24,188
BTNYToken
BTNYToken.sol
0xdef830c29dca582e88661119c9b3d273395f9a93
Solidity
BTNYToken
contract BTNYToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "Bitney"; //Token name string public symbol = "BTNY"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; ...
getPrice
function getPrice() public pure returns (uint256 result) { return 0; }
// Get current price of a Token // @return the price or token value for a ether
LineComment
v0.4.25+commit.59dbf8f1
bzzr://c37e292ad0e2977e4e3828d3ba06949193ba387e1c5854ea957b9920ee297ce9
{ "func_code_index": [ 4711, 4800 ] }
24,189
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
OpenOracleData
contract OpenOracleData { /** * @notice The event emitted when a source writes to its storage */ //event Write(address indexed source, <Key> indexed key, string kind, uint64 timestamp, <Value> value); /** * @notice Write a bunch of signed datum to the authenticated storage mapping ...
/** * @title The Open Oracle Data Base Contract * @author Compound Labs, Inc. */
NatSpecMultiLine
source
function source(bytes memory message, bytes memory signature) public pure returns (address) { (bytes32 r, bytes32 s, uint8 v) = abi.decode(signature, (bytes32, bytes32, uint8)); bytes32 hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", keccak256(message))); return ecrecover(hash, v, r...
/** * @notice Recovers the source address which signed a message * @dev Comparing to a claimed address would add nothing, * as the caller could simply perform the recover and claim that address. * @param message The data that was presumably signed * @param signature The fingerprint of the data + private key ...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 1509, 1858 ] }
24,190
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
OpenOraclePriceData
contract OpenOraclePriceData is OpenOracleData { ///@notice The event emitted when a source writes to its storage event Write(address indexed source, string key, uint64 timestamp, uint64 value); ///@notice The event emitted when the timestamp on a price is invalid and it is not written to storage ev...
/** * @title The Open Oracle Price Data Contract * @notice Values stored in this contract should represent a USD price with 6 decimals precision * @author Compound Labs, Inc. */
NatSpecMultiLine
put
function put(bytes calldata message, bytes calldata signature) external returns (string memory) { (address source, uint64 timestamp, string memory key, uint64 value) = decodeMessage(message, signature); return putInternal(source, timestamp, key, value); }
/** * @notice Write a bunch of signed datum to the authenticated storage mapping * @param message The payload containing the timestamp, and (key, value) pairs * @param signature The cryptographic signature of the message payload, authorizing the source to write * @return The keys that were written */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 1135, 1418 ] }
24,191
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
OpenOraclePriceData
contract OpenOraclePriceData is OpenOracleData { ///@notice The event emitted when a source writes to its storage event Write(address indexed source, string key, uint64 timestamp, uint64 value); ///@notice The event emitted when the timestamp on a price is invalid and it is not written to storage ev...
/** * @title The Open Oracle Price Data Contract * @notice Values stored in this contract should represent a USD price with 6 decimals precision * @author Compound Labs, Inc. */
NatSpecMultiLine
get
function get(address source, string calldata key) external view returns (uint64, uint64) { Datum storage datum = data[source][key]; return (datum.timestamp, datum.value); }
/** * @notice Read a single key from an authenticated source * @param source The verifiable author of the data * @param key The selector for the value to return * @return The claimed Unix timestamp for the data and the price value (defaults to (0, 0)) */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 2926, 3126 ] }
24,192
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
OpenOraclePriceData
contract OpenOraclePriceData is OpenOracleData { ///@notice The event emitted when a source writes to its storage event Write(address indexed source, string key, uint64 timestamp, uint64 value); ///@notice The event emitted when the timestamp on a price is invalid and it is not written to storage ev...
/** * @title The Open Oracle Price Data Contract * @notice Values stored in this contract should represent a USD price with 6 decimals precision * @author Compound Labs, Inc. */
NatSpecMultiLine
getPrice
function getPrice(address source, string calldata key) external view returns (uint64) { return data[source][key].value; }
/** * @notice Read only the value for a single key from an authenticated source * @param source The verifiable author of the data * @param key The selector for the value to return * @return The price value (defaults to 0) */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 3389, 3529 ] }
24,193
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
UniswapConfig
contract UniswapConfig { /// @dev Describe how to interpret the fixedPrice in the TokenConfig. enum PriceSource { FIXED_ETH, /// implies the fixedPrice is a constant multiple of the ETH price (which varies) FIXED_USD, /// implies the fixedPrice is a constant multiple of the USD price (which ...
getTokenConfig
function getTokenConfig(uint i) public view returns (TokenConfig memory) { require(i < numTokens, "token config not found"); if (i == 0) return TokenConfig({cToken: cToken00, underlying: underlying00, symbolHash: symbolHash00, baseUnit: baseUnit00, priceSource: priceSource00, fixedPrice: fixedPrice00, unisw...
/** * @notice Get the i-th config, according to the order they were passed in originally * @param i The index of the config to get * @return The config object */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 31174, 39175 ] }
24,194
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
UniswapConfig
contract UniswapConfig { /// @dev Describe how to interpret the fixedPrice in the TokenConfig. enum PriceSource { FIXED_ETH, /// implies the fixedPrice is a constant multiple of the ETH price (which varies) FIXED_USD, /// implies the fixedPrice is a constant multiple of the USD price (which ...
getTokenConfigBySymbol
function getTokenConfigBySymbol(string memory symbol) public view returns (TokenConfig memory) { return getTokenConfigBySymbolHash(keccak256(abi.encodePacked(symbol))); }
/** * @notice Get the config for symbol * @param symbol The symbol of the config to get * @return The config object */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 39326, 39515 ] }
24,195
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
UniswapConfig
contract UniswapConfig { /// @dev Describe how to interpret the fixedPrice in the TokenConfig. enum PriceSource { FIXED_ETH, /// implies the fixedPrice is a constant multiple of the ETH price (which varies) FIXED_USD, /// implies the fixedPrice is a constant multiple of the USD price (which ...
getTokenConfigBySymbolHash
function getTokenConfigBySymbolHash(bytes32 symbolHash) public view returns (TokenConfig memory) { uint index = getSymbolHashIndex(symbolHash); if (index != uint(-1)) { return getTokenConfig(index); } revert("token config not found"); }
/** * @notice Get the config for the symbolHash * @param symbolHash The keccack256 of the symbol of the config to get * @return The config object */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 39696, 39993 ] }
24,196
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
UniswapConfig
contract UniswapConfig { /// @dev Describe how to interpret the fixedPrice in the TokenConfig. enum PriceSource { FIXED_ETH, /// implies the fixedPrice is a constant multiple of the ETH price (which varies) FIXED_USD, /// implies the fixedPrice is a constant multiple of the USD price (which ...
getTokenConfigByCToken
function getTokenConfigByCToken(address cToken) public view returns (TokenConfig memory) { uint index = getCTokenIndex(cToken); if (index != uint(-1)) { return getTokenConfig(index); } return getTokenConfigByUnderlying(CErc20(cToken).underlying()); }
/** * @notice Get the config for the cToken * @dev If a config for the cToken is not found, falls back to searching for the underlying. * @param cToken The address of the cToken of the config to get * @return The config object */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 40261, 40572 ] }
24,197
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
UniswapConfig
contract UniswapConfig { /// @dev Describe how to interpret the fixedPrice in the TokenConfig. enum PriceSource { FIXED_ETH, /// implies the fixedPrice is a constant multiple of the ETH price (which varies) FIXED_USD, /// implies the fixedPrice is a constant multiple of the USD price (which ...
getTokenConfigByUnderlying
function getTokenConfigByUnderlying(address underlying) public view returns (TokenConfig memory) { uint index = getUnderlyingIndex(underlying); if (index != uint(-1)) { return getTokenConfig(index); } revert("token config not found"); }
/** * @notice Get the config for an underlying asset * @param underlying The address of the underlying asset of the config to get * @return The config object */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 40765, 41062 ] }
24,198
UniswapAnchoredView
UniswapAnchoredView.sol
0x77ec19642c3f296fe0f58da4de070894babb5327
Solidity
FixedPoint
library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // returns a uq112x112 which represents the ratio of the numerator to the denominator // equivalent to encode(numerator).div(denominator) function fraction(uint112 nume...
// Based on code from https://github.com/Uniswap/uniswap-v2-periphery // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
LineComment
fraction
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, "FixedPoint: DIV_BY_ZERO"); return uq112x112((uint224(numerator) << 112) / denominator); }
// returns a uq112x112 which represents the ratio of the numerator to the denominator // equivalent to encode(numerator).div(denominator)
LineComment
v0.6.10+commit.00c0fcaf
GNU GPLv3
ipfs://8c2a73bb54dfe5f38570c033928b1040c23a175021e768c6af478edcf88cf761
{ "func_code_index": [ 286, 530 ] }
24,199