简体   繁体   English

使用 Remix 与 ABI 部署的合约交互

[英]Interact with deployed contract with ABI using Remix

How can I interact with an already deployed contract on ether(not mine) using Remix without the source code, but I have the ABI.我如何在没有源代码的情况下使用 Remix 与以太坊(不是我的)上已经部署的合约进行交互,但我有 ABI。

The reason I want to do it is because some contract has more than 20.sol files which I dont want to manually copy and paste into Remix.我想这样做的原因是因为一些合同有超过 20.sol 文件,我不想手动复制并粘贴到 Remix 中。

If you have the address of where the contract is deployed, in the "deploy and run" section of the remix, click on AtAdress under the Deploy button and enter your address.如果你有部署合约的地址,在 remix 的“部署和运行”部分,单击 Deploy 按钮下的 AtAdress,然后输入你的地址。 It will show you the deployed contracts.它将向您显示已部署的合同。

Create a file with the name of the contract with .abi extension and paste the abi code inside of it.创建一个带有 .abi 扩展名的合约名称的文件,并将 abi 代码粘贴到其中。 Then go to" deploy and run transaction" tap and paste the contract address in the "At Address" file and press the button to get access to the functions that the contract exposes.然后转到“部署并运行交易”,点击并将合约地址粘贴到“地址”文件中,然后按下按钮以访问合约公开的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM