diff --git a/docs/FAQ.md b/docs/FAQ.md index a27a8fdf3a..5bdfad1b72 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.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. +**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 @@ -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 diff --git a/docs/images/a-runtab1.png b/docs/images/a-runtab1.png deleted file mode 100644 index 138a93305f..0000000000 Binary files a/docs/images/a-runtab1.png and /dev/null differ diff --git a/docs/images/a-runtab2.png b/docs/images/a-runtab2.png new file mode 100644 index 0000000000..f255f8450c Binary files /dev/null and b/docs/images/a-runtab2.png differ diff --git a/docs/import.md b/docs/import.md index d794cbdf15..2eac9141db 100644 --- a/docs/import.md +++ b/docs/import.md @@ -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) @@ -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 ------------------------------------------------- @@ -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///`. +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('')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"; +``` diff --git a/docs/run.md b/docs/run.md index ccbabdcdf7..e074097520 100644 --- a/docs/run.md +++ b/docs/run.md @@ -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 ---------