[英]I am not able to understand how to use IVotes contract address in GovernorVotes contract
As IVotes is a interface and cannot be deployed.因为 IVotes 是一个接口,无法部署。
IVotes public immutable token;
constructor(IVotes tokenAddress) {
token = tokenAddress;
}
....
Error: *** Deployment Failed ***错误:*** 部署失败 ***
"IVotes" is an abstract contract or an interface and cannot be deployed. “IVotes”是抽象合约或接口,无法部署。
I want to use IVotes address passing in GovernorVotes constructor.我想使用在GovernorVotes 构造函数中传递的IVotes 地址。 I tried bunch of methods but none works
我尝试了一堆方法,但没有一个有效
The Solidity snippet, that you shared, expects a contract on the tokenAddress
to implement the IVotes
interface.您共享的 Solidity 代码段需要
tokenAddress
上的合约来实现IVotes
接口。
But it needs to be a "full" contract with all function bodies - not just the function declarations.但它必须是与所有 function 主体的“完整”合同 - 而不仅仅是 function 声明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.