Token 10X: Africa's First Cryptocurrency Hub
Fortuna LUCK Token
100% of what players commit goes straight to the lottery pool. No host, no need for trust, the lottery is decentralized and community-run. Draw every two days, random numbers are verifiable by anyone. Good #LUCK!
...
About Fortuna LUCK
100% of what players commit goes straight to the lottery pool. No host, no need for trust, the lottery is decentralized and community-run. Draw every two days, random numbers are verifiable by anyone. Good #LUCK!
102 total visits
Token information and links
Circulating Supply
7777777777000000000
Token Contract (BSC Chain)
0X3660C6D58D1A1B9BE954BE11793A87FECF79F79E
Contract license: None
Launch Date
09/07/2022
KYC Information
No
Audit Information
None
Team Information
Team leader: None
Team leader contact: None
Contract source code
{"fortuna.sol":{"content":"// SPDX-License-Identifier: Unlicensed\nimport \"./VRFConsumerBaseV2.sol\";\nimport \"./VRFCoordinatorV2Interface.sol\";\n\npragma solidity ^0.8.14;\n\ninterface IBEP20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the token decimals.\n */\n function decimals() external view returns (uint8);\n\n /**\n * @dev Returns the token symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the token name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the bep token owner.\n */\n function getOwner() external view returns (address);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address _owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender\u0027s allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller\u0027s\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\ncontract Context {\n function _msgSender() internal view returns (address payable) {\n return payable(msg.sender);\n }\n\n function _msgData() internal view returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n\n/**\n * @dev Wrappers over Solidity\u0027s arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it\u0027s recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity\u0027s ` ` operator.\n *\n * Requirements:\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a b;\n require(c \u003e= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity\u0027s `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity\u0027s `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b \u003c= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity\u0027s `*` operator.\n *\n * Requirements:\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\n // benefit is lost if \u0027b\u0027 is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b \u003e 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c a % b); // There is no case in which this doesn\u0027t hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message when dividing by zero.\n *\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n\n/*\n* PancakeSwap interfaces\n* We use uniswap libraries here but pancakeswap is pretty much the same, so we get all the functions we need from uniswap, but importing pancakeswap is broken right now\n* which is a fuck up on their part, it\u0027s sad that such a huge dex copies another huge dex nearly 1 to 1 and they still manage to fuck something up \n*/\n\ninterface IPancakeFactory {\n event PairCreated(address indexed token0, address indexed token1, address pair, uint);\n\n function feeTo() external view returns (address);\n function feeToSetter() external view returns (address);\n\n function getPair(address tokenA, address tokenB) external view returns (address pair);\n function allPairs(uint) external view returns (address pair);\n function allPairsLength() external view returns (uint);\n\n function createPair(address tokenA, address tokenB) external returns (address pair);\n\n function setFeeTo(address) external;\n function setFeeToSetter(address) external;\n}\n\ninterface IPancakeRouter01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint amountADesired,\n uint amountBDesired,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB, uint liquidity);\n function addLiquidityETH(\n address token,\n uint amountTokenDesired,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n function removeLiquidity(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETH(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountToken, uint amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountA, uint amountB);\nfunction removeLiquidityETHWithPermit(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountToken, uint amountETH);\nfunction swapExactTokensForTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapTokensForExactTokens(\n uint amountOut,\n uint amountInMax,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}\n\n// File: contracts\\interfaces\\IPancakeRouter02.sol\n\ninterface IPancakeRouter02 is IPancakeRouter01 {\n function removeLiquidityETHSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountETH);\n\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\nfunction swapExactETHForTokensSupportingFeeOnTransferTokens(\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external payable;\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n}\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n */\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n\n\n\ncontract BEP20Token is Context, IBEP20, Ownable, VRFConsumerBaseV2 {\n using SafeMath for uint256;\n\n mapping (address =\u003e uint256) private _balances;\n\n mapping (address =\u003e mapping (address =\u003e uint256)) private _allowances;\n\n uint256 private _totalSupply;\n uint8 private _decimals;\n string private _symbol;\n string private _name;\n bytes32 internal keyHash;\n\n uint burnFee = 1;\n uint reflectionFee = 2;\n uint lotteryPoolFee = 2;\n uint liquidityFee = 5;\n\n bool isLaunched = false; // will be set to true after we launch\n\n uint64 s_subscriptionId;\n address vrfCoordinator = 0xc587d9053cd1118f25F645F9E08BB98c9712A4EE;\n bytes32 s_keyHash = 0xba6e730de88d94a5510ae6613898bfb0c3de5d16e609c5b7da808747125506f7;\n uint32 callbackGasLimit = 500000; \n uint16 requestConfirmations = 3;\n VRFCoordinatorV2Interface COORDINATOR;\n address s_owner;\n uint lotteryDrawTime = 1657558800; // time to draw the first lottery \n\n // Reflection variables:\n mapping (address =\u003e uint256) private _totalReflectionsOnLastReflection; // amount of total reflections on the last reflection of funds from totalreflections to balance\n uint256 totalReflections;\n uint256 private _totalSupplyWithoutExcluded = 7777777777 * (10 ** 9); // initially it\u0027s same as total supply\n mapping (address =\u003e bool) private _isExcluded;\n uint256 transferredRewardsForBalance; \n\n uint256 liquidityFeeTotal; // funds from fees waiting to be added to the liquidity pool\n bool inSwap; // checks if the contract is right now swapping \n event SwappedAndAddedLiquidity(uint256 tokensSwapped, uint256 bnbRecieved, uint256 tokensInLiquidity);\n\n // goes into variables:\n IPancakeRouter02 public immutable pancakeRouter;\n address public immutable pancakePair;\n\n modifier lockTheSwap {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor(uint64 subscriptionId) VRFConsumerBaseV2(vrfCoordinator) {\n _name = \"Fortuna\";\n _symbol = \"LUCK\";\n _decimals = 9;\n _totalSupply = 7777777777 * (10 ** 9); // 7.7 billion\n _balances[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n\n COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator);\n s_owner = msg.sender;\n s_subscriptionId = subscriptionId;\n\n IPancakeRouter02 _pancakeRouter = IPancakeRouter02(0x10ED43C718714eb63d5aA57B78B54704E256024E); // we set the router address to pancakeswap\u0027s\n pancakePair = IPancakeFactory(_pancakeRouter.factory()) // to avoid bugs we use uniswap interfaces, but to avoid confusion we change the naming here to pancakeswap\n // same as WETH is actually WBNB here, but we can\u0027t change this\n .createPair(address(this), _pancakeRouter.WETH()); // create a pair for this token: BEP20 \u003c-\u003e WBNB\n pancakeRouter = _pancakeRouter;\n }\n\n /**\n * @dev Returns the bep token owner.\n */\n function getOwner() external view returns (address) {\n return owner();\n }\n\n /**\n * @dev Returns the token decimals.\n */\n function decimals() external view returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev Returns the token symbol.\n */\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the token name.\n */\n function name() external view returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {BEP20-totalSupply}.\n */\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {BEP20-balanceOf}.\n */\n function balanceOf(address account) public override view returns (uint256) {\n if (_isExcluded[account]) return _balances[account];\n return _balances[account].add(totalReflections.mul(_balances[account]).div(_totalSupplyWithoutExcluded)).sub(_totalReflectionsOnLastReflection[account].mul(_balances[account]).div(_totalSupplyWithoutExcluded));\n }\n\n /**\n * @dev See {BEP20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) external returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {BEP20-allowance}.\n */\n function allowance(address owner, address spender) external view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {BEP20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) external returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {BEP20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {BEP20};\n *\n * Requirements:\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for `sender`\u0027s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"BEP20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {BEP20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {BEP20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"BEP20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n require(amount \u003e= 1000 * (10 ** 9)); // this is to discourage people from transacting every few minutes just to get reflections on thier reflections\n if (sender != owner()) {\n require(amount \u003c= 37777777 * (10 ** 9)); // require that one transnaction is less than around 0.5% of the total supply\n }\n if (lotteryDrawTime \u003c block.timestamp) { // initiate the draw if a transaction happens over two days after last draw \n requestRandomNumber();\n lotteryDrawTime = block.timestamp.add(172800); // leap seconds don\u0027t matter as we don\u0027t need to be exactly precise here, thus it is sufficient to measure time using block.timestamp, here we add two days until the next draw\n }\n if (recipient == address(this)) { // if the sender is entering the lottery\n enterThroughTransfer(amount);\n }\n else {\n uint256 originalAmount = amount;\n amount = amount.mul(9).div(10); // take the fee, 2% will go for reflection, 2% for lottery pool, 1% will be left untouched (burned basically) and 5% for liquidity pool\n /*\n reflection rewards are transferred back to the main balance on a transaction, you don\u0027t get reflections on your reflections until you transact. With the 2% of each\n transaction being reflected, it starts to make slight difference to get reflections on reflections when you hold over 0.1% of the total supply and the whole \n supply of the token gets moved, but then rewards you make on reflections on reflections will be less than the gas fees you spend on the transaction, so the problem\n with users transacting to get reflections on reflections gaining unfair advantage naturally resolves itself.\n */\n if (_isExcluded[sender]) {\n _totalSupplyWithoutExcluded = _totalSupplyWithoutExcluded.add(originalAmount);\n }\n else {\n _totalReflectionsOnLastReflection[sender] = totalReflections;\n _balances[sender] = _balances[sender].add(totalReflections.mul(_balances[sender]).div(_totalSupplyWithoutExcluded)).sub(_totalReflectionsOnLastReflection[sender].mul(_balances[sender]).div(_totalSupplyWithoutExcluded)); \n }\n if (_isExcluded[recipient]) {\n _totalSupplyWithoutExcluded = _totalSupplyWithoutExcluded.sub(amount);\n }\n else {\n _totalReflectionsOnLastReflection[recipient] = totalReflections;\n _balances[recipient] = _balances[recipient].add(totalReflections.mul(_balances[recipient]).div(_totalSupplyWithoutExcluded)).sub(_totalReflectionsOnLastReflection[recipient].mul(_balances[recipient]).div(_totalSupplyWithoutExcluded)); \n }\n _balances[address(this)] = _balances[address(this)].add(originalAmount.div(50)); // add 2% of the amount to the lottery pool\n _totalSupplyWithoutExcluded = _totalSupplyWithoutExcluded.sub(originalAmount.div(10)); // make sure that the whole fee gets excluded from the supply without reflections\n totalReflections = totalReflections.add(originalAmount.div(50)); // reflect 2% of the amount\n liquidityFeeTotal = liquidityFeeTotal.add(originalAmount.div(20)); // add 5% of the amount to the liquidity pool\n if (liquidityFeeTotal \u003e 7777777 * (10 ** 9)) {\n if (!lotteryClosed) {\n if (isLaunched) {\n if (!inSwap) {\n swapAndAddLiquidity(liquidityFeeTotal);\n }\n }\n }\n }\n _balances[sender] = _balances[sender].sub(originalAmount, \"BEP20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n }\n\n function _transferWithoutFee(address sender, address recipient, uint256 amount) internal {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n // check only sender because contract address is always excluded\n if (!_isExcluded[sender]) {\n _totalReflectionsOnLastReflection[sender] = totalReflections;\n _balances[sender] = _balances[sender].add(totalReflections.mul(_balances[sender]).div(_totalSupplyWithoutExcluded)).sub(_totalReflectionsOnLastReflection[sender].mul(_balances[sender]).div(_totalSupplyWithoutExcluded)); \n _totalSupplyWithoutExcluded = _totalSupplyWithoutExcluded.sub(amount);\n }\n\n _balances[sender] = _balances[sender].sub(amount, \"BEP20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n function _transferWinningsWithoutFee(address sender, address recipient, uint256 amount) internal {\n require(sender != address(0), \"BEP20: transfer from the zero address\");\n require(recipient != address(0), \"BEP20: transfer to the zero address\");\n // check only recipient because contract address is always excluded\n if (!_isExcluded[recipient]) {\n _totalReflectionsOnLastReflection[recipient] = totalReflections;\n _balances[recipient] = _balances[recipient].add(totalReflections.mul(_balances[recipient]).div(_totalSupplyWithoutExcluded)).sub(_totalReflectionsOnLastReflection[recipient].mul(_balances[recipient]).div(_totalSupplyWithoutExcluded)); \n _totalSupplyWithoutExcluded = _totalSupplyWithoutExcluded.add(amount);\n }\n\n _balances[sender] = _balances[sender].sub(amount, \"BEP20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** \n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal {\n require(account != address(0), \"BEP20: burn from the zero address\");\n\n _balances[account] = _balances[account].sub(amount, \"BEP20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n _totalSupplyWithoutExcluded = _totalSupplyWithoutExcluded.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.\n *\n * This is internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal {\n require(owner != address(0), \"BEP20: approve from the zero address\");\n require(spender != address(0), \"BEP20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`.`amount` is then deducted\n * from the caller\u0027s allowance.\n *\n * See {_burn} and {_approve}.\n */\n function _burnFrom(address account, uint256 amount) internal {\n _burn(account, amount);\n _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, \"BEP20: burn amount exceeds allowance\"));\n }\n\n function launched() public onlyOwner {\n isLaunched = true;\n }\n\n /**\n Starting with the lottery part\n */\n\n mapping (address =\u003e uint256) p_ticketAmount; // Pitfall: the mapping is referencing to the ticketsArray, each player is assigned an ID not their ticket amount here\n mapping (uint256 =\u003e address) p_ids; // Same mapping as p_ticketAmount but flipped\n uint256[] ticketsArray;\n uint256 totalTicketAmount;\n uint256 public lotteryId = 1;\n uint256 playerId;\n uint256 playersAmount;\n uint256 randomNumber;\n uint256 basicRandomNumber;\n bool lotteryClosed;\n uint256[] public s_randomWords;\n uint256 public s_requestId;\n uint32 numWords;\n \n event RequestedRandomNumber(uint indexed requestId);\n\n function requestRandomNumber() internal returns (uint256 requestId) {\n if (balanceOf(address(this)) \u003e 77777777 * (10 ** 9)) {\n numWords = uint32(balanceOf(address(this)).div(7777777 * (10 ** 9)) - 8); // get the number of random numbers to get for the different winners if the pool is over 1% of the total supply\n // notice: since the max number of random numbers we can request per one request is 500, this part of code will revert after over 50.8(9)% of the total supply is in the pool,\n // but it\u0027s too much for one draw and this won\u0027t likely happen ever. We implement a fix though by not selecting more than 500 winners and leave the rest of money for next lottery. \n // This situation is purely hypothetical and it is very unlikely it will happen\n if (numWords \u003e= 500) {\n numWords = 500;\n }\n }\n else {\n numWords = 1;\n }\n lotteryClosed = true;\n requestId = COORDINATOR.requestRandomWords(\n s_keyHash,\n s_subscriptionId,\n requestConfirmations,\n callbackGasLimit,\n numWords\n );\n emit RequestedRandomNumber(requestId);\n }\n\n function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {\n s_randomWords = randomWords;\n }\n\n function changeCallBackGasLimit(uint32 callBackGas) public onlyOwner {\n callbackGasLimit = callBackGas;\n }\n\n function enterThroughTransfer(uint256 transactionAmount) internal { // This function is for normal entering through transfer as per buying tickets guide on our website\n require(!lotteryClosed);\n _transferWithoutFee(msg.sender, address(this), transactionAmount); // transfer the ticket amount to the smart contract\u0027s balance (1 ticket = 1000 LUCK), no fee on lottery tickets\n totalTicketAmount = totalTicketAmount.add(transactionAmount.div(1000 * (10 ** 9))); \n if (p_ticketAmount[msg.sender] != 0) { // check if player previously had any tickets by checking if entry in mapping with the particular player isn\u0027t default\n playerId = p_ticketAmount[msg.sender];\n ticketsArray[playerId] = ticketsArray[playerId].add(transactionAmount.div(1000 * (10 ** 9))); // assign the tickets amount to the player\u0027s address \n }\n else {\n p_ticketAmount[msg.sender] = playersAmount;\n p_ids[playersAmount] = msg.sender;\n ticketsArray.push(transactionAmount.div(1000 * (10 ** 9))); \n playersAmount ;\n }\n }\n\n function enter(uint256 ticketAmount) public payable { // This function is for entering directly calling the enter function, mostly reserved for the web3 app which we will develop in Phase 2\n require(!lotteryClosed);\n require(ticketAmount != 0);\n _transferWithoutFee(msg.sender, address(this), ticketAmount.mul(1000 * (10 ** 9))); // transfer the ticket amount to the smart contract\u0027s escrow (1 ticket = 1000 LUCK), no fee on lottery tickets\n totalTicketAmount = totalTicketAmount.add(ticketAmount); \n if (p_ticketAmount[msg.sender] != 0) { // check if player previously had any tickets by checking if entry in mapping with the particular player isn\u0027t default\n playerId = p_ticketAmount[msg.sender];\n ticketsArray[playerId] = ticketsArray[playerId].add(ticketAmount); // assign the tickets amount to the player\u0027s address \n }\n else {\n p_ticketAmount[msg.sender] = playersAmount;\n p_ids[playersAmount] = msg.sender;\n ticketsArray.push(ticketAmount); \n playersAmount ;\n }\n }\n\n function weightedRandom(uint256 randomWordNumber) internal returns (uint256) {\n randomNumber = s_randomWords[randomWordNumber].mod(totalTicketAmount); // get the random number\n for (uint256 i = 0; i \u003c playersAmount; i ) {\n if (randomNumber \u003c ticketsArray[i]) {\n return i; // return the location at which the player\u0027s address is \n }\n randomNumber -= ticketsArray[i];\n }\n return 0; // The algorithm does not return the winning ticket if the winning ticket is the first one purchased. If it goes through the whole loop\n // and doesn\u0027t select anybody, it means the winning ticket is the first one purchased so we return the ID of the first ticket.\n }\n \n function draw() public { // anyone can draw the lottery if they want, but i will be always there to draw it in case nobody does it.\n require(lotteryClosed);\n require(s_randomWords[0] != 0); // require that we already got the values of the random number back \n address winner = p_ids[weightedRandom(0)];\n if (balanceOf(address(this)) \u003e 77777777 * (10 ** 9)) { // if the amount is greater than roughly 1% of the total supply, one winner hits jackpot and rest is distributed between other people\n _transferWinningsWithoutFee(address(this), winner, 77777777 * (10 ** 9)); // give the main award\n _transferWinningsWithoutFee(address(this), p_ids[weightedRandom(1)], balanceOf(address(this)).mod(7777777 * (10 ** 9))); // give the extra award\n for (uint256 i = 2; i \u003c numWords; i ) {\n _transferWinningsWithoutFee(address(this), p_ids[weightedRandom(i)], 7777777 * (10 ** 9)); // give all secondary awards\n }\n }\n else {\n _transferWinningsWithoutFee(address(this), winner, balanceOf(address(this))); // winnings are not taxed \n }\n for (uint256 i = 0; i \u003c playersAmount; i ) {\n delete p_ticketAmount[p_ids[i]]; // delete the mapping entries to make place for the new lottery\n delete p_ids[i];\n }\n delete ticketsArray; // delete the array with ticket weights\n delete totalTicketAmount; // delete other variables related to one episode of lottery\n delete playersAmount;\n delete s_randomWords;\n lotteryClosed = false;\n }\n\n function getLotteryPool() public view returns (uint256) {\n return _balances[address(this)]; // we will multiply the ticket amount by 1000 to get our lottery pool in our web3 app\n }\n\n function getNextLotteryTime() public view returns (uint256) {\n return lotteryDrawTime;\n }\n\n function revertLottery() public onlyOwner { // this function is to make sure that we don\u0027t get stuck in a forever loop of lotteries when something with Chainlink VRF fails. The function returns everyone the tokens they purchased tickets with.\n for (uint i = 0; i \u003c playersAmount; i ) {\n _balances[p_ids[i]] = _balances[p_ids[i]].add(ticketsArray[i].mul(1000 * (10 ** 9)));\n delete p_ticketAmount[p_ids[i]]; // delete the mapping entries to make place for the new lottery\n delete p_ids[i];\n }\n delete ticketsArray; // delete the array with ticket weights\n delete totalTicketAmount; // delete other variables related to one episode of lottery\n delete playersAmount;\n delete s_randomWords;\n lotteryClosed = false;\n }\n\n /**\n Reflection functionality\n Most of it is implemented upwards, check _transfer() and balanceOf()\n */\n\n function isExcluded(address account) public view returns (bool) {\n return _isExcluded[account];\n }\n\n function excludeAccount(address account) public onlyOwner returns (bool) {\n require(!_isExcluded[account], \"Account is already excluded\");\n _isExcluded[account] = true;\n return true;\n }\n\n // this function treats the included in reward as if they just got their rewards reflected back to their actual balance, but instead of them going to thier\n // actual balance, they get back to the total reflections pool to avoid including a whale lowering the rate of rewards for every user. The included user again\n // must start collecting their reflections from scratch, but reflections that he would have gained get distributed between all other users.\n function includeInReward(address account) public onlyOwner {\n require(_isExcluded[account]);\n totalReflections = _balances[account].add(totalReflections.mul(_balances[account]).div(_totalSupplyWithoutExcluded)).sub(_totalReflectionsOnLastReflection[account].mul(_balances[account]).div(_totalSupplyWithoutExcluded)); \n _totalReflectionsOnLastReflection[account] = totalReflections;\n _isExcluded[account] = false;\n }\n\n /**\n Automated Liquidity Acquisition and PancakeSwap \n */\n receive() external payable {}\n\n function swapAndAddLiquidity(uint256 liquidityBalance) private lockTheSwap {\n uint256 tokenToBeLeft = liquidityBalance.div(2); \n uint256 tokenToBeSold = liquidityBalance.sub(tokenToBeLeft);\n\n uint256 contractBalance = address(this).balance; // capture contract\u0027s balance to make sure that only what gets swapped here gets added to LP\n\n _balances[address(this)] = _balances[address(this)].add(liquidityBalance); // add all the liquidity balance to the smart contract\u0027s balance. \n // We make sure that lottery is not currently being drawn while this happens so that the winner of the lottery will not additionally get this. \n swapTokensForBNB(tokenToBeSold);\n\n uint256 BNBFromSwap = address(this).balance.sub(contractBalance); // how much BNB have we recieved \n\n addLiquidity(tokenToBeLeft, BNBFromSwap); // adds liquidity\n\n emit SwappedAndAddedLiquidity(tokenToBeLeft, BNBFromSwap, tokenToBeSold);\n }\n\n function swapTokensForBNB(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = pancakeRouter.WETH();\n\n _approve(address(this), address(pancakeRouter), tokenAmount); // approve pancakeswap to swap our tokens\n \n // swap the tokens, the fee will be taken as to ensure trustlessness there is no function to exclude from fee. 50% will anyways back to the liquidity amount, and rest will reward users\n pancakeRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); \n }\n\n function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {\n _approve(address(this), address(pancakeRouter), tokenAmount);\n\n pancakeRouter.addLiquidityETH{value: bnbAmount}(\n address(this),\n tokenAmount,\n 0, // slippage is unavoidable\n 0, // same here\n address(this),\n block.timestamp\n );\n }\n}"},"VRFConsumerBaseV2.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/** ****************************************************************************\n * @notice Interface for contracts using VRF randomness\n * *****************************************************************************\n * @dev PURPOSE\n *\n * @dev Reggie the Random Oracle (not his real job) wants to provide randomness\n * @dev to Vera the verifier in such a way that Vera can be sure he\u0027s not\n * @dev making his output up to suit himself. Reggie provides Vera a public key\n * @dev to which he knows the secret key. Each time Vera provides a seed to\n * @dev Reggie, he gives back a value which is computed completely\n * @dev deterministically from the seed and the secret key.\n *\n * @dev Reggie provides a proof by which Vera can verify that the output was\n * @dev correctly computed once Reggie tells it to her, but without that proof,\n * @dev the output is indistinguishable to her from a uniform random sample\n * @dev from the output space.\n *\n * @dev The purpose of this contract is to make it easy for unrelated contracts\n * @dev to talk to Vera the verifier about the work Reggie is doing, to provide\n * @dev simple access to a verifiable source of randomness. It ensures 2 things:\n * @dev 1. The fulfillment came from the VRFCoordinator\n * @dev 2. The consumer contract implements fulfillRandomWords.\n * *****************************************************************************\n * @dev USAGE\n *\n * @dev Calling contracts must inherit from VRFConsumerBase, and can\n * @dev initialize VRFConsumerBase\u0027s attributes in their constructor as\n * @dev shown:\n *\n * @dev contract VRFConsumer {\n * @dev constructor(\u003cother arguments\u003e, address _vrfCoordinator, address _link)\n * @dev VRFConsumerBase(_vrfCoordinator) public {\n * @dev \u003cinitialization with other arguments goes here\u003e\n * @dev }\n * @dev }\n *\n * @dev The oracle will have given you an ID for the VRF keypair they have\n * @dev committed to (let\u0027s call it keyHash). Create subscription, fund it\n * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface\n * @dev subscription management functions).\n * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,\n * @dev callbackGasLimit, numWords),\n * @dev see (VRFCoordinatorInterface for a description of the arguments).\n *\n * @dev Once the VRFCoordinator has received and validated the oracle\u0027s response\n * @dev to your request, it will call your contract\u0027s fulfillRandomWords method.\n *\n * @dev The randomness argument to fulfillRandomWords is a set of random words\n * @dev generated from your requestId and the blockHash of the request.\n *\n * @dev If your contract could have concurrent requests open, you can use the\n * @dev requestId returned from requestRandomWords to track which response is associated\n * @dev with which randomness request.\n * @dev See \"SECURITY CONSIDERATIONS\" for principles to keep in mind,\n * @dev if your contract could have multiple requests in flight simultaneously.\n *\n * @dev Colliding `requestId`s are cryptographically impossible as long as seeds\n * @dev differ.\n *\n * *****************************************************************************\n * @dev SECURITY CONSIDERATIONS\n *\n * @dev A method with the ability to call your fulfillRandomness method directly\n * @dev could spoof a VRF response with any random value, so it\u0027s critical that\n * @dev it cannot be directly called by anything other than this base contract\n * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).\n *\n * @dev For your users to trust that your contract\u0027s random behavior is free\n * @dev from malicious interference, it\u0027s best if you can write it so that all\n * @dev behaviors implied by a VRF response are executed *during* your\n * @dev fulfillRandomness method. If your contract must store the response (or\n * @dev anything derived from it) and use it later, you must ensure that any\n * @dev user-significant behavior which depends on that stored value cannot be\n * @dev manipulated by a subsequent VRF request.\n *\n * @dev Similarly, both miners and the VRF oracle itself have some influence\n * @dev over the order in which VRF responses appear on the blockchain, so if\n * @dev your contract could have multiple VRF requests in flight simultaneously,\n * @dev you must ensure that the order in which the VRF responses arrive cannot\n * @dev be used to manipulate your contract\u0027s user-significant behavior.\n *\n * @dev Since the block hash of the block which contains the requestRandomness\n * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful\n * @dev miner could, in principle, fork the blockchain to evict the block\n * @dev containing the request, forcing the request to be included in a\n * @dev different block with a different hash, and therefore a different input\n * @dev to the VRF. However, such an attack would incur a substantial economic\n * @dev cost. This cost scales with the number of blocks the VRF oracle waits\n * @dev until it calls responds to a request. It is for this reason that\n * @dev that you can signal to an oracle you\u0027d like them to wait longer before\n * @dev responding to the request (however this is not enforced in the contract\n * @dev and so remains effective only in the case of unmodified oracle software).\n */\nabstract contract VRFConsumerBaseV2 {\n error OnlyCoordinatorCanFulfill(address have, address want);\n address private immutable vrfCoordinator;\n\n /**\n * @param _vrfCoordinator address of VRFCoordinator contract\n */\n constructor(address _vrfCoordinator) {\n vrfCoordinator = _vrfCoordinator;\n }\n\n /**\n * @notice fulfillRandomness handles the VRF response. Your contract must\n * @notice implement it. See \"SECURITY CONSIDERATIONS\" above for important\n * @notice principles to keep in mind when implementing your fulfillRandomness\n * @notice method.\n *\n * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this\n * @dev signature, and will call it once it has verified the proof\n * @dev associated with the randomness. (It is triggered via a call to\n * @dev rawFulfillRandomness, below.)\n *\n * @param requestId The Id initially returned by requestRandomness\n * @param randomWords the VRF output expanded to the requested number of words\n */\n function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;\n\n // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF\n // proof. rawFulfillRandomness then calls fulfillRandomness, after validating\n // the origin of the call\n function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {\n if (msg.sender != vrfCoordinator) {\n revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);\n }\n fulfillRandomWords(requestId, randomWords);\n }\n}\n"},"VRFCoordinatorV2Interface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface VRFCoordinatorV2Interface {\n /**\n * @notice Get configuration relevant for making requests\n * @return minimumRequestConfirmations global min for request confirmations\n * @return maxGasLimit global max for request gas limit\n * @return s_provingKeyHashes list of registered key hashes\n */\n function getRequestConfig()\n external\n view\n returns (\n uint16,\n uint32,\n bytes32[] memory\n );\n\n /**\n * @notice Request a set of random words.\n * @param keyHash - Corresponds to a particular oracle job which uses\n * that key for generating the VRF proof. Different keyHash\u0027s have different gas price\n * ceilings, so you can select a specific one to bound your maximum per request cost.\n * @param subId - The ID of the VRF subscription. Must be funded\n * with the minimum subscription balance required for the selected keyHash.\n * @param minimumRequestConfirmations - How many blocks you\u0027d like the\n * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS\n * for why you may want to request more. The acceptable range is\n * [minimumRequestBlockConfirmations, 200].\n * @param callbackGasLimit - How much gas you\u0027d like to receive in your\n * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords\n * may be slightly less than this amount because of gas used calling the function\n * (argument decoding etc.), so you may need to request slightly more than you expect\n * to have inside fulfillRandomWords. The acceptable range is\n * [0, maxGasLimit]\n * @param numWords - The number of uint256 random values you\u0027d like to receive\n * in your fulfillRandomWords callback. Note these numbers are expanded in a\n * secure way by the VRFCoordinator from a single random value supplied by the oracle.\n * @return requestId - A unique identifier of the request. Can be used to match\n * a request to a response in fulfillRandomWords.\n */\n function requestRandomWords(\n bytes32 keyHash,\n uint64 subId,\n uint16 minimumRequestConfirmations,\n uint32 callbackGasLimit,\n uint32 numWords\n ) external returns (uint256 requestId);\n\n /**\n * @notice Create a VRF subscription.\n * @return subId - A unique subscription id.\n * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.\n * @dev Note to fund the subscription, use transferAndCall. For example\n * @dev LINKTOKEN.transferAndCall(\n * @dev address(COORDINATOR),\n * @dev amount,\n * @dev abi.encode(subId));\n */\n function createSubscription() external returns (uint64 subId);\n\n /**\n * @notice Get a VRF subscription.\n * @param subId - ID of the subscription\n * @return balance - LINK balance of the subscription in juels.\n * @return reqCount - number of requests for this subscription, determines fee tier.\n * @return owner - owner of the subscription.\n * @return consumers - list of consumer address which are able to use this subscription.\n */\n function getSubscription(uint64 subId)\n external\n view\n returns (\n uint96 balance,\n uint64 reqCount,\n address owner,\n address[] memory consumers\n );\n\n /**\n * @notice Request subscription owner transfer.\n * @param subId - ID of the subscription\n * @param newOwner - proposed new owner of the subscription\n */\n function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;\n\n /**\n * @notice Request subscription owner transfer.\n * @param subId - ID of the subscription\n * @dev will revert if original owner of subId has\n * not requested that msg.sender become the new owner.\n */\n function acceptSubscriptionOwnerTransfer(uint64 subId) external;\n\n /**\n * @notice Add a consumer to a VRF subscription.\n * @param subId - ID of the subscription\n * @param consumer - New consumer which can use the subscription\n */\n function addConsumer(uint64 subId, address consumer) external;\n\n /**\n * @notice Remove a consumer from a VRF subscription.\n * @param subId - ID of the subscription\n * @param consumer - Consumer to remove from the subscription\n */\n function removeConsumer(uint64 subId, address consumer) external;\n\n /**\n * @notice Cancel a subscription\n * @param subId - ID of the subscription\n * @param to - Where to send the remaining LINK to\n */\n function cancelSubscription(uint64 subId, address to) external;\n}\n"}}