Solidity

聲明錯誤標識符未找到或不唯一 onlyOwner

  • April 4, 2022

我在 onlyOwner 關鍵字處收到此錯誤 function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips) public onlyOwner { royaltyAddress = _receiver; royaltyFeesInBips = _royaltyFeesInBips; }

您是否導入 Ownable.sol 並從 Ownable.sol 合約繼承?

contract myContract is Ownable{
}

引用自:https://ethereum.stackexchange.com/questions/125365