1

Say you're importing a library, and that library contains a struct:

pragma solidity >=0.8.0;

library SomeLibrary {
    struct FooType {
        uint256 value;
    }
}

contract SomeContract {
    ...
}

I know that I can use that type as SomeLibrary.FooType. But that is verbose - it quickly ends up taking a lot of space in my implementation.

Is there any way I could set a local alias for this external library type? Ideally I would like to do this:

FooType = SomeLibrary.FooType;
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.