跳至主要内容

協助翻譯本頁面

🌏

由於尚未翻譯,本頁面內容以英文顯示。協助我們翻譯內容。

翻譯本頁面

這裡沒有漏洞!🐛

此頁面未翻譯,目前特意維持英文原文。

Deploying smart contracts

最後編輯: , Invalid DateTime
編輯頁面

You need to deploy your smart contract for it to be available to users of an Ethereum network.

To deploy a smart contract, you merely send an Ethereum transaction containing the compiled code of the smart contract without specifying any recipient.

Prerequisites

You should understand Ethereum networks, transactions and the anatomy of smart contracts before deploying smart contracts.

Deploying a contract also costs ether (ETH), so you should be familiar with gas and fees on Ethereum.

Finally, you'll need to compile your contract before deploying it, so make sure you've read about compiling smart contracts.

How to deploy a smart contract

What you'll need

  • your contract's bytecode – this is generated through compilation
  • ETH for gas – you'll set your gas limit like other transactions so be aware that contract deployment needs a lot more gas than a simple ETH transfer
  • a deployment script or plugin
  • access to an Ethereum node, either by running your own, connecting to a public node, or via an API key using a node service like Infura or Alchemy

Steps to deploy a smart contract

The specific steps involved will depend on the tooling you use. For an example, check out the Hardhat documentation on deploying your contracts or Truffle documentation on networks and app deployment. These are two of the most popular tools for smart contract deployment, which involve writing a script to handle the deployment steps.

Once deployed, your contract will have an Ethereum address like other accounts.

Remix - Remix IDE allows developing, deploying and administering smart contracts for Ethereum like blockchains

Tenderly - Simulate, debug and monitor anything on EVM-compatible chains, with real-time data

Hardhat - A development environment to compile, deploy, test, and debug your Ethereum software

Truffle - A development environment, testing framework, build pipeline, and other tools.

Further reading

Know of a community resource that helped you? Edit this page and add it!

這篇文章對您有幫助嗎?

👈

上一頁

Compiling smart contracts

下一頁

Verifying smart contracts
👉
網站上次更新: 2022年9月26日

使用以太坊

  • 尋找錢包
  • 取得以太幣
  • 去中心化應用程式 (dapp)
  • 第二層
  • 執行節點
  • 穩定幣
  • Stake ETH

生態系統

  • 社群中心
  • 以太坊基金會
  • 以太坊基金會部落格
  • 生態系統支援計畫
  • 以太坊漏洞懸賞計畫
  • 生態系統獎助金計畫
  • 以太坊品牌資產
  • Devcon