Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added content specific links for StarkScan block explorer #2476

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Changed

- `declare` and `verify` commands now use the Scarb `release` profile instead of the `dev` profile as the default for building artifacts
- StarkScan links now point to specific pages for transactions, contracts and classes.

#### Fixed

Expand Down
8 changes: 4 additions & 4 deletions crates/sncast/src/helpers/block_explorer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
use starknet::core::types::Felt;

const STARKSCAN: &str = "https://starkscan.co/search";
const STARKSCAN: &str = "https://starkscan.co";
const VOYAGER: &str = "https://voyager.online";
const VIEWBLOCK: &str = "https://viewblock.io/starknet";
const OKLINK: &str = "https://www.oklink.com/starknet";
Expand Down Expand Up @@ -40,15 +40,15 @@ pub struct StarkScan;

impl LinkProvider for StarkScan {
fn transaction(&self, hash: Felt) -> String {
format!("{STARKSCAN}/{hash:x}")
format!("{STARKSCAN}/tx/{hash:x}")
}

fn class(&self, hash: Felt) -> String {
format!("{STARKSCAN}/{hash:x}")
format!("{STARKSCAN}/class/{hash:x}")
}

fn contract(&self, address: Felt) -> String {
format!("{STARKSCAN}/{address:x}")
format!("{STARKSCAN}/contract/{address:x}")
}
}

Expand Down
20 changes: 10 additions & 10 deletions docs/src/starknet/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $ sncast \
account create \
--url http://127.0.0.1:5050 \
--name some-name

Account successfully created. Prefund generated address with at least 432300000000 tokens. It is good to send more in the case of higher demand, max_fee * 2 = 864600000000
command: account create
max_fee: 0x64a7168300
Expand All @@ -38,7 +38,7 @@ account: https://starkscan.co/search/0x7a949e83b2...
```

You can also pass common `--accounts-file` argument with a path to (existing or not existing) file where you want to save account info.

For a detailed CLI description, see [account create command reference](../appendix/sncast/account/create.md).


Expand All @@ -59,17 +59,17 @@ $ sncast \
--name some-name \
--fee-token strk \
--max-fee 9999999999999

command: account deploy
transaction_hash: 0x20b20896ce63371ef015d66b4dd89bf18c5510a840b4a85a43a983caa6e2579

To see invocation details, visit:
transaction: https://starkscan.co/search/0x20b20896ce...
transaction: https://starkscan.co/tx/0x20b20896ce...
```

Note that you don't have to pass `url`, `accounts-file` and `network` parameters if `add-profile` flag
was set in the `account create` command. Just pass `profile` argument with the account name.

For a detailed CLI description, see [account deploy command reference](../appendix/sncast/account/deploy.md).

> 💡 **Info**
Expand All @@ -84,7 +84,7 @@ $ sncast \
account create \
--name some-name \
--salt 0x1

Account successfully created. Prefund generated address with at least 432300000000 tokens. It is good to send more in the case of higher demand, max_fee * 2 = 864600000000
command: account create
max_fee: 0x64a7168300
Expand All @@ -104,7 +104,7 @@ $ sncast \
account delete \
--name some-name \
--network alpha-sepolia

Do you want to remove account some-name from network alpha-sepolia? (Y/n)
Y
command: account delete
Expand Down Expand Up @@ -177,7 +177,7 @@ command: account deploy
transaction_hash: 0x20b20896ce63371ef015d66b4dd89bf18c5510a840b4a85a43a983caa6e2579

To see invocaton details, visit:
transaction: https://starkscan.co/search/0x20b20896ce...
transaction: https://starkscan.co/tx/0x20b20896ce...
```

### Using Keystore and Starkli Account
Expand Down
8 changes: 4 additions & 4 deletions docs/src/starknet/invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ $ sncast \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function "some_function" \
--calldata 1 2 0x1e

command: invoke
transaction_hash: 0x7ad0d6e449e33b6581a4bb8df866c0fce3919a5ee05a30840ba521dafee217f

To see invocation details, visit:
transaction: https://starkscan.co/search/0x7ad0d6e449...
transaction: https://starkscan.co/tx/0x7ad0d6e449...
```

> 💡 **Info**
Expand All @@ -48,10 +48,10 @@ $ sncast invoke \
--fee-token strk \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function "function_without_params"

command: invoke
transaction_hash: 0x7ad0d6e449e33b6581a4bb8df866c0fce3919a5ee05a30840ba521dafee217f

To see invocation details, visit:
transaction: https://starkscan.co/search/0x7ad0d6e449...
transaction: https://starkscan.co/tx/0x7ad0d6e449...
```
2 changes: 1 addition & 1 deletion docs/src/starknet/multicall.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ command: multicall
transaction_hash: 0x38fb8a0432f71bf2dae746a1b4f159a75a862e253002b48599c9611fa271dcb

To see invocation details, visit:
transaction: https://starkscan.co/search/0x38fb8a0432...
transaction: https://starkscan.co/tx/0x38fb8a0432...
```

> 💡 **Info**
Expand Down
Loading