I can't deploy a SafeMoon Clone, can someone give me their migration.js file?

Hey guys! I’m new to smartcontracts and first i deployed a simple contract to bsctesnet easily. No big issues there. But now I was trying to clone the safemoon contract and i can’t deploy it. Everytime i try i get the error of “hit a require or revert statement somewhere in its constructor…”. I believe this is because I havent modified migration.js file to include all functions and uniswap routers. The thing is that I have no idea how to do it. I already tried multiple configurations that i found on this forum and nothing works. Would you be willing to give me an example of a migration.js file that works with this contract so i can see how to do it properly?

Contract https://github.com/safemoonprotocol/Safemoon.sol/blob/a2a1b922b1260b618427183ec8d4475d70cf4daf/Safemoon.sol

Thanks :slight_smile:

Hi Manel, welcome to Open Zeppelin.

I’ve edited your title, please be specific in the question and the topic it is surrounding. It helps a lot for other searchers.

But now I was trying to clone the safemoon contract and i can’t deploy it.

Please do not copy Safemoon. You will be doing yourself a disservice by trying to copy and paste someone else. If you really want to learn, start with the basics, build up to something like Safemoon. Understand how the RFI tax and the LIQ tax work. Take it one part at a time.

Follow this tutorial, even if you don’t understand it 100% it will get you up and running with some basics:

Learning resources:

To answer your question in specific, it’s probably because you need to change the router address. You will have to go into the code and make sure the code is correct to the PCS V2 router. If you deployed it on the BSC Test Net, you will need to change the PCS Test Router to V2 Router address.

If you follow the tutorial, learn a little bit, you should be able to deploy this easily without any issue.