Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Adds transfer token user fee (#7)
Browse files Browse the repository at this point in the history
* adds transfer token user fee

* updates fee calc

* starts with adding snowbridge conf

* updates fee

* correct ROC amount

* correct ROC amount

---------

Co-authored-by: claravanstaden <Cats 4 life!>
  • Loading branch information
claravanstaden authored Nov 2, 2023
1 parent 8c9dc76 commit 55305d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions cumulus/parachains/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod impls;
pub mod kusama;
pub mod polkadot;
pub mod rococo;
pub mod snowbridge_config;
pub mod westend;
pub mod wococo;
pub mod xcm_config;
Expand Down
6 changes: 6 additions & 0 deletions cumulus/parachains/common/src/snowbridge_config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
frame_support::parameter_types! {
/// User fee for ERC20 token transfer back to Ethereum.
/// (initially was calculated by test `OutboundQueue::calculate_fees` - ETH/ROC 1/400 and fee_per_gas 15 GWEI = 22698000000 + *25%)
/// Needs to be more than fee calculated from DefaultFeeConfig FeeConfigRecord in snowbridge:parachain/pallets/outbound-queue/src/lib.rs
pub const BridgeHubEthereumBaseFeeInRocs: u128 = 28372500000;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use parachains_common::{
impls::ToStakingPot,
snowbridge_config::BridgeHubEthereumBaseFeeInRocs,
xcm_config::{
AssetFeeAsExistentialDepositMultiplier, ConcreteAssetFromSystem,
RelayOrOtherSystemParachains,
Expand Down Expand Up @@ -910,8 +911,8 @@ pub mod bridging {
SiblingBridgeHub::get(),
Some((
XcmBridgeHubRouterFeeAssetId::get(),
bp_asset_hub_rococo::BridgeHubRococoBaseFeeInRocs::get(),
).into()) // TODO calculate fee factor
BridgeHubEthereumBaseFeeInRocs::get(),
).into())
),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ impl Contains<RuntimeCall> for SafeCallFilter {
snowbridge_ethereum_beacon_client::Call::force_checkpoint { .. } |
snowbridge_ethereum_beacon_client::Call::set_operating_mode { .. },
) | RuntimeCall::EthereumInboundQueue(
snowbridge_inbound_queue::Call::set_operating_mode { .. },
snowbridge_inbound_queue::Call::set_operating_mode { .. },
) | RuntimeCall::EthereumOutboundQueue(
snowbridge_outbound_queue::Call::set_operating_mode { .. },
snowbridge_outbound_queue::Call::set_operating_mode { .. },
) | RuntimeCall::EthereumControl(..)
)
}
Expand Down

0 comments on commit 55305d2

Please sign in to comment.