Skip to content

Commit

Permalink
Merge pull request #3102 from ethereum/integrations
Browse files Browse the repository at this point in the history
updated external native Integrations
  • Loading branch information
ryestew committed Jul 21, 2022
2 parents 21f679c + c67d0a1 commit e6a5fca
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 46 deletions.
40 changes: 40 additions & 0 deletions docs/foundry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Foundry
============

_(Supported since Remix IDE v0.25.0)_

Foundry Provider
------------------

**Foundry Provider** is a plugin on Remix IDE which enables users to deploy the contract to the Foundry's built-in **Anvil** blockchain. `Foundry Provider` can be chosen from the list of environments in `Deploy & Run Transactions` plugin.

![](images/a-foundry-provider.png)

As soon as you select `Foundry Provider`, a modal is opened asking for the `Anvil JSON-RPC Endpoint`.

![](images/a-foundry-provider-modal.png)

If Foundry Anvil node is running with default options, the default endpoint value in modal will not need any change. In case, Anvil node host and port are different, JSON-RPC endpoint should be updated in the modal text box.

Once the correct endpoint is filled in the modal, just click on `OK` and the accounts from the Anvil node will be loaded in the `ACCOUNT` section. Network id will also be shown.

![](images/a-foundry-provider-connected.png)

Now, one can start deploying the contract from Remix IDE to the local Anvil node as usual.

Foundry Remappings
------------------

Foundry manages dependencies using git submodules and can remap dependencies to make them easier to import. So import defined by remappings can have compilation errors on Remix IDE.

To support such compilation, Remix suggests running [compilation using a compiler config file](https://remix-ide.readthedocs.io/en/latest/compile.html#json-file-for-compiler-configuration). Remix adds some default Forge remappings in the compiler config file when a Foundry project is loaded in Remix IDE using remixd.

![](images/a-foundry-cc.png)

Further, more remappings can be added manually, if required.






31 changes: 29 additions & 2 deletions docs/hardhat.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Hardhat Integration
Hardhat
============

_(Supported since Remix IDE v0.12.0 and Remixd v0.3.6)_
Expand Down Expand Up @@ -56,7 +56,7 @@ Hardhat Provider

_In Hardhat, contracts are deployed by starting a local node. Read more about it in [Hardhat documentation](https://hardhat.org/getting-started/#connecting-a-wallet-or-dapp-to-hardhat-network)_

**Hardhat Provider** is a plugin on Remix IDE which enables users to deploy the contract to the Hardhat 'localhost' network. This can be chosed from the `ENVIRONMENT` dropdown of `Deploy and Run Transactions` plugin.
**Hardhat Provider** is a plugin on Remix IDE which enables users to deploy the contract to the Hardhat 'localhost' network. This can be chosen from the `ENVIRONMENT` dropdown of `Deploy and Run Transactions` plugin.

![](images/a-hardhat-provider-dropdown.png)

Expand All @@ -72,6 +72,33 @@ Once the correct endpoint is filled in the modal, just click on `OK` and the acc

Now, one can start deploying the contract from Remix IDE to the Hardhat local node as usual.

`console.log` in Remix IDE
---------------------------

_(Supported since Remix IDE v0.17.0)_

Remix IDE supports hardhat console library while using `Remix VM`. It can be used while making a transaction or running unit tests.

### Deploy and Run Transactions

To try it out, you need to put an import statement and use `console.log` to print the value as shown in image.

![](images/hardhat-console-file.png)

Further, once you execute the `changeOwner` method, the value from console statement will be shown in Remix terminal after transaction details as below:

![](images/hardhat-tx-terminal.png)

### Solidity Unit Testing

Similarly, `console.log` can be used while running unit tests using Remix Solidity Unit Testing plugin. See image below.

![](images/hardhat-utesting-file.png)

For the tests including logging message, it will display in the Remix Terminal corresponding to test name.

![](images/hardhat-utesting-terminal.png)




Expand Down
41 changes: 0 additions & 41 deletions docs/hardhat_console.md

This file was deleted.

Binary file added docs/images/a-foundry-cc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-foundry-provider-connected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-foundry-provider-modal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-foundry-provider.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/a-hardhat-provider-dropdown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/a-truffle-provider-modal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Useful links:
hardhat
truffle
slither
hardhat_console
foundry

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/slither.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Slither Integration
Slither
============

_(Supported since Remix IDE v0.15.0 and Remixd v0.5.0)_
Expand Down
2 changes: 1 addition & 1 deletion docs/truffle.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Truffle Integration
Truffle
============

_(Supported since Remix IDE v0.23.0 and Remixd v0.6.0)_
Expand Down

0 comments on commit e6a5fca

Please sign in to comment.