Skip to content
Closed
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
2 changes: 1 addition & 1 deletion content/contracts-cairo/2.x/erc721.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The difference between both functions consists of accepting `data` as an argumen
`safe_transfer_from` by default accepts the `data` argument which is interpreted as `Span<felt252>`.
If `data` is not used, simply pass an empty array.
* ERC721 utilizes [SRC5](./introspection#src5) to declare and query interface support on Starknet as opposed to Ethereum’s [EIP165](https://eips.ethereum.org/EIPS/eip-165).
The design for `SRC5` is similar to OpenZeppelin’s [ERC165Storage](https://docs.openzeppelin.com/contracts/4.xapi/utils#ERC165Storage).
The design for `SRC5` is similar to OpenZeppelin’s [ERC165Storage](https://docs.openzeppelin.com/contracts/4.x/api/utils#ERC165Storage).
* `IERC721Receiver` compliant contracts return a hardcoded interface ID according to Starknet selectors (as opposed to selector calculation in Solidity).

## Token transfers
Expand Down
2 changes: 1 addition & 1 deletion content/contracts-cairo/3.x/erc721.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The difference between both functions consists of accepting `data` as an argumen
`safe_transfer_from` by default accepts the `data` argument which is interpreted as `Span<felt252>`.
If `data` is not used, simply pass an empty array.
* ERC721 utilizes [SRC5](./introspection#src5) to declare and query interface support on Starknet as opposed to Ethereum’s [EIP165](https://eips.ethereum.org/EIPS/eip-165).
The design for `SRC5` is similar to OpenZeppelin’s [ERC165Storage](https://docs.openzeppelin.com/contracts/4.xapi/utils#ERC165Storage).
The design for `SRC5` is similar to OpenZeppelin’s [ERC165Storage](https://docs.openzeppelin.com/contracts/4.x/api/utils#ERC165Storage).
* `IERC721Receiver` compliant contracts return a hardcoded interface ID according to Starknet selectors (as opposed to selector calculation in Solidity).

## Token transfers
Expand Down
6 changes: 3 additions & 3 deletions content/contracts/5.x/learn/deploying-and-interacting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Remember that local blockchains ***do not*** persist their state throughout mult

With our `Box` contract [deployed](#deploying-a-smart-contract), we can start using it right away.

We will use the [Hardhat console](https://hardhat.org/guides/hardhat-console.html) to interact with our deployed `Box` contract on our localhost network.
We will use the [Hardhat console](https://hardhat.org/hardhat-runner/docs/guides/hardhat-console) to interact with our deployed `Box` contract on our localhost network.

<Callout>
We need to specify the address of our `Box` contract we displayed in our deploy script.
Expand Down Expand Up @@ -167,14 +167,14 @@ Our `Box` contract returns `uint256` which is too large a number for JavaScript
```

<Callout>
To learn more about using the console, check out the [Hardhat documentation](https://hardhat.org/guides/hardhat-console.html).
To learn more about using the console, check out the [Hardhat documentation](https://hardhat.org/hardhat-runner/docs/guides/hardhat-console).
</Callout>

## Interacting programmatically

The console is useful for prototyping and running one-off queries or transactions. However, eventually you will want to interact with your contracts from your own code.

In this section, we'll see how to interact with our contracts from JavaScript, and use [Hardhat to run our script](https://hardhat.org/guides/scripts.html) with our Hardhat configuration.
In this section, we'll see how to interact with our contracts from JavaScript, and use [Hardhat to run our script](https://hardhat.org/hardhat-runner/docs/advanced/scripts) with our Hardhat configuration.

<Callout>
Keep in mind that there are many other JavaScript libraries available, and you can use whichever you like the most. Once a contract is deployed, you can interact with it through any library!
Expand Down
4 changes: 2 additions & 2 deletions content/contracts/5.x/learn/developing-smart-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We won’t cover language concepts such as syntax or keywords in this guide. For

* For a general overview of how Ethereum and smart contracts work, the official website hosts a [Learn about Ethereum](https://ethereum.org/learn/) section with lots of beginner-friendly content.
* If you’re new to the language, the [official Solidity documentation](https://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts.html) is a good resource to have handy. Take a look at their [security recommendations](https://solidity.readthedocs.io/en/latest/security-considerations.html), which nicely go over the differences between blockchains and traditional software platforms.
* Consensys' [best practices](https://consensys.github.io/smart-contract-best-practices/) are quite extensive, and include both [proven patterns](https://consensys.github.io/smart-contract-best-practices/development-recommendations/) to learn from and [known pitfalls](https://consensys.github.io/smart-contract-best-practices/attacks/) to avoid.
* Consensys' [best practices](https://consensys.github.io/smart-contract-best-practices/) are quite extensive, and include both [proven patterns](https://consensysdiligence.github.io/smart-contract-best-practices/development-recommendations/) to learn from and [known pitfalls](https://consensysdiligence.github.io/smart-contract-best-practices/attacks/) to avoid.
* The [Ethernaut](https://ethernaut.openzeppelin.com/) web-based game will have you look for subtle vulnerabilities in smart contracts as you advance through levels of increasing difficulty.

With that out of the way, let’s get started!
Expand Down Expand Up @@ -112,7 +112,7 @@ npx hardhat compile
# Compiled 1 Solidity file successfully (evm target: paris).
```

The [`compile`](https://hardhat.org/guides/compile-contracts.html#compiling-your-contracts) built-in task will automatically look for all contracts in the `contracts` directory, and compile them using the Solidity compiler using the configuration in [`hardhat.config.js`](https://hardhat.org/config/#solidity-configuration).
The [`compile`](https://hardhat.org/hardhat-runner/docs/guides/compile-contracts) built-in task will automatically look for all contracts in the `contracts` directory, and compile them using the Solidity compiler using the configuration in [`hardhat.config.js`](https://hardhat.org/config/#solidity-configuration).

You will notice an `artifacts` directory was created: it holds the compiled artifacts (bytecode and metadata), which are .json files. It’s a good idea to add this directory to your `.gitignore`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Box deployed to: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0

We can then interact with our `Box` contract to `retrieve` the value that we stored during initialization.

We will use the [Hardhat console](https://hardhat.org/guides/hardhat-console.html) to interact with our upgraded `Box` contract.
We will use the [Hardhat console](https://hardhat.org/hardhat-runner/docs/guides/hardhat-console) to interact with our upgraded `Box` contract.

We need to specify the address of our proxy contract from when we deployed our `Box` contract.

Expand Down
2 changes: 1 addition & 1 deletion content/upgrades-plugins/foundry/foundry-upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ address proxy = UnsafeUpgrades.deployUUPSProxy(

## Deploying and Verifying

Run your script with `forge script` to broadcast and deploy. See Foundry’s [Solidity Scripting](https://book.getfoundry.sh/guides/scripting-with-solidity) guide.
Run your script with `forge script` to broadcast and deploy. See Foundry’s [Solidity Scripting](https://getfoundry.sh/forge/scripting) guide.

<Callout type='warn'>
Include the `--sender <ADDRESS>` flag for the `forge script` command when performing upgrades, specifying an address that owns the proxy or proxy admin. Otherwise, `OwnableUnauthorizedAccount` errors will occur.
Expand Down
2 changes: 1 addition & 1 deletion content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require('@openzeppelin/hardhat-upgrades');

### Proxies

You can use this plugin in a [Hardhat script](https://hardhat.org/guides/scripts.html) to deploy an upgradeable instance of one of your contracts via the `deployProxy` function:
You can use this plugin in a [Hardhat script](https://hardhat.org/hardhat-runner/docs/advanced/scripts) to deploy an upgradeable instance of one of your contracts via the `deployProxy` function:

```js
// scripts/create-box.js
Expand Down
4 changes: 2 additions & 2 deletions content/upgrades-plugins/migrate-from-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Keeping that aside, everything else remains the same since both the CLI and plug

## Installation

[Install Hardhat](https://hardhat.org/tutorial/creating-a-new-hardhat-project.html) and when initializing it, select the `Create an empty hardhat.config.js` option.
[Install Hardhat](https://hardhat.org/tutorial/creating-a-new-hardhat-project) and when initializing it, select the `Create an empty hardhat.config.js` option.

```bash
$ npm install --save-dev hardhat
Expand Down Expand Up @@ -183,7 +183,7 @@ And this is how it would look like if we decided to upgrade our `Box` contract t

These scripts are just examples of how to use the exported data. We make no suggestions on whether to keep that file as it is or how to handle its data. This is up to the user now.

With Hardhat, we would write a script (**you can read more about Hardhat scripts [here](https://hardhat.org/guides/scripts.html) and about using the `hardhat-upgrades` plugin [here](/upgrades-plugins/hardhat-upgrades)**):
With Hardhat, we would write a script (**you can read more about Hardhat scripts [here](https://hardhat.org/hardhat-runner/docs/advanced/scripts) and about using the `hardhat-upgrades` plugin [here](/upgrades-plugins/hardhat-upgrades)**):

```jsx

Expand Down
Loading