OffchainLabs / stylus-sdk-rs

Rust Smart Contracts on Arbitrum
249 stars 82 forks source link

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

Open gwalen opened 9 months ago

gwalen commented 9 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)