reapz
May 10, 2021, 1:45am
1
I’ve implemented the tutorial on UUPS proxies (link ) but my code won’t compile due to the following error:
DocstringParsingError: Documentation tag @custom:oz-upgrades-unsafe-allow not valid for contracts.
--> @openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:10:1:
|
10 | /**
| ^ (Relevant source part starts here and spans across multiple lines).
Error HH600: Compilation failed
My package.json dependencies:
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@openzeppelin/contracts-upgradeable": "^4.1.0",
"@openzeppelin/hardhat-upgrades": "^1.7.0",
"ethers": "^5.1.4",
"hardhat": "^2.2.1"
Any help would be appreciated.
1 Like
Skyge
May 10, 2021, 2:32am
2
Hi, welcome!
Could you please share the full code?
reapz
May 10, 2021, 8:09am
3
Thankyou, long time lurker
Yep, its just the code from the tutorial
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
contract MyTokenV1 is Initializable, ERC20Upgradeable, UUPSUpgradeable, OwnableUpgradeable {
function initialize() initializer public {
__ERC20_init("MyToken", "MTK");
_mint(msg.sender, 1000 * 10 ** decimals());
}
function _authorizeUpgrade(address) internal override onlyOwner {}
}
Test
const MyTokenV1 = await ethers.getContractFactory('MyTokenV1');
await upgrades.deployProxy(MyTokenV1, { kind: 'uups' });
Hi @reapz , sorry you ran into this problem! I assume you’re on Windows.
Please use Solidity 0.8.3 or newer.
There is a problem with the 0.8.2 build of Solidity for Windows.
opened 10:22PM - 07 May 21 UTC
bug :bug:
solc-bin
I reported this in the chat but I want to leave it here because there may be som… ething wrong in the build pipeline or release process that should probably be looked into.
The Windows build for 0.8.2 doesn't seem to support `@custom` NatSpec tags. Later builds (0.8.3, 0.8.4) do not have this problem.
![](https://user-images.githubusercontent.com/481465/117513931-214c2f80-af69-11eb-91d3-7bf4fc73c213.png)
Reproduction: https://github.com/frangio/solidity-0.8.2-windows
1 Like
reapz
May 10, 2021, 1:31pm
5
Cool that fixed it, thanks
I am on Windows. Hopefully this helps other people if anyone gets this error message, no solutions were coming up when I was searching.
2 Likes
Yes, thank you for asking! I’ve also updated the tutorial to recommend using 0.8.3.
2 Likes
Thank you. It solved the error