8

We need to deploy a set of several smart contracts, x-compiled from Solidity to wasm, and maintain that deployment (deploy new contract instances and migrate to them once in a while).

So what we ideally would like to use is sort-of a hardhat-deploy, but for Substrate. We are wondering how other dotsama ecosystem protocols do it.

swanky is a good start, but like one level too low. You still need sort-of a runner that checks what contracts have been deployed yet, which ones should be redeployed and then run deployment scripts that invoke swanky.

Suggestions would be much appreciated!

2

4 Answers 4

2

As far as I know, Typechain allows writing some not hard scripts for deploying smart contracts, but I'm not sure that that's the thing you are searching for. Anyway, you can check it here: https://github.com/Brushfam/typechain-polkadot

1
  • Thanks! Not really what we are looking for, though. swanky is essentially already one level too low-level and typechain is more or less a level below swanky even. The question is not so much about feasibility of complex deployments, but rather how to do it in a brief, convenient manner without re-inventing the wheel ;) Commented Apr 21, 2023 at 8:49
2

At useInkathon (https://github.com/scio-labs/use-inkathon) I offer a pretty straightforward deployContract script, together with some additional helpers defined in inkathon.xyz this results in super simple deploy scripts (example: https://github.com/scio-labs/inkathon/blob/main/packages/contracts/scripts/deploy.ts). Here at AZERO Domains we deploy a set of several dependant, rather complex contracts in a few lines only. 🫡

1

This is a tool that we need in the ecosystem. You must currently do this via your own scripts + PolkadotJS, or via ContractsUI.

If you or someone would like to build something like hardhat-deploy there are grants available through use.ink/ubator/

1

Unfortunately, as far as I know, the best way currently would be to script something that under the hood uses cargo-contract or polkadot-js/api.

I know this is far from ideal and we actively want to help get to a better solution. Please, if you have any requirements in cargo-contract that would ease this for you, just create an issue in https://github.com/paritytech/cargo-contract/issues.

We will soon merge a PR for cargo contract info, which will enable you to query the state of a contract on-chain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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