1

If I wanted my contract to be able to call different types of contracts, with different parameters and parameter types, and I didn't know what those parameters were going to be ahead of time... I have a method that needs to be able to call an oracle. When adding the oracle, the user will add the parameters needed to call the oracle. I'm not sure how to store the parameter types, but I figure I could store the parameter type as a string...

Anyways, is this possible?

1 Answer 1

3

I believe this is not possible, one solution would be to use a parameter of type bytes that would be the result of a pack, then your unknown future contracts will know how to unpack this param.

2
  • That's right, it's not possible, the contract must know the types when it's compiled and originated. It's not something from Michelson, strongly typed languages generally need to know the types in advance, it increases the safety of your contract (so users cannot pass any type of value, potentially dangerous). Jun 23, 2022 at 16:41
  • Thanks. I thought that would be the case.
    – littlezigy
    Jun 23, 2022 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.