Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@embark/specialconfigs): introduce dynamic addresses (#1873)
* fix embarkjs generation fix ens setProvider fix embarkjs objects fix generated embarkjs provider generate contracts fix embarkjs-ens * address some of the issues in the code review * feat(@embark/specialconfigs): introduce dynamic addresses This commit introduces a new Smart Contract configuration addressHandler that lets users define a function to "lazily" compute the address of the Smart Contract in question. This is useful when a third-party takes care of deploying a dependency Smart Contract, but the address of that Smart Contract only being available at run-time. Example: ``` deploy: { SimpleStorage: { fromIndex: 0, args: [100], }, OtherContract: { deps: ['SimpleStorage'], address: async (deps) => { // use `deps.contracts.SimpleStorage` to determine address }, abiDefinition: ABI }, } ``` In the example above, OtherContract will be deployed after SimpleStorage because it uses the deps property to define Smart Contracts that it depends on. All dependencies are exposed on the addressHandler function parameter similar to deployment hooks. Closes #1690
- Loading branch information
1 parent
022a3c1
commit 86ee867
Showing
6 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters