-``JavaScript VM``: All the transactions will be executed in a sandbox blockchain in the browser. This means nothing will be persisted and a page reload will restart a new blockchain from scratch, the old one will not be saved.
-``Injected Provider``: Remix will connect to an injected web3 provider. ``Mist`` and ``Metamask`` are example of providers that inject web3, thus can be used with this option.
-``Web3 Provider``: Remix will connect to a remote node. You will need to provide the URL address to the selected provider: geth, parity or any Ethereum client.
-``At Address`` assumes the given address is an instance of the selected contract. It is then possible to interact with an already deployed contract. There's no check at this point, so be careful when using this feature, and be sure you trust the contract at that address.
-``Create`` send a transaction that deploys the selected contract. When the transaction is mined, the newly created instance will be added (this might take several seconds). Note that if the ``constructor`` has parameters, you need to specify them.
Validating a transaction take several seconds. During this time, the GUI shows it in a pending mode. When transaction is mined the number of pending transactions is updated
- The called function is declared as ``constant`` or ``pure`` in Solidity. The action has a blue background, clicking it does not create a new transaction. Clicking it is not necessary because there are not state changes - but it will update the return value of the function.
- The called function has no special keywords. The action has a light red background, clicking on does create a new transaction. But this transaction cannot accept any amount of Ether.
- The called function is declared as ``payable`` in Solidity. The action has a red background, clicking it does create a new transaction and this transaction can accept value.
For more information about Solidity modifier, see `Solidity modifier <http://solidity.readthedocs.io/en/develop/miscellaneous.html?highlight=pure#modifiers>`_ .
Using ``Create`` or ``At Address`` is a classic use case of Remix. It is possible though to interact with a contract by using its ABI. The ABI is a JSON array which describe its interface.
To interact with a contract using the ABI, create a new file in Remix with extension ``*.abi`` and copy the ABI content to it.
Then in the input next to ``At Address``, put the Address of the contract you want to interact with. Click on ``At Address``,
a new "connection" with the contract will popup below.
USING THE RECORDER
------------------
The Recorder allows to save a bunch of transactions in a JSON file and rerun them later either in the same environment or in another.
Saving to JSON allows to easily check the transaction list, tweak input parameters, change linked library, etc...
We can find many use cases for the recorder, for instance:
- After having coded and tested contracts in a constrained environment (like the JavaScript VM), it could be interesting to redeploy them easily in a more persisted environment (like a Geth node) in order to check whether everything behaves normally in a classic environment.
- Deploying contract does often require more than creating one transaction.
- Working in a dev environment does often require to setup the state in a first place.
..image:: images/remix_recorder.png
Saving a record ends up with the creation of this type of content (see below):
In that specific record, 3 transactions are executed:
The first corresponds to the deployment of the lib ``testLib``.
The second corresponds to the deployment of the contract ``test``, the first parameter of the constructor is set to 11.
That contract depends on a library. The linkage is done using the property ``linkReferences``.
In that case we use the addres of the previously created library : ``created{1512830014773}``. the number is
the id (timestamp) of the transaction that leads to the creation of the library.
The third parameter corresponds to the call to te function ``set`` of the contract ``test`` (the property to is set to: ``created{1512830015080}``) . Input parameters are ``1`` and ``0xca35b7d915458ef540ade6068dfe2f44e8fa733c``
all these transactions are created using the value of the accounts ``account{0}``.