Deploying smart contracts best practices

Hey all,

I’m going through the development portal and tutorials and I was wondering what’s the best practices for fast smart contract deployment on testnet (for development purposes).

So far I used sandbox goal to deploy some dummy smart contract and interact with them, and also used the js-algosdk to do it from nodejs (both works ok).

I’m trying to replicate the truffle style automation on Ethereum to do this faster, so ideally I would like to:

  1. Write my smart contracts on my project/contracts folder using pyteal
  2. Setup some simple .config file with creator addresses, mnemonics etc
  3. cd into contracts folder and run a script to compile and generate the artifacts (simlar to truffle compile)
  4. Then submit the compiled app to the network (similar to truffle migrate)

The steps I’m following at the moment seems very convoluted

  1. running python3 ./contracts/dummy_contract.py > ./artifacts/dummy_contract.teal
  2. from my node app then I need to serialize the generated .teal files to strings as my program source and then using the TextEncoder and eventually pass the program bytes to client.compile method
  3. afterwards I’m creating the tx (algosdk.makeApplicationCreateTxn) sign it and submit it
  4. Finally running waitFor Confirmation (which fails if I don’t specify a rounds number for the 3rd arg)

So I was wondering how most algo devs usually deploy their apps for development, are people usually writing their own tools for these kind of stuff or is there some 3rd party service for this (like truffle on ethereum) that devs prefer to use? Someone suggested https://algobuilder.dev but haven’t had the chance to have a look yet.

Thanks!
~k

For anyone looking for similar build tools I just conveniently found these pyteal series that includes some nice pyteal helpers and export build tools.

1 Like