5

Below is my solidity code on remix.ethereum and also created token in ethereum blockchain and now i wants to save my file in my local disk and after save wants to upload on github with verified comment. please help how i can do this ? http://remix.ethereum.org/#optimize=true&version=soljson-v0.4.25+commit.59dbf8f1.js

6 Answers 6

6
  • On the left of the Remix workspace is the "Icon Panel."
    https://remix-ide.readthedocs.io/en/latest/layout.html
  • At the top of that is the Remix logo icon that looks like a head with headphones.
  • Click the Remix logo icon to open the "Home Page."
  • On the Home page, on the left is a "File" section.
  • In the File section is a link to "Download all Files."
  • Clicking that causes Remix to create a ZIP file with all the files in the IDE that you can save to your local disk.
2
  • 1
    "Download All Files" is no longer listed under "Files", it is listed at the top of the same page under "Quicklinks". Dec 2, 2021 at 8:07
  • 1
    Tried repeatedly to "Download Backup" of my files. Each time Remix downloaded an empty zip file. Looks like they're not ready for prime time.
    – Babar-Baig
    Mar 6, 2022 at 8:23
4

You can copy and paste it in a text editor, then save it. There are no other options if you work in the browser area.

On the other hand, you can install

remixd 

and follow the related instructions in order to have your disk available in remix, even not in “browser” area, but in a so called “localhost” which appear using remixd and which maps to your disk

To install remixd you must have nodejs and npm installed, then

npm install -g remixd 

Is all required.

At the node prompt you can launch remixd and the new possibility to read/write on local disk will be available.

2
  • 1
    This seemed like an excellent idea, except partly through the command npm install -g remixd creation of a file remixd.js failed on my Windows 11 PC/Git bash command line. Rest of the script failed, and the install failed.
    – Babar-Baig
    Mar 6, 2022 at 8:09
  • 1
    Yeah, I used that for so many time without problems at the time, but understand that this instructions set may be changed during last years or you may have some general problems I do not know! Unfortunately I’m currently working on a different blockchain since years and cannot help. I’m sure you can find updates on the ethereum documentation.
    – Rick Park
    Mar 6, 2022 at 10:16
1

Remix doesn't seem ready for prime-time. Tried two approaches to save my files:

  1. Download a zip file from the Home page (icon looks like a brain with headphones). Repeated attempts downloaded an empty zip file.
  2. Install remixd on my Windows 11 PC/Git bash command shell. Installation using command npm -g install remixd failed while trying to create a file remixd.js. Rest of the installation also failed, and the daemon was not installed.

That only left the brute-force option: copy code from remix, create a file with a similar name on your pc, paste code into the file.

2
  • 2
    You should report those issues in their github repo github.com/ethereum/remix-project. I regularly use Remix on Firefox and Chrome without much trouble. I've to admit that some features are broken from time to time. In you case I'd suggest to try from a Linux VM, windows isn't used by blockchain developers as much as Mac or Linux.
    – Ismael
    Mar 6, 2022 at 19:01
  • The file it downloads is NOT an empty zip file, the contents are just hidden (.workspaces). You can see them with an app like Onyx. Nov 26, 2022 at 8:59
1

In newer (2022) versions of remix web, the option to download the zip file has gone but the flatten has been added instead.

To Use:

1- In the left-side workspace management area, right-click on the contract file (.sol) and choose "Flatten". Then after a few seconds, it asks for permission for a file, and... Finally, it generates a flat file of your contract which means all imported references will exist in the output file.

2- A paper scroll icon will appear on the left sidebar and if you click on it, you'll see Flattener options.

3- You can simply paste it anywhere to save it as a new .sol file. If you save it, it will be available in the workspace root.

0

In the newer models i think you can just flatten the file(this will copy the code to clipboard) then just use notepad to save the file with the extension .sol

0

In the 2024 version, you can simply right-click on a folder or file in the file explorer, then select "Download". If it's a folder then it will be compressed as a zip file before being downloaded by the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.