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

fix: replace StarkNet by Starknet [skip ci] [skip-testnet] #320

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<p align="center" style="margin-bottom: 0px !important">
<img width="100" src="https://user-images.githubusercontent.com/2848732/181497954-297848fb-4e9d-4bf0-91bd-c1c5da8ae10d.svg" alt="Hardhat Plugin" align="center">
</p>
<h1 align="center" style="margin-top: 0px !important">StarkNet Hardhat Plugin</h1>
<h1 align="center" style="margin-top: 0px !important">Starknet Hardhat Plugin</h1>

[![npm package](https://img.shields.io/npm/v/@shardlabs/starknet-hardhat-plugin?color=blue)](https://www.npmjs.com/package/@shardlabs/starknet-hardhat-plugin)

If you've used Hardhat 👷‍♀️👷‍♂️ and want to develop for StarkNet <img src="https://starkware.co/wp-content/uploads/2021/07/Group-177.svg" alt="starknet" width="18"/>, this plugin might come in hand. If you've never set up a Hardhat project, check out [this guide](https://hardhat.org/tutorial/creating-a-new-hardhat-project.html).
If you've used Hardhat 👷‍♀️👷‍♂️ and want to develop for Starknet <img src="https://starkware.co/wp-content/uploads/2021/07/Group-177.svg" alt="starknet" width="18"/>, this plugin might come in hand. If you've never set up a Hardhat project, check out [this guide](https://hardhat.org/tutorial/creating-a-new-hardhat-project.html).

## 🌐 Docs

Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export enum StarknetChainId {
TESTNET2 = "0x534e5f474f45524c4932"
}

export const PREFIX_TRANSACTION = "StarkNet Transaction";
export const PREFIX_TRANSACTION = "Starknet Transaction";

export const TRANSACTION_VERSION = BigInt(1);
export const QUERY_VERSION = BigInt(2) ** BigInt(128) + TRANSACTION_VERSION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const contractPath = path.join("contracts", contractName);
copyFileSync(path.join(__dirname, contractName), contractPath);

const expected = `Hint is not whitelisted.
This may indicate that this library function cannot be used in StarkNet contracts.`;
This may indicate that this library function cannot be used in Starknet contracts.`;

console.log("Testing rejection of compilation without the --disable-hint-validation flag");
const execution = hardhatStarknetCompile([contractPath], true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Declare this file as a StarkNet contract.
// Declare this file as a Starknet contract.
%lang starknet

from starkware.cairo.common.cairo_builtins import HashBuiltin
Expand Down
2 changes: 1 addition & 1 deletion test/general-tests/cairo-migrate/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { assertContains } from "../../utils/utils";

const contractName = "old_contract.cairo";
const contractPath = path.join("contracts", contractName);
const newComment = "// Declare this file as a StarkNet contract.";
const newComment = "// Declare this file as a Starknet contract.";

copyFileSync(path.join(__dirname, contractName), contractPath);

Expand Down
2 changes: 1 addition & 1 deletion test/general-tests/cairo-migrate/old_contract.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Declare this file as a StarkNet contract.
# Declare this file as a Starknet contract.
%lang starknet

from starkware.cairo.common.cairo_builtins import HashBuiltin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Declare this file as a StarkNet contract.
// Declare this file as a Starknet contract.
%lang starknet

from starkware.cairo.common.cairo_builtins import HashBuiltin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Declare this file as a StarkNet contract.
// Declare this file as a Starknet contract.
%lang starknet

from starkware.cairo.common.cairo_builtins import HashBuiltin
Expand Down
18 changes: 9 additions & 9 deletions www/docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# StarkNet Hardhat Plugin
# Starknet Hardhat Plugin

[![npm package](https://img.shields.io/npm/v/@shardlabs/starknet-hardhat-plugin?color=blue)](https://www.npmjs.com/package/@shardlabs/starknet-hardhat-plugin)

If you've used Hardhat 👷‍♀️👷‍♂️ and want to develop for StarkNet <img src="https://starkware.co/wp-content/uploads/2021/07/Group-177.svg" alt="starknet" width="18"/>, this plugin might come in hand. If you've never set up a Hardhat project, check out [this guide](https://hardhat.org/tutorial/creating-a-new-hardhat-project.html).
If you've used Hardhat 👷‍♀️👷‍♂️ and want to develop for Starknet <img src="https://starkware.co/wp-content/uploads/2021/07/Group-177.svg" alt="starknet" width="18"/>, this plugin might come in hand. If you've never set up a Hardhat project, check out [this guide](https://hardhat.org/tutorial/creating-a-new-hardhat-project.html).

## Contents

Expand Down Expand Up @@ -62,7 +62,7 @@ This plugin defines the following Hardhat commands (also called tasks):
$ npx hardhat starknet-compile [PATH...] [--cairo-path "<LIB_PATH1>:<LIB_PATH2>:..."] [--account-contract] [--disable-hint-validation]
```

If no paths are provided, all StarkNet contracts in the default contracts directory are compiled. Paths can be files and directories.
If no paths are provided, all Starknet contracts in the default contracts directory are compiled. Paths can be files and directories.

`--cairo-path` allows specifying the locations of imported files, if necessary. Separate them with a colon (:), e.g. `--cairo-path='path/to/lib1:path/to/lib2'`

Expand Down Expand Up @@ -94,15 +94,15 @@ For `<LICENSE_SCHEME>` the command takes [_No License (None)_](https://github.co
$ npx hardhat starknet-new-account [--starknet-network <NAME>] [--wallet <WALLET_NAME>]
```

Initializes a wallet `wallets["WALLET_NAME"]` configured in the `hardhat.config` file, which should then be followed by the command `starknet-deploy-account`. Uses the modified OZ implementation used by StarkNet CLI.
Initializes a wallet `wallets["WALLET_NAME"]` configured in the `hardhat.config` file, which should then be followed by the command `starknet-deploy-account`. Uses the modified OZ implementation used by Starknet CLI.

### `starknet-deploy-account`

```
$ npx hardhat starknet-deploy-account [--starknet-network <NAME>] [--wallet <WALLET_NAME>]
```

Deploys the wallet `wallets["WALLET_NAME"]` configured in the `hardhat.config` file. Uses the modified OZ implementation used by StarkNet CLI. _Needs to be funded before deploying it._
Deploys the wallet `wallets["WALLET_NAME"]` configured in the `hardhat.config` file. Uses the modified OZ implementation used by Starknet CLI. _Needs to be funded before deploying it._

```
$ npx hardhat starknet-deploy-account --starknet-network myNetwork --wallet MyWallet
Expand Down Expand Up @@ -163,14 +163,14 @@ To see all the utilities introduced by the `starknet` object, check [this](https

Relying on the above described API makes it easier to interact with your contracts and test them.

To test StarkNet contracts with Mocha, use the regular Hardhat `test` task which expects test files in your designated test directory:
To test Starknet contracts with Mocha, use the regular Hardhat `test` task which expects test files in your designated test directory:

```
$ npx hardhat test
```

Read more about the network used in tests in the [Runtime network](#runtime-network) section.
These examples are inspired by the official [StarkNet Python tutorial](https://www.cairo-lang.org/docs/hello_starknet/unit_tests.html).
These examples are inspired by the official [Starknet Python tutorial](https://www.cairo-lang.org/docs/hello_starknet/unit_tests.html).

### Important notes

Expand Down Expand Up @@ -424,7 +424,7 @@ await starknet.devnet.mint(account_address, 2e12, lite_mode);

## Debugging contracts

To debug StarkNet contracts, you can use `print()` in cairo hints in your contract, and the printed lines will appear in Devnet's log.
To debug Starknet contracts, you can use `print()` in cairo hints in your contract, and the printed lines will appear in Devnet's log.

Compile with `--disable-hint-validation` flag to allow hints.

Expand Down Expand Up @@ -761,7 +761,7 @@ If you're facing issues loading the account you've just funded, check out [this

### Get balance

To find out the balance of your account on the current StarkNet network, you can use `starknet.getBalance`:
To find out the balance of your account on the current Starknet network, you can use `starknet.getBalance`:

```typescript
import { starknet } from "hardhat";
Expand Down
8 changes: 4 additions & 4 deletions www/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "StarkNet Hardhat Plugin",
tagline: "A plugin for integrating StarkNet tools into Hardhat projects",
title: "Starknet Hardhat Plugin",
tagline: "A plugin for integrating Starknet tools into Hardhat projects",
url: "https://Shard-Labs.github.io",
// baseUrl: "/",
baseUrl: "/starknet-hardhat-plugin/",
Expand Down Expand Up @@ -56,9 +56,9 @@ const config = {
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: "StarkNet Hardhat Plugin",
title: "Starknet Hardhat Plugin",
logo: {
alt: "StarkNet Hardhat Plugin Logo",
alt: "Starknet Hardhat Plugin Logo",
src: "img/logo.svg"
},
items: [
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function Home() {
<main>
<div className="container margin-top--xl text--center">
<h1 className="thin">
<strike>Ethereum</strike> StarkNet Development environment for professionals
<strike>Ethereum</strike> Starknet Development environment for professionals
</h1>
</div>
<HomepageFeatures />
Expand Down