Merge pull request #2367 from ethereum/docs_redux

docs: FAQ, update run, update import
pull/1/head
Rob 5 years ago committed by GitHub
commit 1582dd4dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      docs/FAQ.md
  2. BIN
      docs/images/a-runtab1.png
  3. BIN
      docs/images/a-runtab2.png
  4. 55
      docs/import.md
  5. 2
      docs/run.md

@ -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. **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 ### 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 **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
@ -74,7 +80,8 @@ The input of initPeepToPeeps takes a struct. If you input
`[1,2]` the transaction will go through. `[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 not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

@ -1,9 +1,9 @@
Importing Source Files in Solidity 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 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) [Solidity documentation](https://solidity.readthedocs.io/en/develop/layout-of-source-files.html?highlight=import#importing-other-source-files)
@ -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 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. Files in Remix can be imported with the `import` key word with the path to the file. Use ```./``` for relative paths to increase portability.
![](images/a-old-tuto_basicimport.png) ```
pragma solidity >=0.4.22 <0.6.0;
import "./ballot.sol";
```
Importing a file from your computer's filesystem Importing a file from your computer's filesystem
------------------------------------------------- -------------------------------------------------
@ -25,15 +30,45 @@ This method uses **remixd** - the remix daemon. Please go to the [remixd tutori
Importing from GitHub Importing from GitHub
--------------------- ---------------------
It is possible to import files directly from GitHub with URLs like It is possible to import files directly from GitHub.
`https://github.com/<owner>/<repo>/<path to the file>`.
```
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 Importing from Swarm
-------------------- --------------------
Files can be imported using all URLs supported by swarm. If you do not Files can be imported using all URLs supported by swarm.
have a swarm node, then use swarm-gateways.net. 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";
```

@ -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. 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 Run Setup
--------- ---------

Loading…
Cancel
Save