Skip to content

Commit

Permalink
Merge pull request #2367 from ethereum/docs_redux
Browse files Browse the repository at this point in the history
docs: FAQ, update run, update import
  • Loading branch information
ryestew authored Nov 18, 2019
2 parents 0e35b5b + 0565e8b commit 1582dd4
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
11 changes: 9 additions & 2 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Please change the compiler version in Solidity Plugin to the newer one or use an

**A:** Try a different browser or a newer solidity compiler version.

**Q:** How to verify a contract that imports other contracts?

**A:** The verification tool does not recursively go through the import statments in a contract. So can only verify a 'flattened' contract.

There is a plugin called `Flattener` which will stuff all the original code and the imported code into a single file.

### Deploy & Run

**Q:** I am using an Infura endpoint in my app, but when I try to deploy against that endpoint in remix IDE selecting "web3 provider" and putting my endpoint in, it's telling me that it can't connect
Expand Down Expand Up @@ -74,7 +80,8 @@ The input of initPeepToPeeps takes a struct. If you input
`[1,2]` the transaction will go through.


### General

**Q:** Where do plugin developers go with their questions?



**A:** The Gitter Remix plugin developers room https://gitter.im/ethereum/remix-dev-plugin
Binary file removed docs/images/a-runtab1.png
Binary file not shown.
Binary file added docs/images/a-runtab2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 45 additions & 10 deletions docs/import.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Importing Source Files in Solidity
==================================

It is essential to know many techniques for importing files.
There are multiple techniques for importing files into Remix.

For a tutorial about importing files click [here](https://github.com/ethereum/remix-workshops/tree/master/LoadingContent).
For a tutorial about importing files click [here](https://github.com/ethereum/remix-workshops/tree/master/LoadingContent). You can also find this tutorial in the Remix Workshops plugin.

For a detailed explanation of the `import` keyword see the
[Solidity documentation](https://solidity.readthedocs.io/en/develop/layout-of-source-files.html?highlight=import#importing-other-source-files)
Expand All @@ -13,8 +13,13 @@ Here are a some of the main methods of importing a file:
Importing a file from the browser's local storage
-------------------------------------------------

Files in Remix can be imported just by specifying their path. Please use ```./``` for relative paths to increase portability.
![](images/a-old-tuto_basicimport.png)
Files in Remix can be imported with the `import` key word with the path to the file. Use ```./``` for relative paths to increase portability.
```
pragma solidity >=0.4.22 <0.6.0;
import "./ballot.sol";
```


Importing a file from your computer's filesystem
-------------------------------------------------
Expand All @@ -25,15 +30,45 @@ This method uses **remixd** - the remix daemon. Please go to the [remixd tutori
Importing from GitHub
---------------------

It is possible to import files directly from GitHub with URLs like
`https://github.com/<owner>/<repo>/<path to the file>`.
It is possible to import files directly from GitHub.

```
pragma solidity >=0.4.22 <0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol";
![](images/a-old-tuto_importgit.png)
```

Importing from Swarm
--------------------

Files can be imported using all URLs supported by swarm. If you do not
have a swarm node, then use swarm-gateways.net.
Files can be imported using all URLs supported by swarm.
If you do not have a swarm node, then use swarm-gateways.net.

```
import 'bzz-raw://5766400e5d6d822f2029b827331b354c41e0b61f73440851dd0d06f603dd91e5';
```

Importing from IPFS
--------------------

Files can be imported from IPFS.

```
import 'ipfs://Qmdyq9ZmWcaryd1mgGZ4PttRNctLGUSAMpPqufsk6uRMKh';
```

Importing from the console
--------------------------

You can also use a remix command remix.loadurl('<the_url>')in the console:

```
remix.loadurl('https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol')
```

Notice that this will create a `github` folder in the file explorer. To load a file in the `github` folder, you would use a command like this:

![](images/a-old-tuto_importswarm.png)
```
import "github/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol";
```
2 changes: 1 addition & 1 deletion docs/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To get to the Run & Deploy module - click the run icon in the icon panel.

In order to use this module you need to have a contract compiled. So, if there is a contract name in the contract select box (in the image below it's the pulldown that says **Ballot**), then you can interact with this contract. If nothing is there - then you need to select a contract. And you do that by clicking the file in the editor panel to make it the active tab ( in the image below - on the right side of the page - in the main panel - you see the ballot.sol so it is the active contract). Once its active, then go to the compiler module and compile it. Then come back to Deploy & Run.

![](images/a-runtab1.png)
![](images/a-runtab2.png)

Run Setup
---------
Expand Down

0 comments on commit 1582dd4

Please sign in to comment.