Skip to content

Commit

Permalink
chore: new testnet deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Aug 13, 2024
1 parent f0fb996 commit dd2b86d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

---
Expand Down
6 changes: 3 additions & 3 deletions apps/frontend/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/constants/tokens.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "USDC",
"symbol": "USDC",
"decimals": 6,
"assetId": "0x403489ee55a733cce6deb3e46e16a0ded38f902ff70224df97e15c243319b6f3"
"assetId": "0xb5a7ec61506d83f6e4739be2dc57018898b1e08684c097c73b582c9583e191e2"
},
{
"name": "Ethereum",
Expand All @@ -15,6 +15,6 @@
"name": "Bitcoin",
"symbol": "BTC",
"decimals": 8,
"assetId": "0xb3a405892c0725ae9cfc117306752f623e3f357963b7489636b83d4842f96d62"
"assetId": "0x00dc5cda67b6a53b60fa53f95570fdaabb5b916c0e6d614a3f5d9de68f832e61"
}
]
4 changes: 2 additions & 2 deletions apps/indexer/config.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion contracts/market/tests/scripts/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}",);
}
2 changes: 1 addition & 1 deletion contracts/market/tests/scripts/deploy_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
2 changes: 1 addition & 1 deletion contracts/market/tests/scripts/mint_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
5 changes: 5 additions & 0 deletions libs/token_sdk/src/token_utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use market::*;
use rand::Rng;
use token::*;

use fuels::accounts::wallet::WalletUnlocked;
Expand Down Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions libs/token_sdk/tokens.testnet.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"asset_id": "0x23e8c3a2fc7a10cfa612da898d1cb3c0f0bb2a94de29ec4fa742bd2f690d9a67",
"asset_id": "0xb5a7ec61506d83f6e4739be2dc57018898b1e08684c097c73b582c9583e191e2",
"price_feed_id": "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
"price_feed_decimals": 7,
"name": "USD Coin",
Expand All @@ -24,7 +24,7 @@
"supply_cap": 2000000000000000000000
},
{
"asset_id": "0x7d9d3e3df2900080f47b5e55c0501e153d21e67a2cdf86cb86ff5b717daab767",
"asset_id": "0x00dc5cda67b6a53b60fa53f95570fdaabb5b916c0e6d614a3f5d9de68f832e61",
"price_feed_id": "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
"price_feed_decimals": 7,
"name": "Bitcoin",
Expand All @@ -38,7 +38,7 @@
"supply_cap": 1000000000000000000000
},
{
"asset_id": "0x7a31611c81e974db193570a6b918d083cbf223ddfef0cce18e02746b21ea8964",
"asset_id": "0xf7c5f807c40573b5db88e467eb9aabc42332483493f7697442e1edbd59e020ad",
"price_feed_id": "0x78d185a741d07edb3412b09008b7c5cfb9bbbd7d568bf00ba737b456ba171501",
"price_feed_decimals": 8,
"name": "Uniswap",
Expand Down

0 comments on commit dd2b86d

Please sign in to comment.