这让我发疯。我正在学习这个方便的花花公子 Solidity 课程
https://www.youtube.com/watch?v=M576WGiDBdQ
我在时间戳 5:45:11,在那里我编写了一个脚本来与 FundMe 合约进行交互,它在 Rinkeby 上可以正常调用“getEntranceFee()”函数或我想调用的任何函数,但它不起作用在 ganache-local 上。我收到此错误:
File "brownie/_cli/run.py", line 49, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/fund_and_withdraw.py", line 17, in main
fund()
File "./scripts/fund_and_withdraw.py", line 9, in fund
entrance_fee = fund_me.getEntranceFee()
File "brownie/network/multicall.py", line 115, in _proxy_call
result = ContractCall.__call__(*args, **kwargs) # type: ignore
File "brownie/network/contract.py", line 1729, in __call__
return self.call(*args, block_identifier=block_identifier)
File "brownie/network/contract.py", line 1533, in call
raise VirtualMachineError(e) from None
VirtualMachineError: revert
我注意到一段时间以来我在测试网上部署和运行合约的脚本都遇到了问题。但是,当我运行一个脚本来部署本地 ganache 链上的合约并与之交互时,它可以很好地编译和部署,但与它的任何交互都不起作用。我将如何调试这个问题?我在这里完全不知所措。我在设置 ganache 链时做错了吗?我以为是即插即用。