This is a token swap smart contract that lets your users exchange (swap) token A for token B.
Exchange rate can be changed in the admin panel.
You can use this contract with any (BEP-20) tokens.
Once you have created token swap contract you need to add some output tokens to the contract (you will be able to withdraw tokens any time in the admin panel).
(Mainnet and Testnet available)
Create token swap contract
Input (from) token address
Contract address of the token that users will swap for output tokens. "From" token.
[show my tokens]
Output (to) token address
Contract address of the token that users get in exchange of input tokens. "To" token.
[show my tokens]
Rate
1 Input Token = Output Tokens How many Output Tokens buyer gets for Input Token (you will be able to change it in the admin panel).
Only tokens created on this platform are shown here but you can use any valid (BEP-20) token
If you can't see your token here please input its contract address manually
Address
Name
Symbol
Choose
×
My tokens
Only tokens created on this platform are shown here but you can use any valid (BEP-20) token
If you can't see your token here please input its contract address manually
Address
Name
Symbol
Choose
×
Token swap contract
Token sale status
Add tokens to your wallet! You wallet must have enough tokens for the token sale otherwise token sale will stop.
Approve the token sale contract for selling tokens from your wallet.
Raised: of BNB
Sold: of
To raise: BNB
To sell:
Paid to referrers: BNB
Tokens in my wallet: Allowance for token sale:
Token info
Token contract address:
Name (symbol): ()
Decimals:
Total supply:
Token sale contract
Rate
1 BNB =
1 token ~ BNB
Set new rate: / BNB
Hard cap
BNB
~
Set new hardcap: BNB
Start time
Before this time token sale contract will not sell tokens
Change:
End time
After this time token sale contract will not sell tokens
Change:
Duration
Purchase limit
BNB
Maximum amount that can be contributed from one wallet totally during the token sale
Set new limit: BNB
Referral commission
%
Referral commission is paid from each referred purchase instantly to referrer's wallet.
If you don't want to use referral program set referral percent to 0.
Change percent: %
Admin privileges
Once you renounce a privilege you will not have admin access to this function any more, it's value will be fixed forever
Other functions
When the token sale finishes any accidentally occuring balance is automatically sent from the contract to your wallet.
For any other situations these functions can be used.
Withdraw any tokens from contract:
BNB on the balance: BNB
Owner
Owner is the contract admin. Only owner has access to contract settings.
New owner:
Token sale UI
You can download front-end HTML file and edit the file after downloading, or order some design on top of it.
Please keep the scripts, IDs and classes otherwise some important functions may not work properly.
Just upload index.html file to your website - and your very own token sale is live!
<div style="text-align: center">
<h1>Token info</h1>
<h2><span id="tokenName"></span> (<span class="tokenSymbol"></span>)</h2>
<p><a target="_blank" href="" id="tokenAddress"></a></p>
<!-- Reserved in case you want to show decimals and total supply: Decimals <span id="#tokenDecimals"></span> Total supply <span id="#tokenSupply"></span>-->
<p>Do not send BNB to the token contract!</p>
<p><button id="addToken" style="text-align: center">Add to Metamask</button> <button id="copyToken" style="text-align: center">Copy address</button></p>
</div>
<hr>
<div style="text-align: center">
<h1>Token sale status</h1>
<h1>
<span id="finished" style="display:none" class="status green">Finished</span>
<span id="addtokens" style="display:none" class="status err"><br>Ask token sale admin to approve token sale contract or check tokens balance on the wallet!</span>
<span id="active" style="display:none" class="status green">Active</span>
<span id="paused" style="display:none" class="status err">Paused</span>
<span id="upcoming" style="display:none" class="status blue">Upcoming</span>
<span id="upcomingtimer" style="display:none" class="status blue"><br>begins in <span id="starttimer"></span></span>
<span id="activetimer" style="display:none" class="status green"><br>ends in <span id="endtimer"></span></span>
</h1>
<p><progress id="progress" value="0" max="100" style="width: 70%"></progress></p>
<p>Raised: <span id="raised"></span> of <span class="hardcap"></span> BNB</p>
<p>Tokens sold: <span id="sold"></span> of <span class="saleqty"></span> <span class="tokenSymbol"></span></p>
<p>Remaining: <span id="toraise"></span> BNB (~ <span id="unsold"></span> <span class="tokenSymbol"></span>)</p>
</div>
<hr>
</div>
<hr>
<div style="text-align: center">
<h1>Sale contract</h1>
<p>You can also buy tokens by sending BNB directly from your wallet to this contract<br>
(please increase gas limit to 200,000 or even more for tokens with special functions like autoLP, swaps, etc.)</p>
<p><a href="" target="_blank" id="saleAddress"></a> <button id="copySale" style="text-align: center">Copy address</button></p>
<div style="text-align: center" id="saleqr"></div>
</div>
<hr>
<div id="refarea" style="text-align: center">
<h1>Referral program</h1>
<p>Share your referral link and get paid instantly to your wallet for every referred token purchase.</p>
<p>Total paid to referrers: <span id="refTotal"></span> BNB</p>
<p>Referral commission: <span id="refPercent">10</span>%</p>
<p>Your referral earnings: <span id="refMy"></span> BNB</p>
<p>Share your referral link or QR code and get commission for referred token purchases instantly to your wallet.</p>
<p><input type="text" id="referLink" size="70" readonly="true"> <button id="copyreflink">Copy link</button></p>
<div id="refqrcode">
<div style="text-align: center" id="refqr"></div>
</div>
<p id="refErr" class="err" style="display: none">Please connect your wallet on Binance Smart Chain to generate your referral link!</p>
</div>
Your token sale contract can also work without UI.
Buyers can send BNB to contract and get tokens in return instantly.
Recommended gas limit for correct contract execution 200,000 or more for normal tokens, special tokens with auto-LP, swap, taxes etc. may require gas limit over 1,000,000. Inform token buyers about this!