diff --git a/README.md b/README.md index 0daf1079..a5873812 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,14 @@ FUEL TESTNET Pyth Oracle contract = 0x73591bf32f010ce4e83d86005c24e7833b397be38014ab670a73f6fde59ad607 -Token factory contract = 0xb2cb14cba2bb4bf4e565d8e0fbd6695df055b4ac25607962a827a72ae8622f5e +Token factory contract = 0x36d896016b570d6638029968e6cdf84b9249ad7e5b295848f7140b56b3303532 -Market contract = 0xc574a39aba9d9311df8f07b4d4805ab6b19f64d8364ef1498c73509220985f56 +Market contract = 0xea9d4a55ca16271f42992529bb68de095249ceb8d95176576098bb9b98cd3975 ETH = 0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07 -USDC = 0x23e8c3a2fc7a10cfa612da898d1cb3c0f0bb2a94de29ec4fa742bd2f690d9a67 -UNI = 0x7a31611c81e974db193570a6b918d083cbf223ddfef0cce18e02746b21ea8964 -BTC = 0x7d9d3e3df2900080f47b5e55c0501e153d21e67a2cdf86cb86ff5b717daab767 +USDC = 0xb5a7ec61506d83f6e4739be2dc57018898b1e08684c097c73b582c9583e191e2 +UNI = 0xf7c5f807c40573b5db88e467eb9aabc42332483493f7697442e1edbd59e020ad +BTC = 0x00dc5cda67b6a53b60fa53f95570fdaabb5b916c0e6d614a3f5d9de68f832e61 ``` --- diff --git a/apps/frontend/src/constants/index.ts b/apps/frontend/src/constants/index.ts index d0459482..87401fbe 100644 --- a/apps/frontend/src/constants/index.ts +++ b/apps/frontend/src/constants/index.ts @@ -37,10 +37,10 @@ export const EXPLORER_URL = 'https://app.fuel.network'; export const FAUCET_URL = 'https://faucet-testnet.fuel.network/'; export const CONTRACT_ADDRESSES: IContractsConfig = { priceOracle: - '0x1f6a416e814dd5adf97b994f1eb5b6d694f91bfafdc75686f1f7ed64b760332c', - market: '0x91240c4837da1d27b4fc4d3f498fd4b92b1e782ace1c6e22622a27ae635c3a76', + '0x73591bf32f010ce4e83d86005c24e7833b397be38014ab670a73f6fde59ad607', + market: '0xea9d4a55ca16271f42992529bb68de095249ceb8d95176576098bb9b98cd3975', tokenFactory: - '0x4069ff37aa31cc75849c78c6e92a92d01499c22e2ae922cfa9c311a845c7de63', + '0x36d896016b570d6638029968e6cdf84b9249ad7e5b295848f7140b56b3303532', }; export interface IToken { diff --git a/apps/frontend/src/constants/tokens.testnet.json b/apps/frontend/src/constants/tokens.testnet.json index 579200d4..99010ddf 100644 --- a/apps/frontend/src/constants/tokens.testnet.json +++ b/apps/frontend/src/constants/tokens.testnet.json @@ -3,7 +3,7 @@ "name": "USDC", "symbol": "USDC", "decimals": 6, - "assetId": "0x403489ee55a733cce6deb3e46e16a0ded38f902ff70224df97e15c243319b6f3" + "assetId": "0xb5a7ec61506d83f6e4739be2dc57018898b1e08684c097c73b582c9583e191e2" }, { "name": "Ethereum", @@ -15,6 +15,6 @@ "name": "Bitcoin", "symbol": "BTC", "decimals": 8, - "assetId": "0xb3a405892c0725ae9cfc117306752f623e3f357963b7489636b83d4842f96d62" + "assetId": "0x00dc5cda67b6a53b60fa53f95570fdaabb5b916c0e6d614a3f5d9de68f832e61" } ] diff --git a/apps/indexer/config.yaml b/apps/indexer/config.yaml index 04d3426e..1dbc9ae6 100644 --- a/apps/indexer/config.yaml +++ b/apps/indexer/config.yaml @@ -1,10 +1,10 @@ name: Fuel Greeter Indexer networks: - id: 0 - start_block: 7208668 + start_block: 7597567 contracts: - name: Market - address: 0xc574a39aba9d9311df8f07b4d4805ab6b19f64d8364ef1498c73509220985f56 + address: 0xea9d4a55ca16271f42992529bb68de095249ceb8d95176576098bb9b98cd3975 abi_file_path: ../../contracts/market/out/release/market-abi.json handler: ./src/EventHandlers.ts events: diff --git a/contracts/market/tests/scripts/deploy.rs b/contracts/market/tests/scripts/deploy.rs index dcd21d14..dad69ab6 100644 --- a/contracts/market/tests/scripts/deploy.rs +++ b/contracts/market/tests/scripts/deploy.rs @@ -68,6 +68,6 @@ async fn deploy() { market.add_collateral_asset(&config).await.unwrap(); } - println!("Market contract = {}", market.contract_id().hash()); + println!("Market contract = 0x{}", market.contract_id().hash()); println!("start_block: {block}",); } diff --git a/contracts/market/tests/scripts/deploy_tokens.rs b/contracts/market/tests/scripts/deploy_tokens.rs index 652d749b..917923b9 100644 --- a/contracts/market/tests/scripts/deploy_tokens.rs +++ b/contracts/market/tests/scripts/deploy_tokens.rs @@ -18,7 +18,7 @@ async fn deploy() { token_contract.deploy_tokens(&wallet).await; println!( - "The tokens have been deployed at {}", + "The tokens have been deployed at 0x{}", token_contract.contract_id().hash ); } diff --git a/contracts/market/tests/scripts/mint_tokens.rs b/contracts/market/tests/scripts/mint_tokens.rs index f3e45aa8..95ae9e33 100644 --- a/contracts/market/tests/scripts/mint_tokens.rs +++ b/contracts/market/tests/scripts/mint_tokens.rs @@ -34,7 +34,7 @@ async fn mint() { let asset = assets.get(asset).unwrap(); let asset = TokenAsset::new(wallet.clone(), token_contract_id, &asset.symbol); - println!("{}: {}", asset.symbol, asset.asset_id); + println!("{}: 0x{}", asset.symbol, asset.asset_id); asset.mint(wallet.address().into(), 100000).await.unwrap(); } } diff --git a/libs/token_sdk/src/token_utils.rs b/libs/token_sdk/src/token_utils.rs index ef63fd80..a59bc0c7 100644 --- a/libs/token_sdk/src/token_utils.rs +++ b/libs/token_sdk/src/token_utils.rs @@ -1,4 +1,5 @@ use market::*; +use rand::Rng; use token::*; use fuels::accounts::wallet::WalletUnlocked; @@ -50,7 +51,11 @@ impl TokenContract { let bin_path = root.join("contracts/token/out/release/token.bin"); let config = LoadConfiguration::default().with_configurables(configurables); + let mut rng = rand::thread_rng(); + let salt = rng.gen::<[u8; 32]>(); + let id = Contract::load_from(bin_path, config)? + .with_salt(salt) .deploy(wallet, TxPolicies::default()) .await?; let instance = Token::new(id.clone(), wallet.clone()); diff --git a/libs/token_sdk/tokens.testnet.json b/libs/token_sdk/tokens.testnet.json index 22a1a593..f2d611d0 100644 --- a/libs/token_sdk/tokens.testnet.json +++ b/libs/token_sdk/tokens.testnet.json @@ -1,6 +1,6 @@ [ { - "asset_id": "0x23e8c3a2fc7a10cfa612da898d1cb3c0f0bb2a94de29ec4fa742bd2f690d9a67", + "asset_id": "0xb5a7ec61506d83f6e4739be2dc57018898b1e08684c097c73b582c9583e191e2", "price_feed_id": "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a", "price_feed_decimals": 7, "name": "USD Coin", @@ -24,7 +24,7 @@ "supply_cap": 2000000000000000000000 }, { - "asset_id": "0x7d9d3e3df2900080f47b5e55c0501e153d21e67a2cdf86cb86ff5b717daab767", + "asset_id": "0x00dc5cda67b6a53b60fa53f95570fdaabb5b916c0e6d614a3f5d9de68f832e61", "price_feed_id": "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", "price_feed_decimals": 7, "name": "Bitcoin", @@ -38,7 +38,7 @@ "supply_cap": 1000000000000000000000 }, { - "asset_id": "0x7a31611c81e974db193570a6b918d083cbf223ddfef0cce18e02746b21ea8964", + "asset_id": "0xf7c5f807c40573b5db88e467eb9aabc42332483493f7697442e1edbd59e020ad", "price_feed_id": "0x78d185a741d07edb3412b09008b7c5cfb9bbbd7d568bf00ba737b456ba171501", "price_feed_decimals": 8, "name": "Uniswap",