mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-22 10:28:34 +00:00
This commit introduces a new Smart Contract configuration with `address` being an asynchronous function. This 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: ``` contracts: { SimpleStorage: { fromIndex: 0, args: [100], }, OtherContract: { deps: ['SimpleStorage'], address: async (deps) => { // use `deps.contracts.SimpleStorage` to determine address return Promise.resolve(...); }, 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 `address` function parameter similar to deployment hooks. Closes #1690
embark-deploy-tracker
Contract deployment tracker for Embark
Visit embark.status.im to get started with Embark.