Replies: 2 comments 1 reply
-
I didn't know you could pass contract objects like that (I mean I'm actually a noob too haha, so take it with a grain of salt I guess). If you are designing these contracts, could you maybe have a contract interface for the other contract in the contract that has this function, and just pass the contract address as the function parameter, and instantiate the interface in that function for your purposes? You would declare the interface outside the scope of the contract, I do it above or you can import it from another .sol file to reduce clutter https://docs.soliditylang.org/en/v0.8.13/contracts.html#interfaces |
Beta Was this translation helpful? Give feedback.
-
You cannot pass a contract in as an address in v5; that is a feature available in the v6 beta since Contract implements You should pass in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys,
(it takes another contract as argument):
I tried this code:
I get the following error:
Probably I'm missing some key information on how to pass a contract type parameter.
Could you please help me?
Thank you very much.
Andrea
Beta Was this translation helpful? Give feedback.
All reactions