Support user defined value types.
See original GitHub issueWhen using user defined value types (available since 0.8.8) the ast-dereferencer fails.
Compiling 111 files with 0.8.10
An unexpected error occurred:
Error: No node with id 25034 of type StructDefinition,EnumDefinition
at deref (projectRoot/node_modules/@openzeppelin/upgrades-core/src/ast-dereferencer.ts:38:11)
at projectRoot/node_modules/@openzeppelin/upgrades-core/src/utils/curry.ts:11:19
at extractStorageLayout (projectRoot/node_modules/@openzeppelin/upgrades-core/src/storage/extract.ts:59:29)
at validate (projectRoot/node_modules/@openzeppelin/upgrades-core/src/validate/run.ts:165:67)
at OverriddenTaskDefinition._action (projectRoot/node_modules/@openzeppelin/hardhat-upgrades/src/index.ts:62:25)
at Environment._runTaskDefinition (projectRoot/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (projectRoot/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (projectRoot/node_modules/hardhat/src/builtin-tasks/compile.ts:975:37)
at Environment._runTaskDefinition (projectRoot/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (projectRoot/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
error Command failed with exit code 1.
Apparently, using this contract replicated the issue.
Simple contract to reproduce the current error and test support:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
contract UserDefinedValueType {
type Timestamp is uint64;
}
Note: As mentioned in https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/438 we need to be careful with Solidity 0.8.8 because it has buggy storage layout rules, they were fixed in 0.8.9. We should probably reject 0.8.8.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
User-defined types - IBM
A user-defined data type (UDT) is a data type that derived from an existing data type. You can use UDTs to extend the...
Read more >User defined Data Types in C++ - GeeksforGeeks
User -Defined DataTypes: ... The data types that are defined by the user are called the derived datatype or user-defined derived data type....
Read more >13 User-Defined Datatypes
Object types and other user-defined datatypes allow you to define datatypes that model the structure and behavior of the data in their applications....
Read more >User Defined Data Types in C++ - eduCBA
Types of User-Defined Data in C++ · 1. Structure · 2. Array · 3. Union · 4. Class · 5. Enumeration · 6....
Read more >User Defined Value Types in Solidity
A user defined value type is defined using type C is V; , where C is the name of the newly introduced type...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi guys, any idea when will this be fixed?
@KholdStare This was published in the latest releases.