Skip to content

Commit

Permalink
fix(@embar/site): fix proxyFor docs
Browse files Browse the repository at this point in the history
Change to smart contract and fix forProxy -> proxyFor
  • Loading branch information
jrainville authored and iurimatias committed Feb 19, 2020
1 parent e271ceb commit 0461fa0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions site/source/docs/contracts_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ deploy: {

## Proxy Contract Support

Proxy contracts are powerful tools usually used in more complex Dapps. They can be used for contracts that can be upgraded or to alleviate the deploy cost of multiple instances of a contract.
Proxy smart contracts are powerful tools usually used in more complex Dapps. They can be used for smart contracts that can be upgraded or to alleviate the deploy cost of multiple instances of a contract.

However, interacting with Proxy contracts is usually difficult, because you have to point the Base contract to the address of the Proxy for it to work.

Not anymore! Embark now supports a contract configuration named `forProxy`.
Not anymore! Embark now supports a smart contract configuration named `proxyFor`.

With it, you can specify that a Proxy contract is, well, a proxy *for* another one. Here's an example:
With it, you can specify that a Proxy smart contract is, well, a proxy *for* another one. Here's an example:

```javascript
deploy: {
Expand All @@ -362,11 +362,11 @@ deploy: {

With this configuration, our `ContractInstance` is an `instanceOf` `Proxy` and a `proxyFor` `BaseContract`.
This is why we point to `BaseContract` in the `ContractInstance` arguments.
The arguments themselves depend on the implementations of your `BaseContract` and `Proxy` contract.
The arguments themselves depend on the implementations of your `BaseContract` and `Proxy` smart contracts.

Note that you could have used `Proxy` itself as a `proxyFor` `BaseContract`, but it's usually more intuitive to use `instanceOf` and then resolve the contract instance with the new name you gave it (`ContractInstance` in this case).
Note that you could have used `Proxy` itself as a `proxyFor` `BaseContract`, but it's usually more intuitive to use `instanceOf` and then resolve the smart contract instance with the new name you gave it (`ContractInstance` in this case).

Once the contracts are deployed, all you have to do is:
Once the smart contracts are deployed, all you have to do is:

```
import ContractInstance from 'path/to/artifacts/contracts/ContractInstance';
Expand Down

0 comments on commit 0461fa0

Please sign in to comment.