pendulum-chain / pendulum-solidity-wrapper

A collection of Solidity wrapper contracts emulating common ERC interfaces to grant access to runtime features on Pendulum.
GNU General Public License v3.0
0 stars 0 forks source link

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

Open b-yap opened 10 months ago

b-yap commented 10 months ago

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 commented 10 months ago

@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 commented 5 months ago

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

ebma commented 5 months ago

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.