OffchainLabs / stylus-sdk-rs

Rust Smart Contracts on Arbitrum
239 stars 79 forks source link

Unable to declare non #[entrypoint] struct with #[borrow] and generics #107

Open gwalen opened 8 months ago

gwalen commented 8 months ago

Stylus version: 0.4.2

This code does not compile:

sol_storage! {
    pub struct Erc20Burnable<T>  {
        #[borrow]
        Erc20<T> erc20;
    }
}

I think it should, it represents an abstract class in Solidity with generic types

Note: without generic T in struct declaration it works fine (eg.: when type is MyTokenParams struct that implements Erc20Params trait)