Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README --target argument is outdated, and lacking TokenAllowance instructions for testing ERC20Wrapper #37

Open
b-yap opened this issue Dec 19, 2023 · 3 comments
Labels
type:bug Something isn't working

Comments

@b-yap
Copy link

b-yap commented Dec 19, 2023

Context

The README lacks instructions that are required to make the wrapper contracts work on a runtime.

What's wrong

--target command argument is outdated

solang version >= 0.3.1 does not accept substrate argument anymore.

TODO: it should be --target polkadot


lacking TokenAllowance instructions for testing ERC20Wrapper

ContractTrapped error will occur when testing the functions using zombienet. It returns 6(or NoProvider) after calling chain_extension.

TODO

For testing

Depending on which runtime, the chain_spec should add in its GenesisConfig:

token_allowance: amplitude_runtime::TokenAllowanceConfig {
   allowed_currencies: vec![CurrencyId::Native]
}

^ this means the Native currency is the only one supported.
To be able to defineTokenAllowanceConfig in the GenesisConfig, add Config<T> of TokenAllowance inside the construct_runtime! of the parachain. e.g.

construct_runtime! {
    ...
    ...
    TokenAllowance: orml_currencies_allowance_extension::{Pallet, Config<T>, Storage, Call, Event<T>} = 80,
    ...
}

In production

Call the tokenAllowance::addSupportedCurrencies() extrinsic as a root user.

@TorstenStueber TorstenStueber added the type:bug Something isn't working label Dec 23, 2023
@TorstenStueber
Copy link
Member

@b-yap the first part is clear to me. For the second part (lacking TokenAllowance): isn't that a fix required in the runtime or client, i.e., in the pendulum repo instead of in the wrapper contract?

@prayagd
Copy link
Collaborator

prayagd commented Apr 25, 2024

@pendulum-chain/devs is this bug still relevant?

@ebma
Copy link
Member

ebma commented Apr 25, 2024

For the second part (lacking TokenAllowance): isn't that a fix required in the runtime or client, i.e., in the pendulum repo instead of in the wrapper contract?

Yes kind of, but it wouldn't hurt to leave a note somewhere that having the currency in the list of allowed_currencies of the TokenAllowance pallet is a requirement and you will encounter errors if you don't take care of this before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants