--- /dev/null +++ b/doc/sponsoring-flow.svg @@ -0,0 +1,3 @@ + + +
EVM calls
EVM calls
Extrinsics
Extrinsics
User
User
Substrate
Substrate
Ethereum
Ethereum
pallet_evm::
TransactionValidityHack
pallet_evm::...

pallet_charge_evm_transaction::
Config::SponsorshipHandler

pallet_charge_evm_tr...
pallet_charge_evm_transaction::
BridgeSponsorshipHandler
pallet_charge_evm_transaction::...
pallet_sponsoring::
ChargeTransactionPayment
pallet_sponsoring::...
tx.others
tx.others
tx.evm.call
tx.evm.call
pallet_sponsoring::
Config::SponsorshipHandler
pallet_sponsoring::...
SponsorshipHandler<H160, (H160, Vec<u8>), CallContext>
SponsorshipHandler<H160, (H160, Vec<u8>), CallContext>
SponsorshipHandler<AccountId, Call, ()>
SponsorshipHandler<AccountId, Call, ()>
Viewer does not support full SVG 1.1
\ No newline at end of file --- /dev/null +++ b/doc/sponsoring.md @@ -0,0 +1,16 @@ +# Sponsoring + + +![Sponsoring flow](./sponsoring-flow.svg) + +## Implementation + +If you need to add sponsoring for pallet call, you should implement `SponsorshipHandler` + +If you need to add sponsoring for EVM contract call, you should implement `SponsorshipHandler), CallContext>` + +For both examples, you can take a look at `UniqueSponsorshipHandler` struct inside of common runtime + +## EVM bridging + +In case if Ethereum call is being called using substrate `evm.call` extrinsic, `BridgeSponsorshipHandler` is used to convert between two different `SponsorshipHandler` types