Create a folder to put the settings and application in.
cd ~/
mkdir faucet-bot
cd faucet-bot
For Windows Use :
wget https://winston.services/bots/Faucet-Bot?download=win
For Linux Use :
wget https://winston.services/bots/Faucet-Bot?download=linux
For MacOs Use :
wget https://winston.services/bots/Faucet-Bot?download=mac
For Arm Use :
wget https://winston.services/bots/Faucet-Bot?download=arm
Or Download the latest version of the bot from :
https://winston.services/bots/Faucet-Bot
Note : In this documentation we make a few assumptions. You may need to adjust your actual input for your OS version.
You will need to have the latest version of nodejs installed to install this dependancy. You can download it from their website NodeJS Next we need to install the Sqlite Database Dependencies. Sqlite is used to store the data that keeps track of user balances, transactions, and settings for the bot.
Dependencies :
Sqlite3
npm i -G sqlite3
Download the ABI's to /src/json
We have included a few of the ABI's we find as standard in the following Repository on Github.
https://github.com/winston-services/faucet-bot
It's recommended that you use the ABI's that are for your assets if they are not already included in the repository. You can download them from the blockexplorer. While at the blockexplorer register to get your API keys, so that you can use Ethers Network Provider API's.
Discord Developer Portal Next you will want to go to Discord Developer Portal to create your bot's credentials. Here's what you will need to do.
Under this section you can copy your Discord Application ID.
Under the bot section you can get your token for the bot. Click on "Reset Token" to view the token and reset it. Copy it and add it to the .env file as the "DISCORD_TOKEN".
Make sure to enable these two features, so that the bot can get user information and read the content they send.
Next edit the .env
file to update the following information.
OWNER_GUILD_ID=
DISCORD_APPLICATION_ID=
DISCORD_TOKEN=
UPDATE=false
LINK="https://discord.com/api/oauth2/authorize?client_id={{CLIENT_ID}}&permissions=2416266304&scope=bot"
BASE_TOKEN="0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"
ENABLED=true
STAKING_ENABLED=true
PROVIDER_URL=
NETWORK_DEAD_ADDRESS="0x000000000000000000000000000000000000dEaD"
ROUTER_ADDRESS="0xEfF92A263d31888d860bD50809A8D171709b7b1c"
FACTORY_ADDRESS="0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"
PRIMARY_PAIR_ADDRESS="0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
SECONDARY_PAIR_ADDRESS="0xdAC17F958D2ee523a2206206994597C13D831ec7"
DO_NOTHING_CHANCE=15
IGNORE_CHANCE=5
CHANGE_COUNT_CHANCE=2
TIMEOUT_USER_CHANCE=1
TIMEOUT_MAX_TIME_SETTING="15m"
nano .env
Used to limit the access to the bot to a specific server on discord. Add the server ID you want to whitelist.
The ID of the bot itself, you can get this from discord developer portal. While your there you will need to set these settings.
This is the token you will get for your bot on the Discord Developer Portal. Below are the instructions on how to do that.
The update option is used to update the Discord Server with the slash-commands for the bot. This only needs to be enabled once, and started. Once you have ran it once enable you can disable it so that it doesnt need to update the commands each time the bot is started.
The link option is the url used to add the bot to the server. Replace {{CLIENT_ID}} with the actual bot's client ID. You can get that from the Discord Developer Portal.
The base token is the asset the faucet will use for its features. Add the contract address for the token to be used in the bots features.
The enabled option is used to toggle the Withdraw feature. To enable withdraws from the bot set this to true, to disable them set this option to false.
This option is used to toggle the staking feature. Set this to true to enable staking, set it to false to disable staking.
The provider url should be the url to the RPC service or one of
mainnet
, bnb
, matic
, arb
This should be the dead address for the chain. The standard address is 0x000000000000000000000000000000000000dEaD
if the chain used does not use this address set it to the address that is known as the dead address for that chain.
The router address is the contract address of the dex router used for pricing. UniSwap v2 Contracts or Equevelant should be used.
The factory address is the contract address of the dex factory used to control the pairs. Set this to the UniSwap V2 or compatible Factory Address.
The primary pair address is the contract to the asset that is the primary pair for the chain. (WETH, WMATIC, WBNB etc.)
The secondary pair address is the contract address to the asset that is the stable coin paired to the base asset.
The do nothing chance option is used to change the odds the counter feature will do nothing.
The Ignore Chance option is used to change the odds the counter feature will ignore the user.
The Change Count Chance option is used to change the odds the counter feature will reset the counter to a random number between 0 and its current position.
The Timeout User Chance option is used to change the odds the counter feature will time the user out for a random duration.
The Timeout Max Time Setting option is used to change the max time out period a user can get if they are timedout of the counter feature.
Now let's add the ABI's to interact with these assets.
- ABI.json Base Token ABI
- ABI.json Primary Token ABI
- ABI.json Secondary Token ABI
- ROUTER.json is the Router ABI for the dex.
- FACTORY.json is the Factory ABI for the dex.
- Pair.json is the Pair ABI for the dex pair used to swap the assets for gas.
ABI stands for Application Binary Interface
. It is basically a set of interpreter commands to allow external programs to interact with contracts on the blockchain.
https://discord.com/api/oauth2/authorize?client_id={{CLIENT_ID}}&permissions=2416266304&scope=bot
Replace CLIENT_ID with the ID of the Discord Bot. Follow the link to invite the bot to the Discord server.
Get the bot and users balances.
Get detailed information about the assets used in the bot. Including pricing and balance information.
Claim a portion of the available faucet balance.
Deposit funds to the faucet bot. This is a donation to the bot's faucet balance.
Stake an amount of assets held in the users wallet.
Un-stake all balances staked or locked in the bot.
Withdraw funds from the bot to an external wallet.
Get general bot help information.
Set the channel to lock the counting feature to. This will set the bot to only allow counting in this channel.
Set the channel to lock the faucet feature to. This will set the bot to only allow users to claim the faucet in this channel.
Set the channel to show the staking reward payouts. This should be a locked channel that others can read buy not write in.
Set the faucet role to limit who can use the faucet by their roles.
Clear the existing Faucet Role limit.
Clear the existing Faucet Channel limit.
Clear the existing Counter Channel limit.
Set the minimal withdraw amount. This will require users to have a balance higher than or equal to this amount.
Set the interval in which users can claim the faucet. Use time patterns like 1h 5m or 15s.
Set the fee the bot will charge for withdrawing funds from the bot.
Add missed transaction by the blocknumber. Enter the blocknumber of the transaction that was not caught by the bot's deposit process.
You will need to run the reconcile feature if and only if you have ran the /set correct
feature to add a missing transaction. This will correct the bots balances and insure the bot is calculating the right amount of assets.
Enable this feature to allow the bot to ignore users when they are counting. The enables the random process of ignoring users while they count.
Enable this feature to allow the bot to reset the counter randomly to a number between 0 and its current count.