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
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
Ownable
contract Ownable { address private _owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * acc...
_transferOwnership
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
/** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 1244, 1420 ] }
24,600
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
function() public payable isHuman { if (msg.value == 0) { collectPayoutForAddress(msg.sender); } else { uint refId = 1; address referrer = bytesToAddress(msg.data); if (investorToDepostIndex[referrer].isExist) { refId = investorToDepostIndex[referrer].id; } deposit(refId); ...
/** * Fallback and entrypoint for deposits. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 1833, 2182 ] }
24,601
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
bytesToAddress
function bytesToAddress(bytes bys) private pure returns(address addr) { assembly { addr: = mload(add(bys, 20)) } }
/** * Reads the given bytes into an addtress */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 2238, 2375 ] }
24,602
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
addToMidnightPrize
function addToMidnightPrize() public payable onlyOwner { midnightPrize += msg.value; }
/** * Put some funds into the contract for the prize */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 2439, 2536 ] }
24,603
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
getNextPayoutTime
function getNextPayoutTime() public view returns(uint) { if (now<startTime) return startTime + period; return startTime + ((now.sub(startTime)).div(period)).mul(period) + period; }
/** * Get the time of the next payout - calculated */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 2598, 2794 ] }
24,604
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
deposit
function deposit(uint _referrerID) public payable isHuman { require(_referrerID <= currentStakeID, "Who referred you?"); require(msg.value >= minBetLevel, "Doesn't meet minimum stake."); // when is next midnight ? uint nextPayAfterTime = getNextPayoutTime(); if (investorToDepostIndex[msg.sender].isEx...
/** * Make a deposit into the contract */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 2844, 5016 ] }
24,605
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
collectPayout
function collectPayout() public isHuman { collectPayoutForAddress(msg.sender); }
/** * Collect payout for the msg.sender */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 5071, 5162 ] }
24,606
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
getRewardForAddress
function getRewardForAddress(address _address) public onlyOwner { collectPayoutForAddress(_address); }
/** * Collect payout for the given address */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 5216, 5329 ] }
24,607
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
collectPayoutForAddress
function collectPayoutForAddress(address _address) internal { require(investorToDepostIndex[_address].isExist == true, "Who are you?"); require(investorToDepostIndex[_address].nextPayAfterTime < now, "Not yet."); uint periodCount = now.sub(investorToDepostIndex[_address].nextPayAfterTime).div(period).add(1);...
/** * */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 5346, 6353 ] }
24,608
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
MidnightRun
contract MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _...
doMidnightRun
function doMidnightRun() public isHuman { require(now>nextPrizeTime , "Not yet"); // set the next prize time to the next payout time (MidnightRun) nextPrizeTime = getNextPayoutTime(); if (currentPrizeStakeID > 5) { uint toPay = midnightPrize; midnightPrize = 0; if (toPay > address(this)...
/** * Perform the Midnight Run */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 6395, 9020 ] }
24,609
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */
NatSpecMultiLine
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256...
/** * @dev Multiplies two numbers, reverts on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 90, 486 ] }
24,610
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */
NatSpecMultiLine
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 598, 877 ] }
24,611
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */
NatSpecMultiLine
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; }
/** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 992, 1131 ] }
24,612
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */
NatSpecMultiLine
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
/** * @dev Adds two numbers, reverts on overflow. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 1196, 1335 ] }
24,613
MidnightRun
MidnightRun.sol
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github...
/** * @title SafeMath * @dev Math operations with safety checks that revert on error */
NatSpecMultiLine
mod
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
/** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */
NatSpecMultiLine
v0.4.25+commit.59dbf8f1
bzzr://fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc8
{ "func_code_index": [ 1470, 1587 ] }
24,614
PreCubeCoin
@openzeppelin/contracts/access/Ownable.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. ...
NatSpecMultiLine
owner
function owner() public view virtual returns (address) { return _owner; }
/** * @dev Returns the address of the current owner. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 399, 491 ] }
24,615
PreCubeCoin
@openzeppelin/contracts/access/Ownable.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @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 { _setOwner(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.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 1050, 1149 ] }
24,616
PreCubeCoin
@openzeppelin/contracts/access/Ownable.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
Ownable
abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); ...
/** * @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"); _setOwner(newOwner); }
/** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 1299, 1496 ] }
24,617
PreCubeCoin
@openzeppelin/contracts/access/Ownable.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
ERC165
abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
/** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interface...
NatSpecMultiLine
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; }
/** * @dev See {IERC165-supportsInterface}. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 103, 265 ] }
24,618
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @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.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 497, 581 ] }
24,619
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @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.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 1139, 1292 ] }
24,620
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Ownable
contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSend...
/** * @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.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 1442, 1691 ] }
24,621
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 94, 154 ] }
24,622
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 237, 310 ] }
24,623
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 534, 616 ] }
24,624
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 895, 983 ] }
24,625
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 1647, 1726 ] }
24,626
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 2039, 2141 ] }
24,627
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 259, 445 ] }
24,628
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 723, 864 ] }
24,629
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 1162, 1359 ] }
24,630
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 1613, 2089 ] }
24,631
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 2560, 2697 ] }
24,632
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 3188, 3471 ] }
24,633
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 3931, 4066 ] }
24,634
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
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.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 4546, 4717 ] }
24,635
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
isContract
function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codeha...
/** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: ...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 606, 1230 ] }
24,636
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
sendValue
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address...
/** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `tr...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 2160, 2562 ] }
24,637
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
/** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw ...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 3318, 3496 ] }
24,638
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCall
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 3721, 3922 ] }
24,639
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
/** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ *...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 4292, 4523 ] }
24,640
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Address
library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will ...
/** * @dev Collection of functions related to the address type */
NatSpecMultiLine
functionCallWithValue
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); }
/** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 4774, 5095 ] }
24,641
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
safeApprove
function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line ...
/** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 747, 1374 ] }
24,642
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
SafeERC20
library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, add...
/** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `...
NatSpecMultiLine
_callOptionalReturn
function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target ad...
/** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 2393, 3159 ] }
24,643
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
init
function init( IERC20 _rewardToken, uint256 _amount, IERC20 _lpToken, uint256 _blockReward, uint256 _startBlock, uint256 _endBlock, uint256 _bonusEndBlock, uint256 _bonus ) external { require(msg.sender == address(farmGenerator), "FORBIDDEN"); _rewardToken.safeTransf...
/** * Initialize the farming contract. This is called only once upon farm creation and the FarmGenerator * ensures the farm has the correct paramaters * * @param _rewardToken Instance of reward token contract * @param _amount Total sum of reward * @param _lpToken Instance...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 2604, 3557 ] }
24,644
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
updatePool
function updatePool() public { if (block.number <= farmInfo.lastRewardBlock) { return; } uint256 lpSupply = farmInfo.lpToken.balanceOf(address(this)); if (lpSupply == 0) { farmInfo.lastRewardBlock = block.number < farmInfo.endBlock ? block.number : farmInfo.endBlock; retur...
/** * Updates pool information to be up to date to the current block */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 3649, 4388 ] }
24,645
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
deposit
function deposit(uint256 _amount) external { UserInfo storage user = userInfo[msg.sender]; updatePool(); if (user.amount > 0) { uint256 pending = user.amount.mul(farmInfo.accRewardPerShare).div(1e12).sub(user.rewardDebt); _safeRewardTransfer(msg.sender, pending); } if (user.am...
/** * Deposit LP token function for msg.sender * * @param _amount the total deposit amount */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 4528, 5276 ] }
24,646
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
withdraw
function withdraw(uint256 _amount) external { UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount, "INSUFFICIENT"); updatePool(); if (user.amount == _amount && _amount > 0) { factory.userLeftFarm(msg.sender); farmInfo.numFarmers--; } uint256 pendi...
/** * Withdraw LP token function for msg.sender * * @param _amount the total withdrawable amount */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 5430, 6171 ] }
24,647
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
withdrawWithoutReward
function withdrawWithoutReward() external { UserInfo storage user = userInfo[msg.sender]; farmInfo.lpToken.safeTransfer(address(msg.sender), user.amount); emit WithdrawWithoutReward(msg.sender, user.amount); if (user.amount > 0) { factory.userLeftFarm(msg.sender); farmInfo.numFarme...
/** * Function to withdraw LP tokens and forego harvest rewards. Important to protect users LP tokens */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 6296, 6724 ] }
24,648
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
emergencyWithdraw
function emergencyWithdraw(address _token, address _to, uint256 _amount) external onlyOwner { IERC20 erc20Token = IERC20(_token); require(erc20Token.balanceOf(address(this)) > 0, "Insufficient balane"); uint256 amountToWithdraw = _amount; if (_amount == 0) { amountToWithdraw = erc20Token....
/** * Withdraw tokens emergency. * * @param _token Token contract address * @param _to Address where the token withdraw to * @param _amount Amount of tokens to withdraw */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 6987, 7432 ] }
24,649
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
getMultiplier
function getMultiplier(uint256 _fromBlock, uint256 _to) public view returns (uint256) { uint256 _from = _fromBlock >= farmInfo.startBlock ? _fromBlock : farmInfo.startBlock; uint256 to = farmInfo.endBlock > _to ? _to : farmInfo.endBlock; if (to <= farmInfo.bonusEndBlock) { return to.sub(_from).m...
/** * Get the reward multiplier over the given _from_block until _to block * * @param _fromBlock the start of the period to measure rewards for * @param _to the end of the period to measure rewards for * * @return The weighted multiplier for the given period...
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 7848, 8477 ] }
24,650
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
pendingReward
function pendingReward(address _user) external view returns (uint256) { UserInfo storage user = userInfo[_user]; uint256 accRewardPerShare = farmInfo.accRewardPerShare; uint256 lpSupply = farmInfo.lpToken.balanceOf(address(this)); if (block.number > farmInfo.lastRewardBlock && lpSupply != 0) { ...
/** * Function to see accumulated balance of reward token for specified user * * @param _user the user for whom unclaimed tokens will be shown * * @return total amount of withdrawable reward tokens */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 8759, 9450 ] }
24,651
Farm
Farm.sol
0x06f41c74057399f1589df705bac24aff22a823d7
Solidity
Farm
contract Farm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; /* ============ Struct ============ */ struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } struct FarmInfo { ...
// Dependency file: contracts/farm/Farm.sol // pragma solidity 0.6.10; // import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; // import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; // import { Ownabl...
LineComment
_safeRewardTransfer
function _safeRewardTransfer(address _to, uint256 _amount) internal { uint256 rewardBal = farmInfo.rewardToken.balanceOf(address(this)); if (_amount > rewardBal) { farmInfo.rewardToken.transfer(_to, rewardBal); } else { farmInfo.rewardToken.transfer(_to, _amount); } }
/** * Safe reward transfer function, just in case a rounding error causes pool to not have enough reward tokens * * @param _to the user address to transfer tokens to * @param _amount the total amount of tokens to transfer */
NatSpecMultiLine
v0.6.10+commit.00c0fcaf
None
ipfs://fe1f65fdcdf1f26bc8422c501425c0cde8efc19e2eaee631f06a886b1c4996dd
{ "func_code_index": [ 9803, 10143 ] }
24,652
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
DarenHui
function DarenHui() public { symbol = "DRH"; name = "DarenHui"; decimals = 18; _totalSupply = 2000000000000000000000000000; balances[0xFe905C1CC0395240317F4e5A6ff22823f9B1DD3c] = _totalSupply; Transfer(address(0), 0xFe905C1CC0395240317F4e5A6ff22823f9B1DD3c, _totalSupply); }
// ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 455, 793 ] }
24,653
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
totalSupply
function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; }
// ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 979, 1100 ] }
24,654
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
balanceOf
function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; }
// ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 1320, 1449 ] }
24,655
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transfer
function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); Transfer(msg.sender, to, tokens); return true; }
// ------------------------------------------------------------------------ // Transfer the balance from token owner's account to to account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 1793, 2070 ] }
24,656
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
approve
function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); return true; }
// ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double...
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 2578, 2786 ] }
24,657
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transferFrom
function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); Transfer(from, to, tokens); return...
// ------------------------------------------------------------------------ // Transfer tokens from the from account to the to account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the from account and // - From account must have sufficient balance to transfer // - S...
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 3317, 3675 ] }
24,658
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
allowance
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; }
// ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 3958, 4114 ] }
24,659
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
approveAndCall
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) { allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; }
// ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // --------------------------------------------------------------------...
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 4469, 4786 ] }
24,660
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
function () public payable { revert(); }
// ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 4978, 5037 ] }
24,661
DarenHui
DarenHui.sol
0x1f1777bff69a8e5c880c9ebb79c9b94fe9883321
Solidity
DarenHui
contract DarenHui is ERC20Interface, Owned, SafeMath { string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; // ----------------------------------------...
// ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ----------------------------------------------------------------------------
LineComment
transferAnyERC20Token
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); }
// ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------
LineComment
v0.4.24+commit.e67f0147
bzzr://1bee4a34d93198419c8993a55abe4b8cd67ded258c7677725c184eb2656f6cf0
{ "func_code_index": [ 5270, 5459 ] }
24,662
PreCubeCoin
contracts/PreCubeCoin.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
PreCubeCoin
contract PreCubeCoin is ERC721("PreCubeCoin", "PCC"){ event Opened(address indexed from, uint256 indexed tokenId); modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } modifier onlyCollaborator() { bool isCollaborator = ...
withdraw
function withdraw() external onlyCollaborator { uint256 totalBalance = address(this).balance; for (uint256 i; i < collaborators.length; i++) { payable(collaborators[i].addr).transfer( mulScale(totalBalance, collaborators[i].cut, basisPoints) ); } }
/** * @dev Allows to withdraw the Ether in the contract and split it among the collaborators */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 1581, 1911 ] }
24,663
PreCubeCoin
contracts/PreCubeCoin.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
PreCubeCoin
contract PreCubeCoin is ERC721("PreCubeCoin", "PCC"){ event Opened(address indexed from, uint256 indexed tokenId); modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } modifier onlyCollaborator() { bool isCollaborator = ...
setBaseTokenURI
function setBaseTokenURI(string memory _uri) external onlyCollaborator { baseURI = _uri; }
/** * @dev Sets the base URI for the API that provides the NFT data. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 2003, 2112 ] }
24,664
PreCubeCoin
contracts/PreCubeCoin.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
PreCubeCoin
contract PreCubeCoin is ERC721("PreCubeCoin", "PCC"){ event Opened(address indexed from, uint256 indexed tokenId); modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } modifier onlyCollaborator() { bool isCollaborator = ...
setClaimPrice
function setClaimPrice(uint256 _claimPrice) external onlyCollaborator { claimPrice = _claimPrice; }
/** * @dev Sets the claim price for each token */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 2314, 2432 ] }
24,665
PreCubeCoin
contracts/PreCubeCoin.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
PreCubeCoin
contract PreCubeCoin is ERC721("PreCubeCoin", "PCC"){ event Opened(address indexed from, uint256 indexed tokenId); modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } modifier onlyCollaborator() { bool isCollaborator = ...
mint
function mint() external payable callerIsUser mintStarted { require(msg.value >= claimPrice, "Not enough Ether to mint a cube"); require( claimedTokenPerWallet[msg.sender] < maxClaimsPerWallet, "You cannot claim more cubes." ); require(totalMintedTokens < totalTokens, "No cubes...
// END ONLY COLLABORATORS
LineComment
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 2701, 3223 ] }
24,666
PreCubeCoin
contracts/PreCubeCoin.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
PreCubeCoin
contract PreCubeCoin is ERC721("PreCubeCoin", "PCC"){ event Opened(address indexed from, uint256 indexed tokenId); modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } modifier onlyCollaborator() { bool isCollaborator = ...
mulScale
function mulScale( uint256 x, uint256 y, uint128 scale ) internal pure returns (uint256) { uint256 a = x / scale; uint256 b = x % scale; uint256 c = y / scale; uint256 d = y % scale; return a * c * scale + a * d + b * c + (b * d) / scale; }
// INTERNAL
LineComment
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 3370, 3699 ] }
24,667
PreCubeCoin
contracts/PreCubeCoin.sol
0x26a65227be0973f455945d7f89a7a539b059bf78
Solidity
PreCubeCoin
contract PreCubeCoin is ERC721("PreCubeCoin", "PCC"){ event Opened(address indexed from, uint256 indexed tokenId); modifier callerIsUser() { require(tx.origin == msg.sender, "The caller is another contract"); _; } modifier onlyCollaborator() { bool isCollaborator = ...
_baseURI
function _baseURI() internal view virtual override returns (string memory) { return baseURI; }
/** * @dev See {ERC721}. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://134ad9259b7e3fb9b5582c316e706337f649f1d3bff6dd6ac5a664e77c90b0cd
{ "func_code_index": [ 3757, 3870 ] }
24,668
Arexium
Arexium.sol
0xe256bb0b2a3457e54db3a41cf5a8b826aca222a8
Solidity
Arexium
contract Arexium { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf;...
Arexium
function Arexium ( uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol ) { balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens totalSupply = initialSupply; // Update total supply name = toke...
/* Initializes contract with initial supply tokens to the creator of the contract */
Comment
v0.4.11+commit.68ef5810
bzzr://3a2d203e27af0a57f25020b3eee0ae05429c0f2425747dace3e2ccfb1d017503
{ "func_code_index": [ 763, 1408 ] }
24,669
Arexium
Arexium.sol
0xe256bb0b2a3457e54db3a41cf5a8b826aca222a8
Solidity
Arexium
contract Arexium { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf;...
transfer
function transfer(address _to, uint256 _value) { if (_to == 0x0) revert(); // Prevent transfer to 0x0 address. Use burn() instead if (balanceOf[msg.sender] < _value) revert(); // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) revert();...
/* Send coins */
Comment
v0.4.11+commit.68ef5810
bzzr://3a2d203e27af0a57f25020b3eee0ae05429c0f2425747dace3e2ccfb1d017503
{ "func_code_index": [ 1433, 2104 ] }
24,670
Arexium
Arexium.sol
0xe256bb0b2a3457e54db3a41cf5a8b826aca222a8
Solidity
Arexium
contract Arexium { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf;...
approve
function approve(address _spender, uint256 _value) returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
/* Allow another contract to spend some tokens in your behalf */
Comment
v0.4.11+commit.68ef5810
bzzr://3a2d203e27af0a57f25020b3eee0ae05429c0f2425747dace3e2ccfb1d017503
{ "func_code_index": [ 2177, 2346 ] }
24,671
Arexium
Arexium.sol
0xe256bb0b2a3457e54db3a41cf5a8b826aca222a8
Solidity
Arexium
contract Arexium { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf;...
approveAndCall
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } }
/* Approve and then communicate the approved contract in a single tx */
Comment
v0.4.11+commit.68ef5810
bzzr://3a2d203e27af0a57f25020b3eee0ae05429c0f2425747dace3e2ccfb1d017503
{ "func_code_index": [ 2426, 2770 ] }
24,672
Arexium
Arexium.sol
0xe256bb0b2a3457e54db3a41cf5a8b826aca222a8
Solidity
Arexium
contract Arexium { /* Public variables of the token */ string public standard = 'Token 0.1'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf;...
transferFrom
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { if (_to == 0x0) (revert()); // Prevent transfer to 0x0 address. Use burn() instead if (balanceOf[_from] < _value) revert(); // Check if the sender has enough if (balan...
/* A contract attempts to get the coins */
Comment
v0.4.11+commit.68ef5810
bzzr://3a2d203e27af0a57f25020b3eee0ae05429c0f2425747dace3e2ccfb1d017503
{ "func_code_index": [ 2821, 3617 ] }
24,673
NFTArtGenPresale
@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol
0xce6b30c9ddbfe895bea6f6910673f4a70ac22951
Solidity
IERC1155MetadataURI
interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
/** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */
NatSpecMultiLine
uri
function uri(uint256 id) external view returns (string memory);
/** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */
NatSpecMultiLine
v0.8.4+commit.c7e474f2
None
ipfs://f487e606c495603b45eddf5b72ccee7a2973f63c7b6613caa8a7e0d3b89bf8ec
{ "func_code_index": [ 248, 316 ] }
24,674
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
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; }...
//-----------------------------------------
LineComment
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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 261, 321 ] }
24,675
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
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; }...
//-----------------------------------------
LineComment
transferOwnership
function transferOwnership(address newOwner) public onlyOwner { 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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 640, 821 ] }
24,676
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
mul
function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; }
/** * @dev Multiplies two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 89, 272 ] }
24,677
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
div
function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
/** * @dev Integer division of two numbers, truncating the quotient. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 356, 629 ] }
24,678
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
sub
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
/** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 744, 860 ] }
24,679
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
SafeMath
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbe...
add
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; }
/** * @dev Adds two numbers, throws on overflow. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 924, 1060 ] }
24,680
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token...
totalSupply
function totalSupply() public view returns (uint256) { return totalSupply_; }
/** * @dev total number of tokens in existence */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 199, 287 ] }
24,681
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token...
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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 445, 841 ] }
24,682
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
BasicToken
contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token...
balanceOf
function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; }
/** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 1047, 1159 ] }
24,683
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal 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 transf...
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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 401, 858 ] }
24,684
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal 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 transf...
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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 1490, 1685 ] }
24,685
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal 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 transf...
allowance
function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; }
/** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 2009, 2140 ] }
24,686
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal 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 transf...
increaseApproval
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
/** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spend...
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 2606, 2875 ] }
24,687
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
StandardToken
contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal 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 transf...
decreaseApproval
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approva...
/** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spend...
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 3346, 3761 ] }
24,688
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
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 ...
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(address(0), _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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 483, 766 ] }
24,689
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
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 ...
finishMinting
function finishMinting() onlyOwner canMint 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://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 883, 1030 ] }
24,690
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
BurnableToken
contract BurnableToken is MintableToken { 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 <= balances[msg.sender]); // no need to...
burn
function burn(uint256 _value) public { 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; balances[burner] = balances[bur...
/** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 215, 696 ] }
24,691
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
Crowdsale
function Crowdsale(uint256 _rate, address _wallet, PPToken _token) public { require(_rate > 0); require(_wallet != address(0)); require(_token != address(0)); rate = _rate; wallet = _wallet; token = _token; }
/** * @param _rate Number of token units a buyer gets per wei * @param _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 855, 1101 ] }
24,692
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
function () external payable { buyTokens(msg.sender); }
/** * @dev fallback function ***DO NOT OVERRIDE*** */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 1302, 1368 ] }
24,693
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
buyTokens
function buyTokens(address _beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 totalTokens = _getTokenAmount(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); _processPur...
/** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 1507, 2090 ] }
24,694
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
_preValidatePurchase
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {}
/** * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 2522, 2611 ] }
24,695
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
_postValidatePurchase
function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {}
/** * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 2891, 2981 ] }
24,696
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
_deliverTokens
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transfer(_beneficiary, _tokenAmount); }
/** * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 3248, 3383 ] }
24,697
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
_processPurchase
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); }
/** * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 3634, 3771 ] }
24,698
PPTokenCrowdsale
PPTokenCrowdsale.sol
0x0746c91dd2d0d657b41f4411bd5535608755278f
Solidity
Crowdsale
contract Crowdsale { using SafeMath for uint256; // The token being sold PPToken public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** *...
//-----------------------------------------
LineComment
_updatePurchasingState
function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal {}
/** * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) * @param _beneficiary Address receiving the tokens * @param _weiAmount Value in wei involved in the purchase */
NatSpecMultiLine
v0.4.21+commit.dfe3193c
bzzr://c70a7d4c7f89cb64759335d8b61cf47abf42d28682d7a2a4fb7a0a808b4083be
{ "func_code_index": [ 4028, 4119 ] }
24,699