1

I'm using the Teztool in sandbox mode. My contract compiles, but when I deploy:

teztool carthagenet sandbox client originate contract tezart transferring 0 from bootstrap1 running tezart.tz

I get this:

Warning:

   The node you are connecting to claims to be running in a
                    Tezos TEST SANDBOX.
      Do NOT use your fundraiser keys on this network.
  You should not see this message if you are not a developer.

Node is bootstrapped, ready for injecting operations.
This simulation failed:
  Manager signed operations:
    From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
    Fee to the baker: ꜩ0
    Expected counter: 1
    Gas limit: 800000
    Storage limit: 60000 bytes
    Origination:
      From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
      Credit: ꜩ0
      Script:
        { parameter
            (or (or (pair %createArtwork (string %0) (string %1))
                    (pair %transfer (string %0) (address %1)))
                (string %updateArtist)) ;
          storage
            (pair (map %artists address string)
                  (map %artwork
                     string
                     (pair (pair (address %artist) (string %ipfsArtworkAddress)) (address %owner)))) ;
          code { DUP ;
                 CDR ;
                 PUSH mutez 0 ;
                 AMOUNT ;
                 COMPARE ;
                 NEQ ;
                 IF { PUSH string "This is a tokenless contract" ; FAILWITH }
                    { PUSH unit Unit } ;
                 DIP 2 { DUP } ;
                 DIG 2 ;
                 CAR ;
                 IF_LEFT
                   { DUP ;
                     IF_LEFT
                       { DUP ;
                         DIP 4 { DUP } ;
                         DIG 4 ;
                         DIP { DUP ; CAR } ;
                         PAIR ;
                         DIP { DUP ; CDR } ;
                         PAIR ;
                         DUP ;
                         CAR ;
                         CAR ;
                         DUP ;
                         DIP 2 { DUP } ;
                         DIG 2 ;
                         CAR ;
                         CDR ;
                         DIP { DIP 2 { DUP } ;
                               DIG 2 ;
                               CDR ;
                               SENDER ;
                               PAIR ;
                               SENDER ;
                               SWAP ;
                               PAIR ;
                               SOME ;
                               DIP { DIP { DUP } ; SWAP ; CDR } } ;
                         UPDATE ;
                         SWAP ;
                         CAR ;
                         PAIR ;
                         DIP { DROP 4 } }
                       { DIP 3 { DUP } ; DIG 3 ; DIP { DROP } } ;
                     DIP { DROP } }
                   { DIP 2 { DUP } ;
                     DIG 2 ;
                     DIP { DUP } ;
                     PAIR ;
                     DUP ;
                     CAR ;
                     DUP ;
                     DIP 2 { DUP } ;
                     DIG 2 ;
                     CDR ;
                     SOME ;
                     DIP { DIP { DUP } ; SWAP ; CAR } ;
                     SENDER ;
                     UPDATE ;
                     SWAP ;
                     CDR ;
                     SWAP ;
                     PAIR ;
                     DIP { DROP 3 } } ;
                 NIL operation ;
                 PAIR ;
                 DIP { DROP 3 } } }
        Initial storage: Unit
        No delegate for this contract
        This operation FAILED.

Ill typed data: 1: Unit
is not an expression of type
  pair (map %artists address string)
       (map %artwork
          string
          (pair (pair (address %artist) (string %ipfsArtworkAddress)) (address %owner)))
At line 1 characters 0 to 4, value Unit
is invalid for type
  pair (map %artists address string)
       (map %artwork
          string
          (pair (pair (address %artist) (string %ipfsArtworkAddress)) (address %owner))).
At line 1 characters 0 to 4,
invalid primitive Unit, only Pair can be used here.

Thanks in advance!

3

You need to provide an initial storage value for your contract. You can write it in Ligo and compile it too using the ligo compile-storage command.

| improve this answer | |
  • Yes! Got it working with ligo compile-storage tezart.ligo main "record [ artists = ((map[]) : artists); artwork = ((map[]) : artworks)]" – Mark Robson Apr 15 at 14:33

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.