Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Tezos SmartPy contract deployment

Jonas Hals edited this page Jun 10, 2020 · 1 revision

1. Source code

Get set up with smartpy.io and the contract source code (https://smartpy.io/dev/?template=oracle.py).

2. Compiling

Click the "Run" button in SmartPy. This populates the right column.

Go to the "Michelson" tab for each contract. This will show "Generated Michelson" with the tabs "Storage" and "Code".

Copy the code into a file $CONTRACT_NAME.tz. Take note of the initial storage code (later referred as $INITIAL_STORAGE).

3. Originating

We will originate/deploy these contracts using the tezos-client cli.

tezos-client --wait none originate contract $CONTRACT_NAME \
transferring 0 from $YOUR_ACCOUNT running $CONTRACT_NAME.tz \
--init '$INITIAL_STORAGE' \
--burn-cap 10 --force

A successful origination will end with something like this:

        This origination was successfully applied
        Originated contracts:
          KT1CxSVG8NxNpt4u1sVWZ6wgX3ghDWpPmhFK
        Storage size: 2385 bytes
        Paid storage size diff: 2385 bytes
        Consumed gas: 66149
        Balance updates:
          tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb ... -ꜩ2.385
          tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb ... -ꜩ0.257

New contract KT1CxSVG8NxNpt4u1sVWZ6wgX3ghDWpPmhFK originated.
Contract memorized as Client.
Clone this wiki locally