-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support functions for contract arguments #2270
Labels
Comments
0x-r4bbit
added a commit
that referenced
this issue
Feb 18, 2020
… functions This commit introduces a new feature that enables users to calculate Smart Contract constructor arguments lazily using an (async) function. Similar to normal Smart Contract configurations, the return or resolved value from that function has to be either a list of arguments in the order as they are needed for the constructor, or as an object with named members that match the arguments individually. ``` ... development: { deploy: { SimpleStorage: { args: async ({ contracts, web3, logger}) => { // do something with `contracts` and `web3` to determine // arguments let someValue = await ...; return [someValue]; // or return { initialValue: someValue }; } } } } ... ``` Closes #2270
0x-r4bbit
added a commit
that referenced
this issue
Feb 20, 2020
… functions This commit introduces a new feature that enables users to calculate Smart Contract constructor arguments lazily using an (async) function. Similar to normal Smart Contract configurations, the return or resolved value from that function has to be either a list of arguments in the order as they are needed for the constructor, or as an object with named members that match the arguments individually. ``` ... development: { deploy: { SimpleStorage: { args: async ({ contracts, web3, logger}) => { // do something with `contracts` and `web3` to determine // arguments let someValue = await ...; return [someValue]; // or return { initialValue: someValue }; } } } } ... ``` Closes #2270
0x-r4bbit
added a commit
that referenced
this issue
Mar 2, 2020
… functions This commit introduces a new feature that enables users to calculate Smart Contract constructor arguments lazily using an (async) function. Similar to normal Smart Contract configurations, the return or resolved value from that function has to be either a list of arguments in the order as they are needed for the constructor, or as an object with named members that match the arguments individually. ``` ... development: { deploy: { SimpleStorage: { args: async ({ contracts, web3, logger}) => { // do something with `contracts` and `web3` to determine // arguments let someValue = await ...; return [someValue]; // or return { initialValue: someValue }; } } } } ... ``` Closes #2270
0x-r4bbit
added a commit
that referenced
this issue
Mar 3, 2020
… functions This commit introduces a new feature that enables users to calculate Smart Contract constructor arguments lazily using an (async) function. Similar to normal Smart Contract configurations, the return or resolved value from that function has to be either a list of arguments in the order as they are needed for the constructor, or as an object with named members that match the arguments individually. ``` ... development: { deploy: { SimpleStorage: { args: async ({ contracts, web3, logger}) => { // do something with `contracts` and `web3` to determine // arguments let someValue = await ...; return [someValue]; // or return { initialValue: someValue }; } } } } ... ``` Closes #2270
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request
Some contracts require dynamic arguments that are product of contract calls, or contain abi encoded data. Proxy contracts are one of those. When a proxy contract is created, you have the option of initializing the contract immediatly, instead of having to execute a separate transaction. Let's do a quick example.
Assume you have a proxy contract with the following interface:
And you have a base contract like this:
With the current options embark provides, I have to do the initialization of the proxy contract by using an afterDeploy script:
Ideally, this data script wouldnt be necessary if I were able to use the second argument of the proxy's constructor to execute the initialization as soon as the contract is deployed, by allowing the
args
incontract.js
to accept a function that can return dynamic arguments like in this proposal:The text was updated successfully, but these errors were encountered: