FEG Token
Search…
⌃K
👩💻

How to deploy the contract

Step 1. Go to Github

Head over to the FEG team's repository made by Bal-Gu in order to find the necessary code. The address is : github.com/fegarmy/SD_additional_contracts/tree/main/ReflectionsTeamLocker

Step 2. Get the code

On that page you will find several files, one of which is named "TeamLocker.sol" , click it in order to see the code.
You will now see the entire code you'll need in order to create your own faucet, scroll all the way down and copy the entire code.

Step 3. Use a tool to deploy the code

You can use whatever your favorite tool is in order to deploy this code to the blockchain, however for the purpose of this example we will use a free tool which is also browser based and noob friendly. The tool is called Remix IDE : remix.ethereum.org

Step 4. Create a new file

On the left side of the screen, click the "Create new file" button and give it whatever name you want, like for example "cos-is-the-best-mod.sol" , just make sure you add ".sol" at the end of the name. Just for your information, ".sol" stands for "solidity".
Now click on the new file that you created and on the right side of the screen you'll get a big field in which you can type your code from scratch, or simply just paste the entire code you copied previously from Github.

Step 5. Pick a custom lock time

If you scroll through the code you just copied inside this new file, at line #85 you can change the locking period from the default of 1 year to whatever amoung of days/years you want. The locking number "31556926" expresses the time for which the tokens will be locked, and this time is shown here in seconds, so 31556926 equals to 365.24 days. So if you proceed to change this number make sure you remember this lock timer is in seconds.

Step 6. Compile the code

Click the "Solidity Compiler" menu button on the left side of the screen. That will open up a page with new options for you. On this page page click the dropdown menu for the compiler and pick the correct version from the ones available on the list. Make sure the version you select is the same as the version from the code you just copied into the file, you can see that version on the top there where it says "pragma solidity xxxx".
Once you selected the compiler version hit the big nice button which says "Compile" and wait a couple seconds to be done.

Step 7. Deploy the contract on the blockchain

On the left side menu click the next button called "Deploy & run transactions" and this will take you the last page you need to use on this particular platform in order to actually deploy your contract on the public blockchain of your choice.
Now pick the blockchain you'd like to deploy your contract on. This will require you to click on the dropdown "Environment" menu and pick "Injected web3". When doing so, a window from your wallet (in this example Metamask on pc) will appear asking you for confirmation that you allow this service to connect to your wallet. Once connected, the Remix IDE deployer will automatically pick the blockchain to deploy your contract by using the active network selected in your wallet at the time. So if your wallet is currently on Binance Smart Chain network, the deployer will automatically deploy your contract on that network.
Make sure the "Account" field shows the address of your wallet and not something else
Pick the right item from the dropdown "Contract" list. It has to be the one named "teamLocker" + whatever the name of your ".sol" file is
Once you have all these settings picked correctly you are now ready to deploy your contract to the blockchain. Recheck everything once more to make sure all is in order. Remember that you'll need some BNB/ETH for the gas fees for this particular operation so make sure you have some in your wallet before proceeding. When you're ready, click the "Deploy" button, confirm the gas costs in your wallet and then wait for the transaction to execute successfully, this may take a few seconds, or even minutes.
Once the transaction executes, the contract is now deployed on the blockchain and you may copy the link to it in order for us to continue setting up the contract using BSCscan. Click the "Copy" button for the new contract that just now appeared under "Deployed contracts"

Step 8. Go to BSCscan.com

You're done using the Remix IDE platform and now have to move over to BSCscan.com, if you're working on the BSC network, or to ETHERscan.io if you're working on the ETH network. For the purpose of this exercise we'll go with BSCscan.com Paste into the search field the link of your deployed contract you copied earlier from Remix.

Step 9. Verify your contract

On the contract's page scroll a bit down and click the "Contract" menu, then if you see the "Verify and Publish" option click that too.
Make sure the deployed contract address you got from Remix IDE matches the address shown to you in the first field in BSCscan. Then selected the compiler type, which is "Solidity single file" Next select the compiler version, make sure this matches exactly the version you picked earlier inside Remix IDE when you deployed your contract. Finally pick the license type, which in this case is unlicensed. That's it, now agree to their terms of service and click the "Continue button.

Step 10. Publish the contract source code

Copy/paste your entire contract code in the field indicated below, it's the same code which you copy/pasted earlier in Remix IDE too when you made the new file.
After you enter your code, scroll down the page and do the "I'm not a robot" verification just to make sure you're not a T-800 Terminator or something. Then click the "Verify and Publish" button and wait, this may take a minute or more to complete, just don't leave the page and don't refresh the page.
After the system finishes verifying the contract you should be met with a page looking the one in the example image, saying "Successfully generated ByteCode". This means you're now done, you have successfully deployed, verified and published your time-locked faucet contract on the blockchain, congrats you're now an elite hacker or something.
If you now go back to your contract address on BSCscan you'll see it looks different and you now have 3 new menu buttons which hold some very cool options for you to use.