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 container for a smart contract bundle #1256

Open
hackaugusto opened this issue Sep 30, 2019 · 2 comments
Open

Add a container for a smart contract bundle #1256

hackaugusto opened this issue Sep 30, 2019 · 2 comments
Labels
efforts: a few days hack enhancement New feature or request P2 demanded by somebody

Comments

@hackaugusto
Copy link
Contributor

hackaugusto commented Sep 30, 2019

The goal is to have a data type to represent the constraint of version compatibility, this can be used to provide better type safety and as a nice way of sharing the necessary data to interact the blockchain.

A bundle for plain smart contracts:

  • An typed attribute for each of the smart contracts that is part of the bundle and that together.
  • For each of the smart contracts it needs:
    • The abi
    • The contract_version
    • The smart contract bytecode to do the deployment (IMO this should be an special type because it may need linking)
    • The runtimebytecode (IMO this should be an special type because it may need linking)
    • A list of the library dependencies

The bundle for deployed smart contracts:

  • The above smart contract definition can be extended/wrapped and have the following added to it:
    • The chain_id
    • The address
    • The gas estimation for each function (IMO this should be a custom class for each smart contract, and not a dictionary)

This is a rough sketch, please further iterate and refine the design.

@hackaugusto
Copy link
Contributor Author

My motivation for this is that currently:

  • The contract manager does not have the chain_id, so the values have to be passed around together
  • The contract manager does not have the gas estimation in it, so the path of the smart contract has to be passed around
  • The gas estimation is a dictionary, which has led to bugs where the wrong key was used and the type checker cannot catch it.

@pirapira
Copy link
Contributor

pirapira commented Oct 2, 2019

Related #1085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
efforts: a few days hack enhancement New feature or request P2 demanded by somebody
Projects
None yet
Development

No branches or pull requests

3 participants