Chain Ops, the hidden role at smart contracts development

Chain Ops, the hidden role at smart contracts development

The moment when you deploy to Mainnet and gas spikes to over 9000 ?? ??


What do you think about the state of #ChainOps and #SmartContracts deployments?


What is Chain Ops?

?Chain Ops is a sub-field in smart contracts development that normally nobody doesn't want to deal with it ??


Your job is to orchestrate on-chain tasks and perform operations against an unpredictable and hostile environment like the Ethereum network and the dark forest ??????


If you want to delegate on-chain tasks or deployments orchestration to experts in the field, we can take care at? Web3 Ops .


Book us at?https://calendly.com/web3ops????

Learn more about the role

But if you are an autodidact and want to learn some of my tricks, keep reading this post.


I built my own scripts, extended the tools available and burned tons of $ETH in the process ??. None of the available tools are perfect, and you always need to deal with tradeoffs or bugs.?


Production deployments are stressful and costly in some networks like Ethereum, where a bad orchestration could result in the loss of $ETH.


Other times, you spend hours trying to deploy due network congestions. Best times for deployments are during the weekends or early morning ????


To perform Chain-Ops you need to learn about:

  • Hot and cold wallets security
  • Deployment patterns: CREATE2, Factories, proxies
  • Deep understanding about Solidity, artifacts, metadata
  • Scripting in Solidity or Javascript
  • Target network limits: codesize, initsize, gas limit, gas prices

Tools for Smart Contracts deployments

Foundry Solidity Scripts, due how powerful is to simulate and type-check all the orchestration in Solidity, before broadcasting to Mainnet.

  • Simulations built-it
  • Solidity is the best language to orchestrate smart contracts
  • You can import JSON configs or use pure Solidity configurations
  • Automated verification system, but is still not perfect in some edge cases
  • Saves all transaction information, at /broadcast/:script/:chainid

Read more at Foundry book: https://book.getfoundry.sh/tutorials/solidity-scripting


Hardhat Deploy, a solid way to perform smart contracts deployments in production.

  • Write orchestration scripts with Typescript.
  • Advanced retry system in case transactions get stuck due gas spikes or network errors.
  • Saves constructor arguments and extra metadata at /deployments/:chainid
  • Easy to automate and verify large deployments at Etherscan.


Learn more about Hardhat Deploy at: https://github.com/wighawag/hardhat-deploy

If you want to see how to use Hardhat Deploy in a large codebase in production, like the Aave V3 deployment, create2, multi-chain support, and with NPM export system, check out the repository.

Aave V3 Deploy scripts production example with Hardhat Deploy: https://github.com/aave/aave-v3-deploy/

Tips and tricks to deal with Chain Ops:

- More Txs equals to more unpredictability in production.

- Batch calls together, if possible

- Avoid the usage of External Libraries

- Write deployment reports, save commit hash and upload artifacts.?


If you want more content about the field of Chain Ops, let me know in the comments to share more stuff about the role nobody wants to take ??

Dima Kuprin

Head of Trading, Managing Partner

1 年

David, thanks for sharing!

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了