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

Add a "create contract code" endpoint to the v3 definition #4133

Open
zxq9 opened this issue May 9, 2023 · 1 comment
Open

Add a "create contract code" endpoint to the v3 definition #4133

zxq9 opened this issue May 9, 2023 · 1 comment
Assignees
Labels
area/api Issues or PRs related to the public API

Comments

@zxq9
Copy link
Contributor

zxq9 commented May 9, 2023

In the course of developing the Vanillae library it became evident that creation of contract call data is a bit complex and difficult, and not handled any standard way anywhere. The short term solution was to simply write out the routines necessary to create the call data actually in Vanillae itself, mostly by mimicing what the node does internally. This was easy because the Vanillae's first language binding was for Erlang and the node is written in Erlang, but this is not a good general solution for other languages later on. (example: https://github.com/aeternity/Vanillae/blob/21040bf4b868194e1056715948b3e14e6ae749c2/bindings/erlang/src/vanillae.erl#L1205-L1340 )

The easiest way to fix this is to create a new endpoint on the node that can accept a contract call definition (function name + args), an ACI, and the remaining transaction details (gas, fee, gas price, amount, etc.) and simply return the final contract call data. This should be relatively trivial given that the code to do this is already in the node, just not hooked up to any endpoint at the moment.

@zxq9 zxq9 added the need/triage New issues which need to be categorized label May 9, 2023
@zxq9 zxq9 self-assigned this May 9, 2023
@zxq9 zxq9 added area/api Issues or PRs related to the public API and removed need/triage New issues which need to be categorized labels May 9, 2023
@hanssv
Copy link
Member

hanssv commented May 31, 2023

This is not trivial, the code you refer to is only a test dependency to the node (and for a good reason).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Issues or PRs related to the public API
Projects
None yet
Development

No branches or pull requests

2 participants