Skip to content

ankitshubham97/ethereum-solidity-remix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ethereum-solidity-remix

For everything about ethereum+solidity+remix

What's this repo for?

This repo contains different single-solidity-file example projects aimed to understand:

  • how solidity works in general
  • how we can write smart contracts using solidity
  • how a user can interact with the on-chain smart contract
  • what use cases can be covered using solidity

End goals?

For every project, there is a problem statement which the project needs to solve. Entire solution would be:

  • writing the code for the smart contract
  • deploy on a real chain
  • test if the solution is working
  • if everything goes right, verify and publish the smart contract and include the detail in the project-level READMEs

How to clone, build, deploy and test one of the sample projects?

We can use remix, the online IDE for developing smart contracts. It is convenient for small-and-quick projects!

Open remix. You would see the Home page already loaded for you. There would be an option to LOAD FROM and then choose GitHub. Screenshot 2022-04-30 at 2 19 11 PM

You would see a popup requesting for the .sol file you want to load. Screenshot 2022-04-30 at 2 33 07 PM

You can enter the GitHub URL for one of the sample projects. Screenshot 2022-04-30 at 2 34 38 PM

You would see a github folder being created in the File explorers tab. The .sol file would be there with the folder hierarchy preserved. Screenshot 2022-04-30 at 2 34 52 PM

Click on the .sol file (here, PrintMessage.sol) from the File explorers so that it gets open in the code window. Screenshot 2022-04-30 at 2 42 22 PM

Go to the solidity compiler tab and compile the .sol file. Screenshot 2022-04-30 at 2 42 47 PM If it succeeds, you would see a green-tick badge on the solidity compiler tab's icon. You could also check out the terminal tab (here, at the bottom of the screen) for more details. Screenshot 2022-04-30 at 2 42 59 PM

Go to the Deploy and run transactions tab. At the time of writing this README, the default environment is JavaScript VM (London). You can learn more about the environments here. Let's deploy in the default environment. Screenshot 2022-04-30 at 2 43 21 PM

In the terminal tab, you would see messages that indicate the status of deployment. In our case, it got successfully deployed. Also, you would start seeing the deployed contract in the Deploy and run transactions tab. Screenshot 2022-04-30 at 2 43 36 PM

Let's interact with the deployed contract! Let's click on the button and see what message is stored as of now. You would see nothing because message is empty when you just deploy the contract. Screenshot 2022-04-30 at 2 43 52 PM

Let's write our own message! Let's write a message in the text box against the button and click on it. Screenshot 2022-04-30 at 2 44 07 PM

Let's again click the button. You would see the message that we just wrote in the previous step! Screenshot 2022-04-30 at 2 44 25 PM

To learn more about how to interact with a deployed contract within the remix environment, please refer this.

Contributions

Please feel free to contribute to this repo by creating PRs.

About

For everything about ethereum+solidity+remix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published