Request form
Contracts
Protocols
Discord
Dividend Paying Token with Buy/Sell Fee
Token
ERC20
Dividend
Fees
Audited
Docs
Source
ChefGPT

Dividend Paying Token with Buy/Sell Fee

Token that pays dividends, and has a fee on buys and sells. Users hold the token, and they receive LP over time that they can claim from the contract. Used in the VIRAL project.

sendValue(address,uint256) :
This function is used to send a specified amount of Ether from the contract's balance to a specified recipient address. It first checks to make sure that the contract has enough Ether in its balance to cover the amount being sent. If there is enough, it then calls the recipient address with the specified amount of Ether. If the call is successful, the Ether is sent to the recipient address. If the call fails, an error is thrown. (autogenerated documentation)
updateDividendTracker(address) :
This function updates the dividend tracker contract associated with the current contract. It takes in an address of the new dividend tracker contract as an argument. The function then creates a new instance of the VIRALDividendTracker contract at the address provided. It then excludes the address of the new dividend tracker, the address of the current contract, the owner's address, and the address of the router from receiving dividends. Finally, the dividendTracker variable is set to the new dividend tracker contract. (autogenerated documentation)
claim() :
This function allows users to claim their dividends from a contract. It requires that the claimEnabled boolean is set to true, and if it is, it calls the processAccount() function from the dividendTracker contract, passing in the address of the sender of the transaction (msg.sender) as a payable address. This function will then process the account of the sender, and distribute any dividends that are owed to them. (autogenerated documentation)
rescueETH20Tokens(address) :
This function is used to rescue ERC20 tokens that have been mistakenly sent to a contract address. It allows the owner of the contract to transfer the tokens back to their own address. The function takes in the address of the token contract as an argument and then uses the IERC20 interface to transfer the balance of the contract address to the owner's address. (autogenerated documentation)
forceSend() :
This function is used to transfer the balance of the contract's address to the treasury wallet. It does this by first checking the balance of the contract's address and then sending that amount of ETH to the treasury wallet. The function is marked as external, meaning that it can be called from outside the contract. (autogenerated documentation)
trackerRescueETH20Tokens(address) :
This function allows the owner of the contract to rescue ERC20 tokens that have been sent to the contract address. It does this by calling the trackerRescueETH20Tokens() function from the dividendTracker contract, passing in the owner's address and the address of the token to be rescued. The function then transfers the tokens from the contract address to the owner's address. (autogenerated documentation)
trackerForceSend() :
This function allows the owner of the contract to manually trigger the dividendTracker contract to send out dividends to all token holders. It works by calling the trackerForceSend() function on the dividendTracker contract, passing in the address of the owner as an argument. This function will then calculate the amount of dividends each token holder is owed and send them out accordingly. (autogenerated documentation)
updateRouter(address) :
This function allows the owner of the contract to update the router address. The function takes in a new router address as an argument and sets the router address to the new address. This function is only accessible to the owner of the contract, as indicated by the 'onlyOwner' modifier. (autogenerated documentation)
excludeFromFees(address,bool) :
This function allows the owner of the contract to exclude a specific address from paying fees. It takes two parameters, an address and a boolean value. The address is the account that is to be excluded from fees, and the boolean value is a flag that indicates whether the account should be excluded or not. The function checks to make sure that the account is not already set to the value of 'excluded' before setting the value of _isExcludedFromFees[account] to the value of excluded. Finally, the function emits an ExcludeFromFees event with the account and excluded values. (autogenerated documentation)
excludeMultipleAccountsFromFees(bool) :
This function allows the owner of the contract to exclude multiple accounts from fees. It takes an array of addresses (accounts) and a boolean (excluded) as parameters. The function then iterates through the array of addresses and sets the boolean value of the _isExcludedFromFees mapping for each address to the boolean value passed in as a parameter. Finally, the function emits an event to signal that the accounts have been excluded from fees. (autogenerated documentation)
excludeFromDividends(address,bool) :
This function allows the owner of the contract to exclude a specific address from receiving dividends. It takes two parameters, an address and a boolean value. If the boolean value is set to true, the address will be excluded from receiving dividends. The function calls the excludeFromDividends() function from the dividendTracker contract, which is responsible for tracking and distributing dividends. (autogenerated documentation)
setTreasuryWallet(address) :
This function allows the owner of the contract to set a new treasury wallet address. The function takes in an address parameter, which is the new wallet address, and sets the treasuryWallet variable to the new address. This function can only be called by the owner of the contract, as indicated by the "onlyOwner" modifier. (autogenerated documentation)
setDevWallet(address) :
This function allows the owner of the contract to set a new wallet address as the devWallet. The function is marked as external and onlyOwner, meaning that only the owner of the contract can call this function. When the function is called, the new wallet address passed in as an argument is set as the devWallet. (autogenerated documentation)
setSwapTokensAtAmount(uint256) :
This function allows the owner of the contract to set the amount of tokens that will be swapped for a given amount of Ether. The amount is specified in terms of wei, the smallest unit of Ether, and is multiplied by 10^18 to convert it to the correct amount. This function is used to set the rate at which tokens are exchanged for Ether. (autogenerated documentation)
setBuyTaxes(uint256,uint256,uint256,uint256) :
This function allows the owner of the contract to set the taxes for buying tokens. The function takes four parameters: _rewards, _treasury, _liquidity, and _dev. These parameters represent the percentage of the total buy amount that will be allocated to each of the four categories. The total of all four parameters must be less than or equal to 20%. The function then sets the buyTaxes variable to the Taxes struct with the given parameters and sets the totalBuyTax variable to the sum of the four parameters. (autogenerated documentation)
setSellTaxes(uint256,uint256,uint256) :
This function allows the owner of the contract to set the taxes for selling tokens. The function takes four parameters: _rewards, _treasury, _liquidity, and _dev. These parameters represent the percentage of the total sell tax that will be allocated to each of the four categories. The function requires that the sum of all four parameters must be less than or equal to 20%. If this condition is not met, the function will revert. Once the parameters are set, the sellTaxes variable is updated with the new values and the totalSellTax variable is updated with the sum of all four parameters. (autogenerated documentation)
setMaxBuyAndSell(uint256,uint256) :
This function allows the owner of the contract to set the maximum amount of tokens that can be bought and sold in a single transaction. The function takes two parameters, maxBuy and maxSell, which represent the maximum amount of tokens that can be bought and sold respectively. These values are then multiplied by 10^18 to convert them into the smallest denomination of the token (wei). The resulting values are then stored in the maxBuyAmount and maxSellAmount variables. (autogenerated documentation)
setSwapEnabled(bool) :
This function allows the owner of the contract to enable or disable the swap feature. When the swap feature is enabled, users can exchange tokens with each other. When the swap feature is disabled, users cannot exchange tokens with each other. The function takes a boolean parameter, which is set to true to enable the swap feature and false to disable it. (autogenerated documentation)
activateTrading() :
This function is used to enable trading on the contract. It can only be called by the owner of the contract and will require that trading is not already enabled. If these conditions are met, the function will set the boolean variable tradingEnabled to true, thus enabling trading on the contract. (autogenerated documentation)
setClaimEnabled(bool) :
This function is used to enable or disable the ability to make claims on the contract. It is an external function that can only be called by the contract owner. The function takes a boolean value as an argument, which is used to set the claimEnabled variable to either true or false. If set to true, users will be able to make claims on the contract. If set to false, users will not be able to make claims on the contract. (autogenerated documentation)
setBot(address,bool) :
This function allows the owner of the contract to set a given address as a bot or not. The function takes two parameters, an address and a boolean value. The address is the address of the bot that the owner wants to set, and the boolean value is a true or false value that indicates whether the address should be set as a bot or not. The function first checks to make sure that the address is not already set as the given value, and then sets the address as a bot or not depending on the boolean value. (autogenerated documentation)
setBulkBot(bool) :
This function is used to set the value of the boolean variable _isBot for a given array of addresses. It is an external function that can only be called by the contract owner. The function takes in an array of addresses and a boolean value as parameters. It then iterates through the array of addresses and sets the value of _isBot for each address to the boolean value that was passed in. (autogenerated documentation)
setLP_Token(address) :
This function allows the owner of the contract to set the address of the LP token associated with the contract. The function takes an address as an argument and calls the updateLP_Token() function in the dividendTracker contract, passing in the address of the LP token. This function allows the owner to update the address of the LP token associated with the contract, allowing them to switch to a different LP token if needed. (autogenerated documentation)
setAutomatedMarketMakerPair(address,bool) :
This function allows the owner of the contract to set an Automated Market Maker (AMM) pair. An AMM is a type of decentralized exchange that allows users to trade tokens without the need for a counterparty. The function takes two parameters: the address of the new AMM pair and a boolean value. The boolean value indicates whether the new pair should be enabled or disabled. If the value is set to true, the new pair will be enabled and users will be able to trade tokens on the new pair. If the value is set to false, the new pair will be disabled and users will not be able to trade tokens on the new pair. (autogenerated documentation)
_setAutomatedMarketMakerPair(address,bool) :
This function is used to set an Automated Market Maker (AMM) pair in the VIRAL contract. It takes two parameters: an address of the new pair and a boolean value. The function requires that the automatedMarketMakerPairs mapping does not already have the new pair set to the same value. If the boolean value is set to true, the new pair is excluded from dividends in the dividendTracker contract. Finally, the SetAutomatedMarketMakerPair event is emitted. (autogenerated documentation)
getTotalDividendsDistributed() :
This function is used to get the total amount of dividends that have been distributed to shareholders. It works by calling the totalDividendsDistributed() function from the dividendTracker contract, which returns the total amount of dividends that have been distributed. (autogenerated documentation)
isExcludedFromFees(address) :
This function checks whether a given Ethereum address is excluded from fees. It does this by accessing the _isExcludedFromFees mapping, which is a data structure that stores a boolean value for each address. If the address is found in the mapping, the function will return the corresponding boolean value, which indicates whether the address is excluded from fees or not. (autogenerated documentation)
withdrawableDividendOf(address) :
This function allows users to view the amount of withdrawable dividends associated with a given Ethereum address. It does this by calling the withdrawableDividendOf() function from the dividendTracker contract, which is responsible for tracking and managing the distribution of dividends. This function takes an Ethereum address as an argument and returns the amount of withdrawable dividends associated with that address as a uint256 value. (autogenerated documentation)
dividendTokenBalanceOf(address) :
This function returns the balance of a given account for a specific token. It does this by calling the balanceOf() function from the dividendTracker contract, which is responsible for tracking the token balances of each account. The function takes in an address as an argument and returns the balance of that address as a uint256. (autogenerated documentation)
getAccountInfo(address) :
This function is used to retrieve information about a given Ethereum account. It takes an address as an argument and returns a tuple containing the address, the total amount of dividends paid to the account, the total amount of dividends received from the account, the total amount of dividends sent from the account, and the total amount of dividends received by the account. The function calls the getAccount() function from the dividendTracker contract, which stores the information about the account in a mapping. The mapping is then used to retrieve the information and return it as a tuple. (autogenerated documentation)
airdropTokens(uint256[]) :
This function is an external function that is only accessible to the owner of the contract. It takes two parameters, an array of addresses and an array of uint256 values. The function requires that the two arrays have the same length. It then loops through the arrays and calls the _transfer function of the parent contract, sending the amount of tokens specified in the amounts array to the address specified in the accounts array. This allows the owner of the contract to airdrop tokens to multiple addresses at once. (autogenerated documentation)
_transfer(address,address,uint256) :
This function is an override of the _transfer function in the ERC20 contract. It is used to transfer tokens from one address to another. The function first checks to make sure that the addresses from and to are not the zero address. It then checks to see if trading is enabled, and if the addresses are not bots. If the addresses are not excluded from fees, it then checks to see if the amount is greater than the maxSellAmount or maxBuyAmount. If the amount is 0, it will transfer 0 tokens. The function then checks to see if the contract token balance is greater than the swapTokensAtAmount, and if swapping is enabled and the address is an automated market maker pair. If all of these conditions are met, it will swap and liquify the tokens. The function then checks to see if the addresses are excluded from fees, and if the addresses are automated market maker pairs. If both of these conditions are met, it will take a fee from the amount being transferred. The fee is calculated by multiplying the amount by the totalSellTax or totalBuyTax. Finally, the function will transfer the tokens from one address to another, and update the (autogenerated documentation)
swapAndLiquify(uint256) :
This function is used to swap tokens for ETH and add liquidity to a pool. It takes in a uint256 value representing the amount of tokens to be swapped and liquified. The function first divides the tokens into two parts, with half of the tokens being used to add liquidity and the other half being used to swap for ETH. The function then calls the swapTokensForETH() function to swap the tokens for ETH. After that, the function calls the addLiquidity() function to add the remaining tokens to the liquidity pool. Finally, the function distributes the taxes collected from the liquidity pool to the treasury wallet, the dev wallet, and the dividend tracker. The taxes are distributed based on the sellTaxes values set in the contract. (autogenerated documentation)
swapTokensForETH(uint256) :
This function is used to swap a given amount of tokens for ETH. It does this by first creating an array of two addresses, the first being the address of the contract and the second being the address of the router. It then calls the _approve function to approve the transfer of tokens from the contract to the router. Finally, it calls the router's swapExactTokensForETHSupportingFeeOnTransferTokens function, passing in the token amount, a fee of 0, the address array, the address of the contract, and the current block timestamp. This function will then swap the given amount of tokens for ETH. (autogenerated documentation)
addLiquidity(uint256,uint256) :
This function adds liquidity to a Uniswap exchange. It takes two parameters, tokenAmount and ethAmount, which represent the amount of tokens and ETH to be added to the exchange. First, it calls the _approve function to approve the exchange contract to transfer the tokenAmount of tokens from the caller's address. Then, it calls the addLiquidityETH function of the router contract, passing in the address of the exchange contract, the tokenAmount, and the current block timestamp. This function adds the specified amount of tokens and ETH to the exchange, allowing users to trade them. (autogenerated documentation)
trackerRescueETH20Tokens(address,address) :
This function is used to transfer all of the tokens held by the contract to a specified recipient address. It takes two parameters, the recipient address and the address of the token contract. The function first checks that the caller is the owner of the contract, and then it uses the IERC20 interface to transfer the balance of the contract to the recipient address. (autogenerated documentation)
trackerForceSend(address) :
This function is used to transfer the balance of the contract to a specified recipient address. It is only accessible by the contract owner and can only be called by the owner. The function first stores the balance of the contract in a variable called ETHbalance. It then sends the value of ETHbalance to the recipient address specified in the function argument. (autogenerated documentation)
updateLP_Token(address) :
This function allows the owner of the contract to update the address of the LP_Token. This is useful if the address of the LP_Token has changed for any reason. The function takes in the new address of the LP_Token as an argument and sets the LP_Token address to the new address. This ensures that the contract is always pointing to the correct address of the LP_Token. (autogenerated documentation)
_transfer(uint256) :
This function is an internal function that is used to override the transfer function of the contract. It prevents any transfers from being made by requiring that the function return false. This ensures that no tokens can be transferred from the contract, making it a non-transferable contract. (autogenerated documentation)
getAccount(address) :
This function is used to retrieve information about a given account from the contract. It takes an address as an argument and returns a tuple containing the address, the amount of withdrawable dividends, the total amount of dividends, the last claim time, and the total amount of dividends withdrawn. The function first creates a memory variable called info and assigns the address to it. It then retrieves the amount of withdrawable dividends and the total amount of dividends for the given address using the withdrawableDividendOf and accumulativeDividendOf functions. It also retrieves the last claim time for the given address from the lastClaimTimes mapping. Finally, it returns the address, the withdrawable dividends, the total dividends, the last claim time, and the total amount of dividends withdrawn. (autogenerated documentation)
setBalance(address,uint256) :
This function allows the owner of the contract to set the balance of a given account. It takes two parameters, an address of the account and a uint256 value for the new balance. The function first checks if the account is excluded from dividends, and if so, it returns without making any changes. Otherwise, it calls the _setBalance() function to set the new balance for the given account. (autogenerated documentation)
processAccount(address) :
This function is used to process an account and withdraw any dividends that the account is owed. It is an external function that can only be called by the owner of the contract. The function takes an address payable account as an argument and first calls the _withdrawDividendOfUser() function to get the amount of dividends that the account is owed. If the amount is greater than 0, the function updates the lastClaimTimes mapping to store the current block timestamp for the account, emits a Claim event with the account address and the amount of dividends, and returns true. If the amount of dividends is 0, the function returns false. (autogenerated documentation)
VIRAL.sol
DividendPayingToken.sol
Ownable.sol
IDex.sol
IERC20.sol
ERC20.sol
SafeMath.sol
DividendPayingTokenInterface.sol
Context.sol

2988 downloads

SatoshiViral / Dividend Paying Token with Buy/Sell Fee
Token
ERC20
Dividend
Fees
Audited
Docs
Source
ChefGPT
Expand
Share

Dividend Paying Token with Buy/Sell Fee

Token that pays dividends, and has a fee on buys and sells. Users hold the token, and they receive LP over time that they can claim from the contract. Used in the VIRAL project.

sendValue(address,uint256) :
This function is used to send a specified amount of Ether from the contract's balance to a specified recipient address. It first checks to make sure that the contract has enough Ether in its balance to cover the amount being sent. If there is enough, it then calls the recipient address with the specified amount of Ether. If the call is successful, the Ether is sent to the recipient address. If the call fails, an error is thrown. (autogenerated documentation)
updateDividendTracker(address) :
This function updates the dividend tracker contract associated with the current contract. It takes in an address of the new dividend tracker contract as an argument. The function then creates a new instance of the VIRALDividendTracker contract at the address provided. It then excludes the address of the new dividend tracker, the address of the current contract, the owner's address, and the address of the router from receiving dividends. Finally, the dividendTracker variable is set to the new dividend tracker contract. (autogenerated documentation)
claim() :
This function allows users to claim their dividends from a contract. It requires that the claimEnabled boolean is set to true, and if it is, it calls the processAccount() function from the dividendTracker contract, passing in the address of the sender of the transaction (msg.sender) as a payable address. This function will then process the account of the sender, and distribute any dividends that are owed to them. (autogenerated documentation)
rescueETH20Tokens(address) :
This function is used to rescue ERC20 tokens that have been mistakenly sent to a contract address. It allows the owner of the contract to transfer the tokens back to their own address. The function takes in the address of the token contract as an argument and then uses the IERC20 interface to transfer the balance of the contract address to the owner's address. (autogenerated documentation)
forceSend() :
This function is used to transfer the balance of the contract's address to the treasury wallet. It does this by first checking the balance of the contract's address and then sending that amount of ETH to the treasury wallet. The function is marked as external, meaning that it can be called from outside the contract. (autogenerated documentation)
trackerRescueETH20Tokens(address) :
This function allows the owner of the contract to rescue ERC20 tokens that have been sent to the contract address. It does this by calling the trackerRescueETH20Tokens() function from the dividendTracker contract, passing in the owner's address and the address of the token to be rescued. The function then transfers the tokens from the contract address to the owner's address. (autogenerated documentation)
trackerForceSend() :
This function allows the owner of the contract to manually trigger the dividendTracker contract to send out dividends to all token holders. It works by calling the trackerForceSend() function on the dividendTracker contract, passing in the address of the owner as an argument. This function will then calculate the amount of dividends each token holder is owed and send them out accordingly. (autogenerated documentation)
updateRouter(address) :
This function allows the owner of the contract to update the router address. The function takes in a new router address as an argument and sets the router address to the new address. This function is only accessible to the owner of the contract, as indicated by the 'onlyOwner' modifier. (autogenerated documentation)
excludeFromFees(address,bool) :
This function allows the owner of the contract to exclude a specific address from paying fees. It takes two parameters, an address and a boolean value. The address is the account that is to be excluded from fees, and the boolean value is a flag that indicates whether the account should be excluded or not. The function checks to make sure that the account is not already set to the value of 'excluded' before setting the value of _isExcludedFromFees[account] to the value of excluded. Finally, the function emits an ExcludeFromFees event with the account and excluded values. (autogenerated documentation)
excludeMultipleAccountsFromFees(bool) :
This function allows the owner of the contract to exclude multiple accounts from fees. It takes an array of addresses (accounts) and a boolean (excluded) as parameters. The function then iterates through the array of addresses and sets the boolean value of the _isExcludedFromFees mapping for each address to the boolean value passed in as a parameter. Finally, the function emits an event to signal that the accounts have been excluded from fees. (autogenerated documentation)
excludeFromDividends(address,bool) :
This function allows the owner of the contract to exclude a specific address from receiving dividends. It takes two parameters, an address and a boolean value. If the boolean value is set to true, the address will be excluded from receiving dividends. The function calls the excludeFromDividends() function from the dividendTracker contract, which is responsible for tracking and distributing dividends. (autogenerated documentation)
setTreasuryWallet(address) :
This function allows the owner of the contract to set a new treasury wallet address. The function takes in an address parameter, which is the new wallet address, and sets the treasuryWallet variable to the new address. This function can only be called by the owner of the contract, as indicated by the "onlyOwner" modifier. (autogenerated documentation)
setDevWallet(address) :
This function allows the owner of the contract to set a new wallet address as the devWallet. The function is marked as external and onlyOwner, meaning that only the owner of the contract can call this function. When the function is called, the new wallet address passed in as an argument is set as the devWallet. (autogenerated documentation)
setSwapTokensAtAmount(uint256) :
This function allows the owner of the contract to set the amount of tokens that will be swapped for a given amount of Ether. The amount is specified in terms of wei, the smallest unit of Ether, and is multiplied by 10^18 to convert it to the correct amount. This function is used to set the rate at which tokens are exchanged for Ether. (autogenerated documentation)
setBuyTaxes(uint256,uint256,uint256,uint256) :
This function allows the owner of the contract to set the taxes for buying tokens. The function takes four parameters: _rewards, _treasury, _liquidity, and _dev. These parameters represent the percentage of the total buy amount that will be allocated to each of the four categories. The total of all four parameters must be less than or equal to 20%. The function then sets the buyTaxes variable to the Taxes struct with the given parameters and sets the totalBuyTax variable to the sum of the four parameters. (autogenerated documentation)
setSellTaxes(uint256,uint256,uint256) :
This function allows the owner of the contract to set the taxes for selling tokens. The function takes four parameters: _rewards, _treasury, _liquidity, and _dev. These parameters represent the percentage of the total sell tax that will be allocated to each of the four categories. The function requires that the sum of all four parameters must be less than or equal to 20%. If this condition is not met, the function will revert. Once the parameters are set, the sellTaxes variable is updated with the new values and the totalSellTax variable is updated with the sum of all four parameters. (autogenerated documentation)
setMaxBuyAndSell(uint256,uint256) :
This function allows the owner of the contract to set the maximum amount of tokens that can be bought and sold in a single transaction. The function takes two parameters, maxBuy and maxSell, which represent the maximum amount of tokens that can be bought and sold respectively. These values are then multiplied by 10^18 to convert them into the smallest denomination of the token (wei). The resulting values are then stored in the maxBuyAmount and maxSellAmount variables. (autogenerated documentation)
setSwapEnabled(bool) :
This function allows the owner of the contract to enable or disable the swap feature. When the swap feature is enabled, users can exchange tokens with each other. When the swap feature is disabled, users cannot exchange tokens with each other. The function takes a boolean parameter, which is set to true to enable the swap feature and false to disable it. (autogenerated documentation)
activateTrading() :
This function is used to enable trading on the contract. It can only be called by the owner of the contract and will require that trading is not already enabled. If these conditions are met, the function will set the boolean variable tradingEnabled to true, thus enabling trading on the contract. (autogenerated documentation)
setClaimEnabled(bool) :
This function is used to enable or disable the ability to make claims on the contract. It is an external function that can only be called by the contract owner. The function takes a boolean value as an argument, which is used to set the claimEnabled variable to either true or false. If set to true, users will be able to make claims on the contract. If set to false, users will not be able to make claims on the contract. (autogenerated documentation)
setBot(address,bool) :
This function allows the owner of the contract to set a given address as a bot or not. The function takes two parameters, an address and a boolean value. The address is the address of the bot that the owner wants to set, and the boolean value is a true or false value that indicates whether the address should be set as a bot or not. The function first checks to make sure that the address is not already set as the given value, and then sets the address as a bot or not depending on the boolean value. (autogenerated documentation)
setBulkBot(bool) :
This function is used to set the value of the boolean variable _isBot for a given array of addresses. It is an external function that can only be called by the contract owner. The function takes in an array of addresses and a boolean value as parameters. It then iterates through the array of addresses and sets the value of _isBot for each address to the boolean value that was passed in. (autogenerated documentation)
setLP_Token(address) :
This function allows the owner of the contract to set the address of the LP token associated with the contract. The function takes an address as an argument and calls the updateLP_Token() function in the dividendTracker contract, passing in the address of the LP token. This function allows the owner to update the address of the LP token associated with the contract, allowing them to switch to a different LP token if needed. (autogenerated documentation)
setAutomatedMarketMakerPair(address,bool) :
This function allows the owner of the contract to set an Automated Market Maker (AMM) pair. An AMM is a type of decentralized exchange that allows users to trade tokens without the need for a counterparty. The function takes two parameters: the address of the new AMM pair and a boolean value. The boolean value indicates whether the new pair should be enabled or disabled. If the value is set to true, the new pair will be enabled and users will be able to trade tokens on the new pair. If the value is set to false, the new pair will be disabled and users will not be able to trade tokens on the new pair. (autogenerated documentation)
_setAutomatedMarketMakerPair(address,bool) :
This function is used to set an Automated Market Maker (AMM) pair in the VIRAL contract. It takes two parameters: an address of the new pair and a boolean value. The function requires that the automatedMarketMakerPairs mapping does not already have the new pair set to the same value. If the boolean value is set to true, the new pair is excluded from dividends in the dividendTracker contract. Finally, the SetAutomatedMarketMakerPair event is emitted. (autogenerated documentation)
getTotalDividendsDistributed() :
This function is used to get the total amount of dividends that have been distributed to shareholders. It works by calling the totalDividendsDistributed() function from the dividendTracker contract, which returns the total amount of dividends that have been distributed. (autogenerated documentation)
isExcludedFromFees(address) :
This function checks whether a given Ethereum address is excluded from fees. It does this by accessing the _isExcludedFromFees mapping, which is a data structure that stores a boolean value for each address. If the address is found in the mapping, the function will return the corresponding boolean value, which indicates whether the address is excluded from fees or not. (autogenerated documentation)
withdrawableDividendOf(address) :
This function allows users to view the amount of withdrawable dividends associated with a given Ethereum address. It does this by calling the withdrawableDividendOf() function from the dividendTracker contract, which is responsible for tracking and managing the distribution of dividends. This function takes an Ethereum address as an argument and returns the amount of withdrawable dividends associated with that address as a uint256 value. (autogenerated documentation)
dividendTokenBalanceOf(address) :
This function returns the balance of a given account for a specific token. It does this by calling the balanceOf() function from the dividendTracker contract, which is responsible for tracking the token balances of each account. The function takes in an address as an argument and returns the balance of that address as a uint256. (autogenerated documentation)
getAccountInfo(address) :
This function is used to retrieve information about a given Ethereum account. It takes an address as an argument and returns a tuple containing the address, the total amount of dividends paid to the account, the total amount of dividends received from the account, the total amount of dividends sent from the account, and the total amount of dividends received by the account. The function calls the getAccount() function from the dividendTracker contract, which stores the information about the account in a mapping. The mapping is then used to retrieve the information and return it as a tuple. (autogenerated documentation)
airdropTokens(uint256[]) :
This function is an external function that is only accessible to the owner of the contract. It takes two parameters, an array of addresses and an array of uint256 values. The function requires that the two arrays have the same length. It then loops through the arrays and calls the _transfer function of the parent contract, sending the amount of tokens specified in the amounts array to the address specified in the accounts array. This allows the owner of the contract to airdrop tokens to multiple addresses at once. (autogenerated documentation)
_transfer(address,address,uint256) :
This function is an override of the _transfer function in the ERC20 contract. It is used to transfer tokens from one address to another. The function first checks to make sure that the addresses from and to are not the zero address. It then checks to see if trading is enabled, and if the addresses are not bots. If the addresses are not excluded from fees, it then checks to see if the amount is greater than the maxSellAmount or maxBuyAmount. If the amount is 0, it will transfer 0 tokens. The function then checks to see if the contract token balance is greater than the swapTokensAtAmount, and if swapping is enabled and the address is an automated market maker pair. If all of these conditions are met, it will swap and liquify the tokens. The function then checks to see if the addresses are excluded from fees, and if the addresses are automated market maker pairs. If both of these conditions are met, it will take a fee from the amount being transferred. The fee is calculated by multiplying the amount by the totalSellTax or totalBuyTax. Finally, the function will transfer the tokens from one address to another, and update the (autogenerated documentation)
swapAndLiquify(uint256) :
This function is used to swap tokens for ETH and add liquidity to a pool. It takes in a uint256 value representing the amount of tokens to be swapped and liquified. The function first divides the tokens into two parts, with half of the tokens being used to add liquidity and the other half being used to swap for ETH. The function then calls the swapTokensForETH() function to swap the tokens for ETH. After that, the function calls the addLiquidity() function to add the remaining tokens to the liquidity pool. Finally, the function distributes the taxes collected from the liquidity pool to the treasury wallet, the dev wallet, and the dividend tracker. The taxes are distributed based on the sellTaxes values set in the contract. (autogenerated documentation)
swapTokensForETH(uint256) :
This function is used to swap a given amount of tokens for ETH. It does this by first creating an array of two addresses, the first being the address of the contract and the second being the address of the router. It then calls the _approve function to approve the transfer of tokens from the contract to the router. Finally, it calls the router's swapExactTokensForETHSupportingFeeOnTransferTokens function, passing in the token amount, a fee of 0, the address array, the address of the contract, and the current block timestamp. This function will then swap the given amount of tokens for ETH. (autogenerated documentation)
addLiquidity(uint256,uint256) :
This function adds liquidity to a Uniswap exchange. It takes two parameters, tokenAmount and ethAmount, which represent the amount of tokens and ETH to be added to the exchange. First, it calls the _approve function to approve the exchange contract to transfer the tokenAmount of tokens from the caller's address. Then, it calls the addLiquidityETH function of the router contract, passing in the address of the exchange contract, the tokenAmount, and the current block timestamp. This function adds the specified amount of tokens and ETH to the exchange, allowing users to trade them. (autogenerated documentation)
trackerRescueETH20Tokens(address,address) :
This function is used to transfer all of the tokens held by the contract to a specified recipient address. It takes two parameters, the recipient address and the address of the token contract. The function first checks that the caller is the owner of the contract, and then it uses the IERC20 interface to transfer the balance of the contract to the recipient address. (autogenerated documentation)
trackerForceSend(address) :
This function is used to transfer the balance of the contract to a specified recipient address. It is only accessible by the contract owner and can only be called by the owner. The function first stores the balance of the contract in a variable called ETHbalance. It then sends the value of ETHbalance to the recipient address specified in the function argument. (autogenerated documentation)
updateLP_Token(address) :
This function allows the owner of the contract to update the address of the LP_Token. This is useful if the address of the LP_Token has changed for any reason. The function takes in the new address of the LP_Token as an argument and sets the LP_Token address to the new address. This ensures that the contract is always pointing to the correct address of the LP_Token. (autogenerated documentation)
_transfer(uint256) :
This function is an internal function that is used to override the transfer function of the contract. It prevents any transfers from being made by requiring that the function return false. This ensures that no tokens can be transferred from the contract, making it a non-transferable contract. (autogenerated documentation)
getAccount(address) :
This function is used to retrieve information about a given account from the contract. It takes an address as an argument and returns a tuple containing the address, the amount of withdrawable dividends, the total amount of dividends, the last claim time, and the total amount of dividends withdrawn. The function first creates a memory variable called info and assigns the address to it. It then retrieves the amount of withdrawable dividends and the total amount of dividends for the given address using the withdrawableDividendOf and accumulativeDividendOf functions. It also retrieves the last claim time for the given address from the lastClaimTimes mapping. Finally, it returns the address, the withdrawable dividends, the total dividends, the last claim time, and the total amount of dividends withdrawn. (autogenerated documentation)
setBalance(address,uint256) :
This function allows the owner of the contract to set the balance of a given account. It takes two parameters, an address of the account and a uint256 value for the new balance. The function first checks if the account is excluded from dividends, and if so, it returns without making any changes. Otherwise, it calls the _setBalance() function to set the new balance for the given account. (autogenerated documentation)
processAccount(address) :
This function is used to process an account and withdraw any dividends that the account is owed. It is an external function that can only be called by the owner of the contract. The function takes an address payable account as an argument and first calls the _withdrawDividendOfUser() function to get the amount of dividends that the account is owed. If the amount is greater than 0, the function updates the lastClaimTimes mapping to store the current block timestamp for the account, emits a Claim event with the account address and the amount of dividends, and returns true. If the amount of dividends is 0, the function returns false. (autogenerated documentation)
VIRAL.sol
DividendPayingToken.sol
Ownable.sol
IDex.sol
IERC20.sol
ERC20.sol
SafeMath.sol
DividendPayingTokenInterface.sol
Context.sol

Get Cookin'
star icon2988

copy iconOpen in VSCode
copy iconDownload Source

2988 downloads