Skip to content

Commit

Permalink
Merge branch 'tiago/cap-wnam' (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
sug0 committed Aug 30, 2023
2 parents 4c64aab + 161cf43 commit 2c6b817
Show file tree
Hide file tree
Showing 7 changed files with 642 additions and 228 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1781-cap-wnam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Control the flow of NAM over the Ethereum bridge
([\#1781](https://github.com/anoma/namada/pull/1781))
11 changes: 10 additions & 1 deletion ethereum_bridge/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use namada_core::ledger::storage_api::{StorageRead, StorageWrite};
use namada_core::types::ethereum_events::EthAddress;
use namada_core::types::ethereum_structs;
use namada_core::types::storage::Key;
use namada_core::types::token::DenominatedAmount;
use namada_core::types::token::{DenominatedAmount, NATIVE_MAX_DECIMAL_PLACES};
use serde::{Deserialize, Serialize};

use crate::storage::eth_bridge_queries::{
Expand Down Expand Up @@ -218,6 +218,15 @@ impl EthereumBridgeConfig {
token_cap: DenominatedAmount { amount: cap, denom },
} in erc20_whitelist
{
if addr == native_erc20
&& denom != &NATIVE_MAX_DECIMAL_PLACES.into()
{
panic!(
"Error writing Ethereum bridge config: The native token \
should have {NATIVE_MAX_DECIMAL_PLACES} decimal places"
);
}

let key = whitelist::Key {
asset: *addr,
suffix: whitelist::KeyType::Whitelisted,
Expand Down
Loading

0 comments on commit 2c6b817

Please sign in to comment.