铸造厂

Deploying to Anvil

To deploy to Anvil, Foundry's test chain, it needs to be running on your computer. Then select the Foundry Provider in the Environments section of the Deploy & Run module.

一旦您选择 Foundry Provider,就会打开一个模态窗口,要求输入 Anvil JSON-RPC 端点

If Foundry Anvil node is running with default options, the default endpoint value in modal doesn't need to be changed. If the Anvil node host and port are different, then the JSON-RPC endpoint should be updated in the modal's text box.

一旦正确的端点填写在模态框中,只需单击“确定”,Anvil节点上的ACCOUNT将加载到ACCOUNT部分。网络ID也将显示出来。

现在,可以像往常一样从Remix IDE将合约部署到本地Anvil节点。

Foundry 重映射

Foundry使用git子模块管理依赖项,并且可以重新映射依赖项以使其更易于导入。因此,由重映射定义的导入可能会在Remix IDE上出现编译错误。

为了支持这种编译,Remix建议使用编译器配置文件运行编译。当在Remix IDE中使用remixd加载Foundry项目时,Remix会向编译器配置文件添加一些默认的Forge重映射。

此外,如果需要,还可以手动添加更多的重新映射。