0
use erc20::Erc20Ref;
use ink_storage::traits::SpreadAllocate;

#[ink(storage)]
#[derive(SpreadAllocate)]
pub struct Bridge {
    map: ink_storage::Mapping<AccountId, u32>,
    token: Erc20Ref,
}

impl Bridge {
    #[ink(constructor)]
    pub fn new(token: Erc20Ref) -> Self {
        ink_lang::utils::initialize_contract(|contract: &mut Self| {
            contract.token = token;
        })
    }
}

the problem is: the trait ink_storage::traits::SpreadAllocate is not implemented for erc20::Erc20Ref

Are there ways to make it properly without manual implementation of SpreadAllocate trait?

1 Answer 1

1

Duplicate of that question.

The answer is no. The workaround is to implement it manually=)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.