How to Fork Safemoon Contracts for Beginners

Bsc Talk
3 min readMay 22, 2021

Hello, I am Tider from Bsctalk, today's tutorial I am going to teach you how to create your own Safemoon tokens in the mainnet in Binance Smart Chain. If you like my tutorial a small donation will boost me for more tutorials like this.

For hiring me you can contact me on

bsctalkpremium@gmail.com

Donation ETH/BNB/BUSD- 0xEd95f222731E7948CBcde54E2D7793e1E7193BBb

Step 1 Go to Remix

First create your own workspace, By clicking on the “+” button on the Top Left and press “ok”.

Step 1- Create your own Workspace and “Press” Ok

Step-2 Create a contract

After you created your workspace you will find 3 folders Contracts, Scripts, test, and a Readme file. (You can ignore the rest of the 3 folders, just focus on the contracts folder).

Inside the contracts, folder “Create a new file” and name it “XYZ.sol”. Here I named Testmoon.sol for this tutorial.

Step 3- Copy the source code from Safemoon GitHub.

You can find the source code from here- https://github.com/safemoonprotocol/Safemoon.sol/blob/main/Safemoon.sol

or you can use my copy-paste code https://pastebin.com/MPQ0Lsyf

Once you copied the code paste it into the remix code section and do the following settings.

Set the compiler version to 0.6.12+commit.27d51765

Language- Solidity

EVM VERSION- compiler default

Tick on Auto complie

Step 4- Change the contract name, symbol, fees, etc.

Scroll the code in remix and find the contract where you can change the name, total supply, and decimals in my tutorial I found this on line 681, it may be different in yours. Here I used “Testmoon”. You can change the fees or anything. But if you get stuck you can use mine .

Step 5- You can change the Pancakeswap router address.

I deployed this contract on the Binance Smart chain mainnet , so you don't need to change this part if you are using it for mainnet (v2). But if you want to use it on Testnet here are the details.

Pancakeswap Testnet Router address- 0xD99D1c33F9fC3444f8101754aBC46c52416550D1

Pancakeswap v1 Mainnet Router address- 0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F

Pancakeswap v2 Mainnet Router address-0x10ED43C718714eb63d5aA57B78B54704E256024E (i used this for this tutorial).

Step 6- Deploy

This is the final and most important part. In the Environment Section make sure you select “Injected Web3” and connect your metamask to remix. Here you need to select the right contract for the deployment. Here my file name is Testmoon.sol so I will select “Testmoon- contracts/Testmoon.sol”

Note- This will be different for you ,It will be as per your contract name.

Step 7 Press “Deploy”

After you did all the previous steps correctly, select the right contract and Press the “Deploy” button, a metamask popup will come up confirm and “Boom” you made your Safemoon token.

For verifying the contracts or you need to change something or add other features in your contract please contact me on

bsctalkpremium@gmail.com

Note- It took me more time to make this tutorial for you guys. Hope you give me some support.

My BNB/Busd address — 0xEd95f222731E7948CBcde54E2D7793e1E7193BBb

--

--