question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support user defined value types.

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
bbonannocommented, May 24, 2022

Hi guys, any idea when will this be fixed?

1reaction
frangiocommented, Sep 27, 2022

@KholdStare This was published in the latest releases.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found