paint-brush
Deploying Ethereum Smart Contracts via Remix IDEby@mtonev
473 reads
473 reads

Deploying Ethereum Smart Contracts via Remix IDE

by Martin TonevAugust 30th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

If you want to deploy your smart contract into the live Ethereum network without the pain of sync the whole blockchain with ‘geth’ (around 40GB before I stop the process) which run for a week without full sync. You can deploy your contract via the Ethereum online IDE remix <http://remix.ethereum.org/>. The steps are very easy: You need to flatten your contracts into single contract sol file. Make sure you have a MetaMask installed (if not use MetaMask install it from here <https://://://metamask.io/>) and run on live network.

People Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Deploying Ethereum Smart Contracts via Remix IDE
Martin Tonev HackerNoon profile picture

If you want to deploy your smart contract into the live Ethereum network without the pain of syncing the whole blockchain with ‘geth’ (around 40GB before I stop the process) which run for a week without full sync. You can deploy your contract via the Ethereum online IDE remix

http://remix.ethereum.org/ .


The steps are very easy:

  1. You need to flatten your contracts into single contract sol file, the best tool to use for this “truffle-flattener” https://www.npmjs.com/package/truffle-flattener


  2. Copy and paste the code into the remix online IDE editor like on the screenshot:

Auto-compile will compile your code and show you if there are warnings or errors.

3. After compiling finishes, you must go to the run tab:


4. Make sure you have a MetaMask installed (if not use MetaMask install it from here https://metamask.io/) and run on a live network.


5. Make sure you have funds in your current MetaMask account they are needed to pay the gas price for uploading the contract to the live network.


6. From the select in the run tab select the contract you want to deploy

In my example, I want to deploy the contract “Crowdsale” this contract has constructor params in my case `rate`, `wallet` and token address you want in your Crowdsale campaign to be sold.


7. Enter the values and click the green button upload, a MetaMask will open a small window in order to confirm your transactions. After you click to confirm you will see in the IDE console logs of your actions and your contract begin deployed.


8. You will wait a while until you can get your contact address. And that is your contract is deployed to the live Ethereum network.


* As you can see we use a Token Contract address in our constructor deployment. This is because we use Open-Zeppelin framework they contract Crowdsale accept Token contract address which will be distributed to investors.


In this case, you must first deploy your token contract ‘TokenContractName” by selecting it from the drop-down menu as we select our Crowdsale contract. After you successfully deploy your token contract you will receive the address in the Ethereum network where your token contract is live.


You then get this address and provide it to our Crowdsale contract as a constructor param.

It is as simple as that, if you have questions ask them in the comments.


Martin Tonev: CEO at https://entro.solutions/


This story was first published here.