Can someone please give an example Michelson smart contract that calls another smart contract ?

Some actual implementation would go a long way.

Many thanks

2 Answers 2


An example in Michelson

Take one contract

parameter (option string) ;
storage (contract string) ;
    UNPAIR ; DIP { DUP } ;
    IF_SOME { } { PUSH string "hello, world" } ;
    PUSH mutez 0 ; SWAP ;
    NIL operation ; SWAP ; CONS ;

and another

parameter string ;
storage string ;
    UNPAIR ;
    SWAP ;
    DROP ;
    NIL operation ;
    PAIR  ;

The first contract takes an optional string parameter and calls the contract in its storage with that string, or "hello, world" if none was provided. The second contract takes a string as input and puts it in its storage.


Go to liquidity ide and compile that

  • On Stack Exchange it is better to offer responses inline rather than just pointing to a link to some external resources if the size of the answer is not too big. The reason is because links are weak and can expire over time so your answer may become invalid sometime in the future.
    – Ezy
    Feb 3, 2019 at 15:54
  • It is also useful to play with the contracts, thanks!
    – FFF
    Feb 5, 2019 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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