# 使用remix部署合约

By [bvicii](https://paragraph.com/@startboy) · 2022-06-15

---

对于熟练的Solidity开发者，可以使用[Truffle](https://www.trufflesuite.com/)这个JavaScript工具通过JavaScript脚本全自动部署合约，减少手动操作导致的出错的可能。这里我们不打算详细介绍Truffle的使用，直接使用在线部署remix去完成部署测试

[https://remix.ethereum.org/](https://remix.ethereum.org/)

1\. 新建合约文件并编写合约代码
-----------------

![](https://storage.googleapis.com/papyrus_images/4f1ffa51f53796c21045b89820a77e638333d421922f0a4f4ed4affe3dc062ef.png)

![](https://storage.googleapis.com/papyrus_images/76433900ea7a96fb9f2e993c05cbd7abafc8bb4946937eff98c13c8662234867.png)

2.选择编译版本
--------

注意编译版本需要和程序要求一致，这里要求是>=0.8.10 & < 0.9.0

![](https://storage.googleapis.com/papyrus_images/78dfd971acec11c1092cf5d87903744f4ab0dc5fe13194c09344afe8b8748fca.png)

3.部署合约
------

注意第一选项选择Injected Web3, 方便使用小狐狸等扩展钱包链接部署，需要钱包确认

![](https://storage.googleapis.com/papyrus_images/c1b6ddab46acf1b2f84c66bd10cd534acda2700f9931f24f897853f4db9799e2.png)

等待几十秒（取决于你选择的哪个网络，本次时使用binance smart chain test）,其他支持EVM的都一样

![](https://storage.googleapis.com/papyrus_images/dcd4872236634388688ed2d2e5bf19392418f81467424a6641623bad86ac6ebc.png)

![](https://storage.googleapis.com/papyrus_images/5092c42ec1902306bf5d6e173fef8e55b5e932e3436ebc0d6134677f8106c609.png)

非常简单是不是，solidity的坑其实是灰常的多，当然是相对其他成熟的计算机语言而言。目前还处于发展早期很多设计可能也不是特别”合理“，但是依然不妨碍我们学习它，因为大家都想做”科学家“。。。。

---

*Originally published on [bvicii](https://paragraph.com/@startboy/remix)*
