use hex_literal::hex;
use node_unitchain_runtime::{
AccountId,
BabeConfig,
BalancesConfig,
GrandpaConfig,
RuntimeGenesisConfig,
Signature,
SudoConfig,
SystemConfig,
WASM_BINARY,
BABE_GENESIS_EPOCH_CONFIG,
SessionConfig,
StakingConfig,
SessionKeys,
constants::currency::_,
StakerStatus,
MaxNominations,
ImOnlineConfig,
};
use sc_service::ChainType;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{ crypto::UncheckedInto, sr25519, Pair, Public };
use sc_telemetry::TelemetryEndpoints;
use sp_runtime::{ traits::{ IdentifyAccount, Verify }, Perbill, BoundedVec };
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use node_primitives::_;
use node_unitchain_runtime::{ ProfileStringLimit, AssetId, Balance };
// The URL for the telemetry server.
const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig>;
/// Generate a crypto pair from seed.
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
.expect("static values are valid; qed")
.public()
}
type AccountPublic = <Signature as Verify>::Signer;
/// Generate an account ID from seed.
pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId
where AccountPublic: From<<TPublic::Pair as Pair>::Public>
{
AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
}
fn session_keys(babe: BabeId, grandpa: GrandpaId, im_online: ImOnlineId) -> SessionKeys {
SessionKeys { babe, grandpa, im_online }
}
/// Generate an Babe authority key.
pub fn authority_keys_from_seed(s: &str) -> (AccountId, AccountId, BabeId, GrandpaId, ImOnlineId) {
(
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", s)),
get_account_id_from_seed::<sr25519::Public>(s),
get_from_seed::<BabeId>(s),
get_from_seed::<GrandpaId>(s),
get_from_seed::<ImOnlineId>(s),
)
}
pub fn development_config() -> Result<ChainSpec, String> {
Ok(
ChainSpec::builder(
WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?,
None
)
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(
testnet_genesis(
WASM_BINARY.expect("no wasm binary available"),
// Initial authorities
vec![authority_keys_from_seed("Alice")],
vec![],
// Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
// Pre-funded accounts
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash")
],
true
)
)
.build()
)
}
// pub fn development_config() -> Result<ChainSpec, String> {
// let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
// Ok(ChainSpec::from_genesis(
// // Name
// "Development",
// // ID
// "dev",
// ChainType::Development,
// move || {
// testnet_genesis(
// wasm_binary,
// // Initial PoA authorities
// vec![authority_keys_from_seed("Alice")],
// vec![],
// // Sudo account
// get_account_id_from_seed::<sr25519::Public>("Alice"),
// // Pre-funded accounts
// vec![
// get_account_id_from_seed::<sr25519::Public>("Alice"),
// get_account_id_from_seed::<sr25519::Public>("Bob"),
// get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
// get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
// ],
// true,
// )
// },
// // Bootnodes
// vec![],
// // Telemetry
// None,
// // Protocol ID
// None,
// None,
// // Properties
// None,
// // Extensions
// None,
// empty_bytes,
// ))
// }
// pub fn local_testnet_config() -> Result<ChainSpec, String> {
// let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
// Ok(ChainSpec::from_genesis(
// // Name
// "Local Testnet",
// // ID
// "local_testnet",
// ChainType::Local,
// move || {
// testnet_genesis(
// wasm_binary,
// // Initial PoA authorities
// vec![authority_keys_from_seed("Alice"), authority_keys_from_seed("Bob")],
// vec![],
// // Sudo account
// get_account_id_from_seed::<sr25519::Public>("Alice"),
// // Pre-funded accounts
// vec![
// get_account_id_from_seed::<sr25519::Public>("Alice"),
// get_account_id_from_seed::<sr25519::Public>("Bob"),
// get_account_id_from_seed::<sr25519::Public>("Charlie"),
// get_account_id_from_seed::<sr25519::Public>("Dave"),
// get_account_id_from_seed::<sr25519::Public>("Eve"),
// get_account_id_from_seed::<sr25519::Public>("Ferdie"),
// get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
// get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
// get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
// get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
// get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
// get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
// ],
// true,
// )
// },
// // Bootnodes
// vec![],
// // Telemetry
// None,
// // Protocol ID
// None,
// // Properties
// None,
// None,
// // Extensions
// None,
// ))
// }
// pub fn staging_network_config() -> ChainSpec {
// let boot_nodes = vec![];
// ChainSpec::from_genesis(
// "Substrate Stencil",
// "stencil_network",
// ChainType::Live,
// staging_network_config_genesis,
// boot_nodes,
// Some(
// TelemetryEndpoints::new(vec![(STAGING_TELEMETRY_URL.to_string(), 0)])
// .expect("Staging telemetry url is valid; qed"),
// ),
// None,
// None,
// None,
// Default::default(),
// )
// }
// fn staging_network_config_genesis() -> RuntimeGenesisConfig {
// let wasm_binary = WASM_BINARY.expect(
// "Development wasm binary is not available. This means the client is built with \
// `SKIP_WASM_BUILD` flag and it is only usable for production chains. Please rebuild with \
// the flag disabled.",
// );
// // for i in 1 2 3 4; do for j in stash controller; do subkey inspect "$SECRET//$i//$j"; done; done
// // for i in 1 2 3 4; do for j in babe; do subkey --sr25519 inspect "$SECRET//$i//$j"; done; done
// // for i in 1 2 3 4; do for j in grandpa; do subkey --ed25519 inspect "$SECRET//$i//$j"; done; done
// // for i in 1 2 3 4; do for j in im_online; do subkey --sr25519 inspect "$SECRET//$i//$j"; done; done
// let initial_authorities: Vec<(AccountId, AccountId, BabeId, GrandpaId, ImOnlineId)> = vec![
// (
// // 5Grpw9i5vNyF6pbbvw7vA8pC5Vo8GMUbG8zraLMmAn32kTNH
// hex!["d41e0bf1d76de368bdb91896b0d02d758950969ea795b1e7154343ee210de649"].into(),
// // 5DLMZF33f61KvPDbJU5c2dPNQZ3jJyptsacpvsDhwNS1wUuU
// hex!["382bd29103cf3af5f7c032bbedccfb3144fe672ca2c606147974bc2984ca2b14"].into(),
// // 5Dhd2QbrSE4dyNn3YUg8j5TY3fG7ZAWZMoRRF9KUc7VPVGmC
// hex!["48640c12bc1b351cf4b051ac1cf7b5740765d02e34989d0a9dd935ce054ebb21"]
// .unchecked_into(),
// // 5C6rkxAZB437B5Bf1yS4B4qjW4HZPeBp8Kzx2Se9FLKhfyHY
// hex!["01a474a93a0cf830fb40b1d17fd1fc7c6b4a95fa11f90345558574a72da0d4b1"]
// .unchecked_into(),
// // 5DscuovXyY1o7DxYroYjYgipn87eqYLyQA3HJ21Utb7TqAai
// hex!["50041e469c63c994374a2829b0b0829213abd53be5113e751043318a9d7c0757"]
// .unchecked_into(),
// ),
// (
// // 5CFDk3yCSgQ2goiaksMfRMFRS7ZU28BZqPQDeAsgZUa6FRzt
// hex!["08050f1b6bcd4651004df427c884073652bafd54e5ca25cea69169532db2910b"].into(),
// // 5F1ks2enazaPktQa3HURLK8GywzNZaGirovPtFvvbv91TLhJ
// hex!["8275157f2a1d8373106cb00078a73a92a3303f3bf6eb72c3a67413bd943b020b"].into(),
// // 5CQ7gVQj96m8y79qPCqrM291rSNREfZ1Tf2fiLPSJReWTNy2
// hex!["0ecddcf7643a98de200b80fe7b18ebd38987fa106c5ed84fc004fa75ea4bac67"]
// .unchecked_into(),
// // 5FyNaMc6GaioN7K9QzPJDEtGThJ1HmcruRdgtiRxaoAwn2VD
// hex!["acdfcce0e40406fac1a8198c623ec42ea13fc627e0274bbb6c21e0811482ce13"]
// .unchecked_into(),
// // 5EUhcM9WPJGvhCz1UptA7ye8TgktGqbhaeSohCkAfW76q5bS
// hex!["6ac58683d639d3992a0090ab15f8c1dcf5a5ab7652fc9de60845441f9fc93903"]
// .unchecked_into(),
// ),
// (
// // 5F6YideXfGcskpdFUczu3nZcJFmU9WKHgjjNVQjqgeVGRs66
// hex!["861c6d95051f942bb022f13fc2125b2974933d8ab1441bfdee9855e9d8051556"].into(),
// // 5F92x4qKNYaHtfp5Yy7kb9r6gHCHkN3YSvNuedERPHgrURTn
// hex!["8801f479e09a78515f1badee0169864dae45648109091e29b03a7b4ea97ec018"].into(),
// // 5CLqVJSpfAdMYW1FHygEV8iEi8XFornEcCzrhw9WmFbbp8Qp
// hex!["0c4d9de1e313572750abe19140db56433d20e4668e09de4df81a36566a8f2528"]
// .unchecked_into(),
// // 5HEQh8yEv4QU7joBCKYdjJJ57qU1gDAm4Xv5QZKfFnSbXpeo
// hex!["e493d74f9fa7568cca9dd294c9619a54c2e1b6bd3ecf3677fa7f9076b98c3fcd"]
// .unchecked_into(),
// // 5GUEUCusMfW9c229gyuDG6XUH9pi3Cs4EZR9STtw8opfKuS6
// hex!["c2e2a133b23995a48ff46cc704ef61929ee4a29b5fa468e41019ac63f3694e1f"]
// .unchecked_into(),
// ),
// (
// // 5FxxpyvEnE2sVujvhr6x4A4G171uv4WKSLvrUNst9M8MfdpV
// hex!["ac8fdba5bbe008f65d0e85181daa5443c2eb492fea729a5981b2161467f8655c"].into(),
// // 5FxFAYsTNf31D5AGbXW9ETZPUZofpreHjJkdKehidcvDt5X4
// hex!["ac039bef73f76755d3747d711554f7fb0f16022da51483e0d600c9c7c8cbf821"].into(),
// // 5GdjiBeMEFqTE6mWod3UqPrtkQTscRGtAcmdSbR26vGiXpwB
// hex!["ca2245b6fa117fab9353a2031104d1d5d62e311957f375762324e65d71127465"]
// .unchecked_into(),
// // 5DMfkaaR4tzmarUsRMkrbnFNmVnYtYjTPFJsjvA4X15WAZZB
// hex!["392c51bf0c08f89cb1e091782d81359475d780986968ba7f6fa60f41feda6bf7"]
// .unchecked_into(),
// // 5HGzdyJakxDdnERv3nvNjd6Xmz5R39NEuuJ2B3miubDY6BHD
// hex!["e68c9a2ee25e1999a4e87906aea429f3e5f3fc8dc9cd89f423d82860c6937b2e"]
// .unchecked_into(),
// ),
// ];
// // generated with secret: subkey inspect "$secret"/fir
// let root_key: AccountId = hex![
// // 5FemZuvaJ7wVy4S49X7Y9mj7FyTR4caQD5mZo2rL7MXQoXMi
// "9eaf896d76b55e04616ff1e1dce7fc5e4a417967c17264728b3fd8fee3b12f3c"
// ]
// .into();
// let endowed_accounts: Vec<AccountId> = vec![root_key.clone()];
// testnet_genesis(
// wasm_binary,
// initial_authorities,
// vec![],
// root_key,
// endowed_accounts,
// true,
// )
// }
/// Configure initial storage state for FRAME modules.
fn testnet_genesis(
wasm_binary: &[u8],
initial_authorities: Vec<(AccountId, AccountId, BabeId, GrandpaId, ImOnlineId)>,
initial_nominators: Vec<AccountId>,
root_key: AccountId,
mut endowed_accounts: Vec<AccountId>,
\_enable_println: bool
) -> serde_json::Value {
// endow all authorities and nominators.
// initial_authorities
// .iter()
// .map(|x| &x.0)
// .chain(initial_nominators.iter())
// .for_each(|x| {
// if !endowed_accounts.contains(x) {
// endowed_accounts.push(x.clone())
// }
// });
// stakers: all validators and nominators.
const ENDOWMENT: Balance = 10_000_000 * DOLLARS;
const STASH: Balance = ENDOWMENT / 1000;
let mut rng = rand::thread_rng();
let stakers = initial_authorities
.iter()
.map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
.chain(
initial_nominators.iter().map(|x| {
use rand::{ seq::SliceRandom, Rng };
let limit = (MaxNominations::get() as usize).min(initial_authorities.len());
let count = rng.gen::<usize>() % limit;
let nominations = initial_authorities
.as_slice()
.choose_multiple(&mut rng, count)
.into_iter()
.map(|choice| choice.0.clone())
.collect::<Vec<_>>();
(x.clone(), x.clone(), STASH, StakerStatus::Nominator(nominations))
})
)
.collect::<Vec<_>>();
// 1 Billion of Unit tokens will be minted to the admin in the genesis
const INITIAL_BALANCE: u128 = 10_000_000_000_000_000_000;
serde_json::json!({
"system": {},
"balances": {
// Configure endowed accounts with initial balance of 1 << 60.
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
},
"babe": {
"epochConfig": Some(node_unitchain_runtime::BABE_GENESIS_EPOCH_CONFIG),
},
"grandpa": {
//"authorities": initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect::<Vec<_>>(),
"authorities": [],
},
"session": {
"keys": initial_authorities
.iter()
.map(|x| {
(
x.0.clone(),
x.0.clone(),
session_keys(x.2.clone(), x.3.clone(), x.4.clone()),
)
})
.collect::<Vec<_>>(),
},
"staking": {
"validatorCount": initial_authorities.len() as u32,
"minimumValidatorCount": initial_authorities.len() as u32,
"invulnerables": initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
"slashRewardFraction": Perbill::from_percent(10),
},
// "imOnline": { "keys": vec![] },
"sudo": { "key": Some(root_key)},
"membership": { "members": vec![get_account_id_from_seed::<sr25519::Public>("Bob")] },
// "transactionPayment": {},
"profile": { "profiles": get_initial_profile(endowed_accounts[1].clone()) },
"assets": {
"assets": get_initial_assets_config(endowed_accounts[1].clone()),
"metadata": get_initial_assets_metadata_config(),
"accounts": vec![
// id, account_id, balance
// Mint 1B of UNIT tokens to the admin
(0, endowed_accounts[1].clone(), INITIAL_BALANCE),
// Mint 500K of USDU tokens to the admin to initialize the Unit pool
(17, endowed_accounts[1].clone(), 5_000_000_000_000_000)
]
},
"oracle": { "oraclesKey": get_initial_oracle_config()},
"sales": { "stages": [
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
]}
})
}
// Profile Config
/// Generate an initial assets config.
pub fn get_initial_profile(
admin: AccountId
) -> Vec<(AccountId, BoundedVec<u8, ProfileStringLimit>)> {
vec![(admin, BoundedVec::try_from("unit".as_bytes().to_vec()).unwrap())]
}
/// Generate an initial assets config.
pub fn get_initial_assets_config(admin: AccountId) -> Vec<(AccountId, bool, Balance, u8)> {
vec![
(admin.clone(), true, 1, 1),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 2),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 0),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 3),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4),
(admin.clone(), true, 1, 4)
]
}
/// Generate an initial assets metadata config.
pub fn get_initial_assets_metadata_config() -> Vec<(u32, Vec<u8>, Vec<u8>, u8, u8)> {
vec![
(0u32, "UNIT".as_bytes().to_vec(), "UNIT".as_bytes().to_vec(), 1, 10),
(1u32, "Wrapped Bitcoin".as_bytes().to_vec(), "BTCU".as_bytes().to_vec(), 2, 10),
(2u32, "Wrapped Ethereum".as_bytes().to_vec(), "ETHU".as_bytes().to_vec(), 2, 10),
(3u32, "Wrapped Polkadot".as_bytes().to_vec(), "DOTU".as_bytes().to_vec(), 2, 10),
(4u32, "Wrapped Binance".as_bytes().to_vec(), "BNBU".as_bytes().to_vec(), 2, 10),
(5u32, "Wrapped Cardano".as_bytes().to_vec(), "ADAU".as_bytes().to_vec(), 2, 10),
(6u32, "Wrapped Polygon".as_bytes().to_vec(), "MATICU".as_bytes().to_vec(), 2, 10),
(7u32, "Wrapped Solana".as_bytes().to_vec(), "SOLU".as_bytes().to_vec(), 2, 10),
(8u32, "Wrapped Algorand".as_bytes().to_vec(), "ALGOU".as_bytes().to_vec(), 2, 10),
(9u32, "Wrapped Avalanche".as_bytes().to_vec(), "AVAXU".as_bytes().to_vec(), 2, 10),
(10u32, "Wrapped Near".as_bytes().to_vec(), "NEARU".as_bytes().to_vec(), 2, 10),
(11u32, "Wrapped Stella".as_bytes().to_vec(), "XLMU".as_bytes().to_vec(), 2, 10),
(12u32, "Wrapped Cosmos".as_bytes().to_vec(), "ATOMU".as_bytes().to_vec(), 2, 10),
(13u32, "Wrapped Open Network".as_bytes().to_vec(), "TONU".as_bytes().to_vec(), 2, 10),
(14u32, "Wrapped Cronos".as_bytes().to_vec(), "CROU".as_bytes().to_vec(), 2, 10),
(15u32, "Wrapped USDT".as_bytes().to_vec(), "USDTU".as_bytes().to_vec(), 2, 10),
(16u32, "Wrapped USDC".as_bytes().to_vec(), "USDCU".as_bytes().to_vec(), 2, 10),
(17u32, "USDU".as_bytes().to_vec(), "USDU".as_bytes().to_vec(), 0, 10),
(18u32, "EURU".as_bytes().to_vec(), "EURU".as_bytes().to_vec(), 0, 10),
(19u32, "JPYU".as_bytes().to_vec(), "JPYU".as_bytes().to_vec(), 0, 10),
(20u32, "GBPU".as_bytes().to_vec(), "GBPU".as_bytes().to_vec(), 0, 10),
(21u32, "AUDU".as_bytes().to_vec(), "AUDU".as_bytes().to_vec(), 0, 10),
(22u32, "CADU".as_bytes().to_vec(), "CADU".as_bytes().to_vec(), 0, 10),
(23u32, "CHFU".as_bytes().to_vec(), "CHFU".as_bytes().to_vec(), 0, 10),
(24u32, "BRLU".as_bytes().to_vec(), "BRLU".as_bytes().to_vec(), 0, 10),
(25u32, "CNYU".as_bytes().to_vec(), "CNYU".as_bytes().to_vec(), 0, 10),
(26u32, "HKDU".as_bytes().to_vec(), "HKDU".as_bytes().to_vec(), 0, 10),
(27u32, "IDRU".as_bytes().to_vec(), "IDRU".as_bytes().to_vec(), 0, 10),
(28u32, "INRU".as_bytes().to_vec(), "INRU".as_bytes().to_vec(), 0, 10),
(29u32, "KRWU".as_bytes().to_vec(), "KRWU".as_bytes().to_vec(), 0, 10),
(30u32, "MXNU".as_bytes().to_vec(), "MXNU".as_bytes().to_vec(), 0, 10),
(31u32, "NOKU".as_bytes().to_vec(), "NOKU".as_bytes().to_vec(), 0, 10),
(32u32, "NZDU".as_bytes().to_vec(), "NZDU".as_bytes().to_vec(), 0, 10),
(33u32, "PLNU".as_bytes().to_vec(), "PLNU".as_bytes().to_vec(), 0, 10),
(34u32, "RUBU".as_bytes().to_vec(), "RUBU".as_bytes().to_vec(), 0, 10),
(35u32, "SEKU".as_bytes().to_vec(), "SEKU".as_bytes().to_vec(), 0, 10),
(36u32, "SGDU".as_bytes().to_vec(), "SGDU".as_bytes().to_vec(), 0, 10),
(37u32, "TRYU".as_bytes().to_vec(), "TRYU".as_bytes().to_vec(), 0, 10),
(38u32, "ZARU".as_bytes().to_vec(), "ZARU".as_bytes().to_vec(), 0, 10),
(39u32, "PARIS".as_bytes().to_vec(), "PARIS".as_bytes().to_vec(), 3, 10),
(40u32, "LONDON".as_bytes().to_vec(), "LONDON".as_bytes().to_vec(), 3, 10),
(41u32, "CAIRO".as_bytes().to_vec(), "CAIRO".as_bytes().to_vec(), 3, 10),
(42u32, "ACCRA".as_bytes().to_vec(), "ACCRA".as_bytes().to_vec(), 3, 10),
(43u32, "MUMBAI".as_bytes().to_vec(), "MUMBAI".as_bytes().to_vec(), 3, 10),
(44u32, "ISTANBUL".as_bytes().to_vec(), "ISTANBUL".as_bytes().to_vec(), 3, 10),
(45u32, "NEYWORK".as_bytes().to_vec(), "NEWYORK".as_bytes().to_vec(), 3, 10),
(46u32, "MIAMI".as_bytes().to_vec(), "MIAMI".as_bytes().to_vec(), 3, 10),
(47u32, "RIO".as_bytes().to_vec(), "RIO".as_bytes().to_vec(), 3, 10),
(48u32, "BUENOSAIRES".as_bytes().to_vec(), "BUENOSAIRES".as_bytes().to_vec(), 3, 10),
(49u32, "HONGKONG".as_bytes().to_vec(), "HONGKONG".as_bytes().to_vec(), 3, 10),
(50u32, "SINGAPORE".as_bytes().to_vec(), "SINGAPORE".as_bytes().to_vec(), 3, 10),
(51u32, "BERLIN".as_bytes().to_vec(), "BERLIN".as_bytes().to_vec(), 3, 10),
(52u32, "LISBON".as_bytes().to_vec(), "LISBON".as_bytes().to_vec(), 3, 10),
(53u32, "CAPETOWN".as_bytes().to_vec(), "CAPETOWN".as_bytes().to_vec(), 3, 10),
(54u32, "NAIROBI".as_bytes().to_vec(), "NAIROBI".as_bytes().to_vec(), 3, 10),
(55u32, "DUBAI".as_bytes().to_vec(), "DUBAI".as_bytes().to_vec(), 3, 10),
(56u32, "RIYADH".as_bytes().to_vec(), "RIYADH".as_bytes().to_vec(), 3, 10),
(57u32, "SANFRANCISCO".as_bytes().to_vec(), "SANFRANCISCO".as_bytes().to_vec(), 3, 10),
(58u32, "LOSANGELES".as_bytes().to_vec(), "LOSANGELES".as_bytes().to_vec(), 3, 10),
(59u32, "MEXICOCITY".as_bytes().to_vec(), "MEXICOCITY".as_bytes().to_vec(), 3, 10),
(60u32, "PANAMA".as_bytes().to_vec(), "PANAMA".as_bytes().to_vec(), 3, 10),
(61u32, "SEOUL".as_bytes().to_vec(), "SEOUL".as_bytes().to_vec(), 3, 10),
(62u32, "TOKYO".as_bytes().to_vec(), "TOKYO".as_bytes().to_vec(), 3, 10),
(63u32, "HOTEL".as_bytes().to_vec(), "HOTEL".as_bytes().to_vec(), 4, 10),
(64u32, "FOUNDER".as_bytes().to_vec(), "FOUNDER".as_bytes().to_vec(), 4, 10),
(65u32, "ART".as_bytes().to_vec(), "ART".as_bytes().to_vec(), 4, 10),
(66u32, "MUSIC".as_bytes().to_vec(), "MUSIC".as_bytes().to_vec(), 4, 10),
(67u32, "MOVIE".as_bytes().to_vec(), "MOVIE".as_bytes().to_vec(), 4, 10),
(68u32, "BOAT".as_bytes().to_vec(), "BOAT".as_bytes().to_vec(), 4, 10),
(69u32, "FASHION".as_bytes().to_vec(), "FASHION".as_bytes().to_vec(), 4, 10),
(70u32, "CAR".as_bytes().to_vec(), "CAR".as_bytes().to_vec(), 4, 10),
(71u32, "COMMUNITY".as_bytes().to_vec(), "COMMUNITY".as_bytes().to_vec(), 4, 10),
(72u32, "BOOK".as_bytes().to_vec(), "BOOK".as_bytes().to_vec(), 4, 10),
(73u32, "SOCIAL".as_bytes().to_vec(), "SOCIAL".as_bytes().to_vec(), 4, 10),
(74u32, "GAME".as_bytes().to_vec(), "GAME".as_bytes().to_vec(), 4, 10),
(75u32, "SPORT".as_bytes().to_vec(), "SPORT".as_bytes().to_vec(), 4, 10),
(76u32, "VIRTUAL".as_bytes().to_vec(), "VIRTUAL".as_bytes().to_vec(), 4, 10),
(77u32, "YOUTH".as_bytes().to_vec(), "YOUTH".as_bytes().to_vec(), 4, 10),
(78u32, "SNEAKER".as_bytes().to_vec(), "SNEAKER".as_bytes().to_vec(), 4, 10),
(79u32, "HER".as_bytes().to_vec(), "HER".as_bytes().to_vec(), 4, 10),
(80u32, "MODEL".as_bytes().to_vec(), "MODEL".as_bytes().to_vec(), 4, 10),
(81u32, "CODE".as_bytes().to_vec(), "CODE".as_bytes().to_vec(), 4, 10),
(82u32, "HOME".as_bytes().to_vec(), "HOME".as_bytes().to_vec(), 4, 10),
(83u32, "BEAUTY".as_bytes().to_vec(), "BEAUTY".as_bytes().to_vec(), 4, 10),
(84u32, "UNIVERSITY".as_bytes().to_vec(), "UNIVERSITY".as_bytes().to_vec(), 4, 10),
(85u32, "BIKE".as_bytes().to_vec(), "BIKE".as_bytes().to_vec(), 4, 10),
(86u32, "ONLINE".as_bytes().to_vec(), "ONLINE".as_bytes().to_vec(), 4, 10),
(87u32, "PARTY".as_bytes().to_vec(), "PARTY".as_bytes().to_vec(), 4, 10),
(88u32, "IMPACT".as_bytes().to_vec(), "IMPACT".as_bytes().to_vec(), 4, 10),
(89u32, "FOOD".as_bytes().to_vec(), "FOOD".as_bytes().to_vec(), 4, 10),
(90u32, "EVENT".as_bytes().to_vec(), "EVENT".as_bytes().to_vec(), 4, 10),
(91u32, "FARM".as_bytes().to_vec(), "FARM".as_bytes().to_vec(), 4, 10),
(92u32, "COACH".as_bytes().to_vec(), "COACH".as_bytes().to_vec(), 4, 10),
(93u32, "YOGA".as_bytes().to_vec(), "YOGA".as_bytes().to_vec(), 4, 10)
]
}
// Oracle Config
/// Generate an initial assets config.
pub fn get*initial_oracle_config() -> Vec<(AssetId, u8, AssetId)> {
get_initial_assets_metadata_config()
.iter()
.map(|asset| (asset.0, asset.4, asset.0))
.collect::<Vec<*>>()
}