Skip to content

Commit

Permalink
Add support for Sepolia in local development
Browse files Browse the repository at this point in the history
Adds support for Sepolia in local development.

The support for preview and deployed testnet version will be addressed in a
separate PR.

This wa done based on the pull request from T dashbaord repo, where we did the
same: threshold-network/token-dashboard#605 (commit:
`ae3a4342e79bd822a8db6504c351dd2259d01cfe`).
  • Loading branch information
michalsmiarowski committed Feb 23, 2024
1 parent 491e47a commit 1db7209
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 188 deletions.
2 changes: 1 addition & 1 deletion src/components/Header/UserPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { InlineTokenBalance } from "../TokenBalance"

const networkIconMap = new Map<ChainID, As<unknown>>([
[ChainID.Ethereum, EthereumDark],
[ChainID.Goerli, TestnetIcon],
[ChainID.Sepolia, TestnetIcon],
])

interface UserPanelProps extends StackProps {
Expand Down
2 changes: 1 addition & 1 deletion src/enums/web3.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum ChainID {
Ethereum = 1,
Goerli = 5,
Sepolia = 11155111,
Localhost = 1337,
}

Expand Down
1 change: 1 addition & 0 deletions src/threshold-ts/multicall/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const MULTICALL_ABI = [
export const MULTICALL_ADDRESSESS = {
1: "0xeefba1e63905ef1d7acba5a8513c70307c1ce441",
5: "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",
11155111: "0xcA11bde05977b3631167028862bE2a173976CA11",
1337: process.env.REACT_APP_MULTICALL_ADDRESS || AddressZero,
} as Record<number | string, string>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"address": "0xB07051CE2A47b58C22bdfD1425BCEad27F6072Db",
"address": "0xF614eD3501A615a4d04f171F97f44F920DA35ff8",
"abi": [
{
"inputs": [],
Expand Down Expand Up @@ -2671,81 +2671,81 @@
"type": "function"
}
],
"transactionHash": "0x5b3f3ec979ce8956ab6e4e93f2523313a2729806e9d807e10683cd4136764969",
"transactionHash": "0x3123c3eda4f29fee34d966f2d6697a33f8c87981e3a876085472699c52970501",
"receipt": {
"to": null,
"from": "0xfd42E065d5b128a65d752F11A1dA089f74DBf49A",
"contractAddress": "0xB07051CE2A47b58C22bdfD1425BCEad27F6072Db",
"transactionIndex": 26,
"gasUsed": "972378",
"logsBloom": "0x00000000000008000000000000000000400004804000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000900000000040000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000000000000000000010000020000000000000000000040000000000000400000000000000000000000000000000000000000800000000000000000000000000000000000000000000",
"blockHash": "0xa64ec512de416edb475155db56b429ab4b29c34290962d22ff7af41b5f233771",
"transactionHash": "0x5b3f3ec979ce8956ab6e4e93f2523313a2729806e9d807e10683cd4136764969",
"from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc",
"contractAddress": "0xF614eD3501A615a4d04f171F97f44F920DA35ff8",
"transactionIndex": 2,
"gasUsed": "972354",
"logsBloom": "0x00000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000002000000000000000800000000000000000000000000000000000000000000000040000000800000000000000000000000000000000020000000000000000000000000000000008080000000000000800000000000000000000000000000000400000000000000000000800000000000000000000020000000000000000000040000000000000400000000000000002000000000000000000000000800000000000000000000000000000000000000000000",
"blockHash": "0x54f050939b79297375e5fdbf7fe52a0dc980bf3b4e4325f3ac11f22ad6502813",
"transactionHash": "0x3123c3eda4f29fee34d966f2d6697a33f8c87981e3a876085472699c52970501",
"logs": [
{
"transactionIndex": 26,
"blockNumber": 9460088,
"transactionHash": "0x5b3f3ec979ce8956ab6e4e93f2523313a2729806e9d807e10683cd4136764969",
"address": "0xB07051CE2A47b58C22bdfD1425BCEad27F6072Db",
"transactionIndex": 2,
"blockNumber": 4653113,
"transactionHash": "0x3123c3eda4f29fee34d966f2d6697a33f8c87981e3a876085472699c52970501",
"address": "0xF614eD3501A615a4d04f171F97f44F920DA35ff8",
"topics": [
"0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b",
"0x00000000000000000000000081e398346e85706261941d1f5fcd1169f33867eb"
"0x0000000000000000000000009a743075a833dc97cfaaa60585b0acf22dc94a26"
],
"data": "0x",
"logIndex": 57,
"blockHash": "0xa64ec512de416edb475155db56b429ab4b29c34290962d22ff7af41b5f233771"
"logIndex": 28,
"blockHash": "0x54f050939b79297375e5fdbf7fe52a0dc980bf3b4e4325f3ac11f22ad6502813"
},
{
"transactionIndex": 26,
"blockNumber": 9460088,
"transactionHash": "0x5b3f3ec979ce8956ab6e4e93f2523313a2729806e9d807e10683cd4136764969",
"address": "0xB07051CE2A47b58C22bdfD1425BCEad27F6072Db",
"transactionIndex": 2,
"blockNumber": 4653113,
"transactionHash": "0x3123c3eda4f29fee34d966f2d6697a33f8c87981e3a876085472699c52970501",
"address": "0xF614eD3501A615a4d04f171F97f44F920DA35ff8",
"topics": [
"0x5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fd42e065d5b128a65d752f11a1da089f74dbf49a",
"logIndex": 58,
"blockHash": "0xa64ec512de416edb475155db56b429ab4b29c34290962d22ff7af41b5f233771"
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc",
"logIndex": 29,
"blockHash": "0x54f050939b79297375e5fdbf7fe52a0dc980bf3b4e4325f3ac11f22ad6502813"
},
{
"transactionIndex": 26,
"blockNumber": 9460088,
"transactionHash": "0x5b3f3ec979ce8956ab6e4e93f2523313a2729806e9d807e10683cd4136764969",
"address": "0xB07051CE2A47b58C22bdfD1425BCEad27F6072Db",
"transactionIndex": 2,
"blockNumber": 4653113,
"transactionHash": "0x3123c3eda4f29fee34d966f2d6697a33f8c87981e3a876085472699c52970501",
"address": "0xF614eD3501A615a4d04f171F97f44F920DA35ff8",
"topics": [
"0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logIndex": 59,
"blockHash": "0xa64ec512de416edb475155db56b429ab4b29c34290962d22ff7af41b5f233771"
"logIndex": 30,
"blockHash": "0x54f050939b79297375e5fdbf7fe52a0dc980bf3b4e4325f3ac11f22ad6502813"
},
{
"transactionIndex": 26,
"blockNumber": 9460088,
"transactionHash": "0x5b3f3ec979ce8956ab6e4e93f2523313a2729806e9d807e10683cd4136764969",
"address": "0xB07051CE2A47b58C22bdfD1425BCEad27F6072Db",
"transactionIndex": 2,
"blockNumber": 4653113,
"transactionHash": "0x3123c3eda4f29fee34d966f2d6697a33f8c87981e3a876085472699c52970501",
"address": "0xF614eD3501A615a4d04f171F97f44F920DA35ff8",
"topics": [
"0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c01313673c43882ad39948b9b3de58de7dca3325",
"logIndex": 60,
"blockHash": "0xa64ec512de416edb475155db56b429ab4b29c34290962d22ff7af41b5f233771"
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000039f60b25c4598caf7e922d6fc063e9002db45845",
"logIndex": 31,
"blockHash": "0x54f050939b79297375e5fdbf7fe52a0dc980bf3b4e4325f3ac11f22ad6502813"
}
],
"blockNumber": 9460088,
"cumulativeGasUsed": "4696777",
"blockNumber": 4653113,
"cumulativeGasUsed": "2151793",
"status": 1,
"byzantium": true
},
"numDeployments": 1,
"libraries": {
"Deposit": "0xCEEdBc00386513A25B003f02f52eBF0028870f27",
"DepositSweep": "0x4e7eAd4AE091e7fcc32359E6a742766AF48FF68d",
"Redemption": "0x9B6487279BE41352a205278071a4723199B25B16",
"Wallets": "0x27Db1F214dd143189Cb01EDDE5Fbc3eBb6D583fD",
"Fraud": "0x655cA0652c4Bde6faF7798e55Fbc62F0FE4286ad",
"MovingFunds": "0xfd6f41b774aD1734C829c3396c68EeC724eaAFa5"
"Deposit": "0xFEd9395E6Ac28282af973649abAafb3148aB1AB1",
"DepositSweep": "0xFD361576d68645DAb34A7b9538d847069C75aa55",
"Redemption": "0x33C8eea7Bc7b160742A5b373B1e2e16d7481A51e",
"Wallets": "0x47177176bEEc4182f4B26FD91f02642f2370Ee41",
"Fraud": "0xc4f105B57fa904363C4ea9893915D78Cf2CD51b6",
"MovingFunds": "0x3B6824C8A29d6B46Dc4cfc4B82C9925b7516c232"
},
"implementation": "0x81E398346E85706261941D1F5fCd1169F33867eb",
"implementation": "0x9a743075a833dc97Cfaaa60585b0Acf22Dc94A26",
"devdoc": "Contract deployed as upgradable proxy"
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"address": "0x18930D71C7aE52beCB474A39173Def1A09b861a0",
"address": "0x9e1C45D3EFecEfabEFdAEa8EcA0397845bE47E86",
"abi": [
{
"inputs": [
Expand Down Expand Up @@ -1906,80 +1906,80 @@
"type": "function"
}
],
"transactionHash": "0xc364fcb7f9cb75f060e40bbcd5345f148fd47e547f2101a4ebf5ff869c9b75b0",
"transactionHash": "0xdb31edad1c978dbf7377cbabe5e2c4053b249fdda6febea0b75d5081abeaddfd",
"receipt": {
"to": null,
"from": "0xfd42E065d5b128a65d752F11A1dA089f74DBf49A",
"contractAddress": "0x18930D71C7aE52beCB474A39173Def1A09b861a0",
"transactionIndex": 25,
"gasUsed": "1053731",
"logsBloom": "0x00000000000000000000000000000000400000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000800000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000000000800000400000000000000000000000004000000000000000020000000000000000000040000000000000400000000000200000000000000020000000200000800000000000000000000000000000000000000000200",
"blockHash": "0x8a21d383cb665db389708e87036fa4f6cdac8f87d30b9db24d4466336d7d2672",
"transactionHash": "0xc364fcb7f9cb75f060e40bbcd5345f148fd47e547f2101a4ebf5ff869c9b75b0",
"from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc",
"contractAddress": "0x9e1C45D3EFecEfabEFdAEa8EcA0397845bE47E86",
"transactionIndex": 39,
"gasUsed": "1054015",
"logsBloom": "0x00000000000000000000000000000000400000004000000020000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000002000000000002000000000000000800000000000000000000000000000000000000000000001000000000800000000000000000002000000000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400040000000000000000000000000000000000000800000000000000000000000000000000000000000000",
"blockHash": "0xc7de7fe5e5a356ceac8586030fb5ede1c059cf2e9d59e74e564e05a4ca8a3419",
"transactionHash": "0xdb31edad1c978dbf7377cbabe5e2c4053b249fdda6febea0b75d5081abeaddfd",
"logs": [
{
"transactionIndex": 25,
"blockNumber": 8367831,
"transactionHash": "0xc364fcb7f9cb75f060e40bbcd5345f148fd47e547f2101a4ebf5ff869c9b75b0",
"address": "0x18930D71C7aE52beCB474A39173Def1A09b861a0",
"transactionIndex": 39,
"blockNumber": 4648393,
"transactionHash": "0xdb31edad1c978dbf7377cbabe5e2c4053b249fdda6febea0b75d5081abeaddfd",
"address": "0x9e1C45D3EFecEfabEFdAEa8EcA0397845bE47E86",
"topics": [
"0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b",
"0x000000000000000000000000fb52ee94382378c515e4ec7da399d6afaf86048f"
"0x0000000000000000000000003a2fa1927154749f70d065d120618aebe52c8566"
],
"data": "0x",
"logIndex": 33,
"blockHash": "0x8a21d383cb665db389708e87036fa4f6cdac8f87d30b9db24d4466336d7d2672"
"logIndex": 41,
"blockHash": "0xc7de7fe5e5a356ceac8586030fb5ede1c059cf2e9d59e74e564e05a4ca8a3419"
},
{
"transactionIndex": 25,
"blockNumber": 8367831,
"transactionHash": "0xc364fcb7f9cb75f060e40bbcd5345f148fd47e547f2101a4ebf5ff869c9b75b0",
"address": "0x18930D71C7aE52beCB474A39173Def1A09b861a0",
"transactionIndex": 39,
"blockNumber": 4648393,
"transactionHash": "0xdb31edad1c978dbf7377cbabe5e2c4053b249fdda6febea0b75d5081abeaddfd",
"address": "0x9e1C45D3EFecEfabEFdAEa8EcA0397845bE47E86",
"topics": [
"0x5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fd42e065d5b128a65d752f11a1da089f74dbf49a",
"logIndex": 34,
"blockHash": "0x8a21d383cb665db389708e87036fa4f6cdac8f87d30b9db24d4466336d7d2672"
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc",
"logIndex": 42,
"blockHash": "0xc7de7fe5e5a356ceac8586030fb5ede1c059cf2e9d59e74e564e05a4ca8a3419"
},
{
"transactionIndex": 25,
"blockNumber": 8367831,
"transactionHash": "0xc364fcb7f9cb75f060e40bbcd5345f148fd47e547f2101a4ebf5ff869c9b75b0",
"address": "0x18930D71C7aE52beCB474A39173Def1A09b861a0",
"transactionIndex": 39,
"blockNumber": 4648393,
"transactionHash": "0xdb31edad1c978dbf7377cbabe5e2c4053b249fdda6febea0b75d5081abeaddfd",
"address": "0x9e1C45D3EFecEfabEFdAEa8EcA0397845bE47E86",
"topics": [
"0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logIndex": 35,
"blockHash": "0x8a21d383cb665db389708e87036fa4f6cdac8f87d30b9db24d4466336d7d2672"
"logIndex": 43,
"blockHash": "0xc7de7fe5e5a356ceac8586030fb5ede1c059cf2e9d59e74e564e05a4ca8a3419"
},
{
"transactionIndex": 25,
"blockNumber": 8367831,
"transactionHash": "0xc364fcb7f9cb75f060e40bbcd5345f148fd47e547f2101a4ebf5ff869c9b75b0",
"address": "0x18930D71C7aE52beCB474A39173Def1A09b861a0",
"transactionIndex": 39,
"blockNumber": 4648393,
"transactionHash": "0xdb31edad1c978dbf7377cbabe5e2c4053b249fdda6febea0b75d5081abeaddfd",
"address": "0x9e1C45D3EFecEfabEFdAEa8EcA0397845bE47E86",
"topics": [
"0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000009ffffa73021c1d07081428ffc4387643006a343f",
"logIndex": 36,
"blockHash": "0x8a21d383cb665db389708e87036fa4f6cdac8f87d30b9db24d4466336d7d2672"
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dd8bf5aca0579bee7e6cd20ac7683e279a5f7d48",
"logIndex": 44,
"blockHash": "0xc7de7fe5e5a356ceac8586030fb5ede1c059cf2e9d59e74e564e05a4ca8a3419"
}
],
"blockNumber": 8367831,
"cumulativeGasUsed": "6659737",
"blockNumber": 4648393,
"cumulativeGasUsed": "5143872",
"status": 1,
"byzantium": true
},
"args": [
"0x376C72FD0C8a59483Fc7009F1104969d98fC9a35",
"0x3b82EFE7144B62c9dfE5bf774B284F9f0F018BE3"
"0x903aa036623923Db5FBbe4aA762600e1a6a453F8",
"0x8883236e97d9BD420B622484Dbe01f1cf0a6CE17"
],
"numDeployments": 1,
"libraries": {
"EcdsaInactivity": "0x744896217754b53fBF84464932a429AB847F16B9"
"EcdsaInactivity": "0xa97dc308607b7D912a01f8b93468187f46A7CdF5"
},
"implementation": "0xfB52Ee94382378C515E4EC7DA399d6aFAf86048F",
"implementation": "0x3a2fa1927154749F70d065d120618Aebe52c8566",
"devdoc": "Contract deployed as upgradable proxy"
}
6 changes: 3 additions & 3 deletions src/threshold-ts/tbtc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
fromSatoshiToTokenPrecision,
getContract,
getContractPastEvents,
getGoerliDevelopmentContracts,
getSepoliaDevelopmentContracts,
getSigner,
getArtifact,
isPayToScriptHashTypeAddress,
Expand Down Expand Up @@ -511,7 +511,7 @@ export class TBTC implements ITBTC {
const ethereumNetwork = await ethereumNetworkFromSigner(signer)

const tbtcContracts = shouldUseTestnetDevelopmentContracts
? getGoerliDevelopmentContracts(signer)
? getSepoliaDevelopmentContracts(signer)
: await loadEthereumContracts(signer, ethereumNetwork)

this._sdk = await SDK.initializeCustom(tbtcContracts, this._bitcoinClient)
Expand All @@ -525,7 +525,7 @@ export class TBTC implements ITBTC {
const initializeFunction =
this.bitcoinNetwork === BitcoinNetwork.Mainnet
? SDK.initializeMainnet
: SDK.initializeGoerli
: SDK.initializeSepolia

this._sdk = await initializeFunction(signer)

Expand Down
Loading

0 comments on commit 1db7209

Please sign in to comment.