0

I have a contract that is able to call another module on chain from within itself, and it is working as follows:

(defun call-other(nft-id)
    (mod-2.defun-name ...params)

I am trying to do it dynamically by passing module name of "mod-2" to the defun, and hopefully using a symbol to call mod-2 dynamically but it cant resolve mod.

Ideal:

(defun call-other(nft-id:string mod:string)

  ('mod.defun-name ...params )

Any ideas would be greatly appreciated

Masoud Keshavarz
  • 2,166
  • 9
  • 36
  • 48

1 Answers1

1

You can pass modules as params and call them as follows :

(From Babena marm implementations; awesome job folks and thanks!)

calling from defun

passing through env-data

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 29 '22 at 06:00