Skip to content

feat: add ContractCreateTransaction #198

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

Merged

Conversation

Dosik13
Copy link
Contributor

@Dosik13 Dosik13 commented Jul 18, 2025

Description:
Implemented the ContractCreateTransaction class that allows creating smart contracts on the network.

  • Add ContractId class for contract identifier representation
  • Add unit tests for ContractId class
  • Add ContractFunctionParameters class for contract function parameter handling using https://github.com/ethereum/eth-abi/tree/main
  • Add eth-abi dependency in pyproject.toml
  • Add comprehensive type stub file (contract_function_parameters.pyi) for enhanced IDE support and type checking
  • Add ContractCreateTransaction class implementation
  • Add unit tests for ContractCreateTransaction class
  • Add integration tests for ContractCreateTransaction
  • Export contract_id property in TransactionReceipt class
  • Update examples README with contract create transaction documentation
  • Add contract create transaction examples
    • contract create with simple contract
    • contract create with stateful contract (using contract constructor)
    • contract create directly with bytecode (without using file)

Related issue(s):

Fixes #197

Notes for reviewer:

The purpose of the ContractFunctionParameters class is to encode parameters for smart contract function calls using the Ethereum ABI format. It uses eth-abi library to handle the low-level encoding details while providing a clean, fluent API.

The class employs dynamic method generation to create methods for all integer types (int8-int256, uint8-uint256) at runtime, avoiding repetitive code. This approach is complemented by a comprehensive type stub file (.pyi) that provides IDE support and static type checking.

Also, I added eth-abi dependency in pyproject.toml so every dependency is installed properly.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super cool

@Dosik13 Dosik13 force-pushed the feature/add-ContractCreateTransaction branch 2 times, most recently from 62d6399 to 99202bf Compare July 21, 2025 12:58
@Dosik13 Dosik13 marked this pull request as ready for review July 28, 2025 13:05
@Dosik13 Dosik13 force-pushed the feature/add-ContractCreateTransaction branch from 747f3db to 2179030 Compare July 28, 2025 21:50
@Dosik13 Dosik13 requested a review from exploreriii July 30, 2025 08:33
exploreriii

This comment was marked as resolved.

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me looks good, am not sure on the source of the check error at the moment

@nadineloepfe
Copy link
Contributor

the error seems to be coming from our own solo-actions package, which is weird. let's rerun and hope that fixes it

@exploreriii
Copy link
Contributor

Hi @Dosik13 could you try pushing an empty commit and see if that will re-trigger the runner check, which should pass this time

Dosik13 added 15 commits August 3, 2025 21:52
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…StatefulContract for state management)

Signed-off-by: dosi <dosi.kolev@limechain.tech>
…lization

Signed-off-by: dosi <dosi.kolev@limechain.tech>
…nd add constructor test

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Dosik13 added 17 commits August 3, 2025 21:53
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…eter encoding

Signed-off-by: dosi <dosi.kolev@limechain.tech>
…support

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…tionParameters

Signed-off-by: dosi <dosi.kolev@limechain.tech>
…FunctionParameters

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…o __init__.py

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@Dosik13 Dosik13 force-pushed the feature/add-ContractCreateTransaction branch from 76236d3 to ee4b724 Compare August 3, 2025 18:53
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@Dosik13 Dosik13 merged commit 8da0e6c into hiero-ledger:main Aug 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ContractCreateTransaction
3 participants