Monday, March 4, 2024

Deploy multiple smart contracts on a single address and interact with them with web3.py

Hello dear all,
I am developing a decentralized application;

It implements smart contracts with solidity. each object represents a smart contract. So I wrote the Transaction, Project, User contracts. I want to deploy these contracts to a single address; and interact with them from my REST API developed in Django Rest Framework, using the web3.py library

The problem I have is:
1-I wrote the code of the three contracts in a single contract, this contract is heavy and cannot be compiled
2- I finally wrote the contracts differently, deployed them to different addresses, and from another contract I want to interact with these contracts. This allows me to interact with a single contract from my API in order to call on others. The size of this contract is also too much and cannot be compiled.
here is the error message:

CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. When compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack. Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.

How to do ? or what alternative or means used? The objective is to interact with smart contracts deployed from my API in Django Rest Framework

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACiPtiLzQnM9nH%3DiCYaggX4yM9i2kv2-i1dByZGwvDmE1RbkZw%40mail.gmail.com.

No comments:

Post a Comment