Skip to content
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

Re-enable REPLICATE_CONTRACT #1180

Open
jjcnn opened this issue Oct 7, 2022 · 3 comments
Open

Re-enable REPLICATE_CONTRACT #1180

jjcnn opened this issue Oct 7, 2022 · 3 comments
Labels
blockchain community request Feature or bugfix requested by the Scilla community enhancement New feature or request
Milestone

Comments

@jjcnn
Copy link
Contributor

jjcnn commented Oct 7, 2022

The REPLICATE_CONTRACT feature has been disabled due to lack of blockchain support. The code is currently commented out, and should be reintroduced (and re-tested) once blockchain support has been implemented.

This issue depends on https://zilliqa-jira.atlassian.net/browse/ZIL-4698.

@jjcnn jjcnn added enhancement New feature or request blockchain community request Feature or bugfix requested by the Scilla community labels Oct 7, 2022
@jjcnn jjcnn added this to the Scilla 0.14.0 milestone Oct 7, 2022
@jjcnn
Copy link
Contributor Author

jjcnn commented Oct 7, 2022

Assigning this to milestone 0.14 as this is a feature request from the community.

@jjcnn
Copy link
Contributor Author

jjcnn commented Oct 7, 2022

The commit that disables the feature is here: d1f137a

Note that only the commented-out pieces of code need to be reintroduced, and the test output updated. The change related to bcfetch_args in the parser is a bugfix, and now works as intended.

@jjcnn
Copy link
Contributor Author

jjcnn commented Dec 5, 2022

Possibly rethink the concrete syntax for this.

The current syntax is

x <-& REPLICATE_CONTRACT addr y1 y2 y3

This means that we assign values to the replicated contract's parameters based on the order of the actual parameters, and this is inconsistent with how we invoke transitions.

What we ought to do is something like this:

x <-& REPLICATE_CONTRACT addr { param1 : y1; param2 : y2; param3 : y3}

Now we can rely on the name paramX to determine which value should be assigned to which parameter.

This further allows for a partial static typecheck of the statement: If addr is known to have type ByStr20 with contract (param1 : Uint128) end, then we know that param1 should be one of the parameter names in REPLICATE_CONTRACT, and we know that its assigned value should be Uint128. Note that the type of addr might not list all of the contract's parameters, so the type's parameters should be a subset of the ones listed in REPLICATE_CONTRACT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blockchain community request Feature or bugfix requested by the Scilla community enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant