Skip to content
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
2 changes: 0 additions & 2 deletions docs/build/integrations/indexers/subsquid.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ There are two primary ways to index EVM contracts deployed to [Astar networks](/

Subsquid supports the following Astar networks for native EVM indexing:
* `astar`
* `astar-zkatana`
* `astar-zkevm`
* `shiden`
* `shibuya`

Expand Down
17 changes: 4 additions & 13 deletions docs/build/introduction/astar_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,17 @@ The Shibuya native token symbol is SBY.

To obtain test tokens from the faucet, please visit the Astar Portal and connect to Shibuya. If for any reason the faucet is empty, please contact the Astar team on Discord.

### zKyoto (Sepolia) (Deprecated)

zKyoto was connected to the Ethereum Sepolia testnet and Polygon AggLayer. Testing ground for dApps deployed on the Astar zkEVM. This testnet has now been transitioned to [Soneium Minato](https://docs.soneium.org/).

## Mainnets

Astar Collective, with the ASTR token, supports three mainnets:
Astar Collective, with the ASTR token, supports two mainnets:

1. Astar Network (Parachain)
2. Astar zkEVM (soon to be deprecated)
3. Soneium
1. Astar Network (Parachain)
2. Soneium

### Astar Network (Parachain)

Astar parachain is connected to Polkadot Relay chain supporting WASM & EVM smart contract deployments.
The Astar native token symbol is ASTR.

### Astar zkEVM (Deprecated)

Astar zkEVM was an Ethereum Layer 2 network, powered by Polygon CDK. Technically referred to as Validium, combining zk rollup technology with modular data availability. Next phase for Astar zkEVM is the transition to [Soneium](https://docs.soneium.org/).

### Soneium
Soneium is a next-generation blockchain ecosystem designed to invoke emotion and empower creativity. It was founded by Sony Group Corporation, a global technology leader, and Startale, a Web3 innovator. Soneium stands as a versatile, general-purpose blockchain ready to serve diverse needs across all verticals and support users globally. Astar and it's token ASTR will play a crucial role in the ecosystem as driven asset.
Soneium is a general-purpose Layer 2 blockchain co-founded by Sony Group Corporation and Startale. ASTR serves as a key asset within the Soneium ecosystem.
2 changes: 1 addition & 1 deletion docs/build/nodes/evm-tracing-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cp astar-runtime-52-substitute-tracing.wasm /var/lib/astar/wasm
chown -hR astar /var/lib/astar/wasm
```

When wasm blob located correctly the node launch string should be addicted by `--wasm-runtime-overrides=/var/lib/astar/wasm` flag. Then service should be restarted, if all go well then node will catch up tracing runtime and substitute on-chain version by it.
When wasm blob located correctly the node launch string should be addicted by `--wasm-runtime-overrides=/var/lib/astar/wasm` flag. Then service should be restarted, if all go well then node will catch up tracing runtime and substitute onchain version by it.

:::important

Expand Down
2 changes: 1 addition & 1 deletion docs/build/wasm/contract_environment/explorers.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Block explorers are the Google for searching data on a blockchain. They give dev
</TabItem>
<TabItem value="shibuya" label="Shibuya Network">
<p>Subscan is the most used explorer in the Polkadot ecosystem. With Subscan you can search the complete Astar Network. Subscan support Substrate and Ethereum API. BlockScout is the best explorer for developers who are building on Astar EVM, as it has all the features of EtherScan.</p>
<p>Sirato is a contract explorer for ink! smart contracts. Sirato provides a contract verification service enabling users to decode information about contract code and instances that have been deployed using the Contracts Pallet. The service allows users to upload source code and metadata to the service which will verify it matches the on-chain. For instructions on how to use the service you can refer <a href="https://medium.com/sirato/how-to-verify-ink-smart-contracts-83fec5de81aa">here</a>.</p>
<p>Sirato is a contract explorer for ink! smart contracts. Sirato provides a contract verification service enabling users to decode information about contract code and instances that have been deployed using the Contracts Pallet. The service allows users to upload source code and metadata to the service which will verify it matches the onchain. For instructions on how to use the service you can refer <a href="https://medium.com/sirato/how-to-verify-ink-smart-contracts-83fec5de81aa">here</a>.</p>
<p>Under certain circumstances, the Polkadot.js apps portal may also be used to explore blocks.</p>
<p><b>Subscan:</b> <a href="https://shibuya.subscan.io">https://shibuya.subscan.io</a></p>
<p><b>Sirato:</b> <a href="https://shibuya.sirato.xyz/">https://shibuya.sirato.xyz/</a></p>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/wasm/interact/astarjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ main();

### Initialise ContractPromise Class

The `ContractPromise` interface allows us to interact with a deployed contract. In the previous Blueprint example this instance was created via `createContract`. In general use, we can also create an instance via `new`, i.e. when we are attaching to an existing contract on-chain:
The `ContractPromise` interface allows us to interact with a deployed contract. In the previous Blueprint example this instance was created via `createContract`. In general use, we can also create an instance via `new`, i.e. when we are attaching to an existing contract onchain:

```js
import { Abi, ContractPromise } from "@polkadot/api-contract";
Expand Down
10 changes: 5 additions & 5 deletions docs/build/wasm/smart-contract-wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ Astar & Shiden runtimes are based on Substrate, and both networks incorporate `p

To avoid unnecessary complexity, and writing boilerplate code, the most appropriate method of building will involve the use of an eDSL specifically targeting `pallet-contracts`, such as [ink!] (based on Rust), or [ask!] (based on AssemblyScript), or possibly others as the ecosystem grows.

After compilation, a Wasm blob can then be deployed and stored on-chain.
After compilation, a Wasm blob can then be deployed and stored onchain.

### Execution Engine

Pallet-contracts uses [wasmi](https://github.com/paritytech/wasmi) as a Wasm interpreter to execute Wasm smart contract blobs. Although there is a faster JIT interpreter such as [wasmtime](https://github.com/bytecodealliance/wasmtime) available in the native runtime, smart contracts are an untrusted environment which require a higher degree of correctness of interpretation, which makes wasmi a more suitable option.

### Two-step Deployment of Contracts

The contract code (Wasm blob), and contract address and storage are decoupled from one another other, so require two steps to deploy a new contract on-chain:
The contract code (Wasm blob), and contract address and storage are decoupled from one another other, so require two steps to deploy a new contract onchain:

1. First, upload the Wasm contract on-chain (every contract Wasm code has a `code_hash` as an identifier).
1. First, upload the Wasm contract onchain (every contract Wasm code has a `code_hash` as an identifier).
2. Second, instantiate the contract - it will create an address and storage for that contract.
3. Anyone can instantiate a contract based on its `code_hash`.

There are several benefits of decoupling the contract code from the address/storage:

- To save space on-chain. Since a contract can have several constructors and instantiations, a redeployment will create a new instance based on the same underlying code. Think about standardized tokens, like [PSP22][PSP22] & [PSP34][PSP34], that will have one `code_hash` & `blob` living on-chain, and as many instantiations as are needed, rather than having to upload code with each new instantiation (for example, on Ethereum).
- To save space onchain. Since a contract can have several constructors and instantiations, a redeployment will create a new instance based on the same underlying code. Think about standardized tokens, like [PSP22][PSP22] & [PSP34][PSP34], that will have one `code_hash` & `blob` living onchain, and as many instantiations as are needed, rather than having to upload code with each new instantiation (for example, on Ethereum).
- To instantiate a new contract using code within an existing smart contract (see the delegator example), `code_hash` is all that is needed.
- Some standard contracts such as ([PSP22][PSP22] and [PSP34][PSP34]) will only be uploaded on-chain once, preventing users from having to pay gas costs for uploading new code.
- Some standard contracts such as ([PSP22][PSP22] and [PSP34][PSP34]) will only be uploaded onchain once, preventing users from having to pay gas costs for uploading new code.
- Update contract code for an address: replace the contract code at the specified address with new code (see [set_code_hash][set_code_hash]). Storage and balances will be preserved.

### For More Information About `pallet-contracts`
Expand Down
2 changes: 1 addition & 1 deletion docs/build/wasm/swanky-suite/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ To print errors and contract debug output to the console log, supply `-lerror,ru
./target/release/swanky-node -lerror,runtime::contracts=debug
```

Important: Debug output is only printed for RPC calls or off-chain tests ‒ not for transactions.
Important: Debug output is only printed for RPC calls or offchain tests ‒ not for transactions.

See the ink! [FAQ](https://ink.substrate.io/faq/#how-do-i-print-something-to-the-console-from-the-runtime) for more details: How do I print something to the console from the runtime?.

Expand Down
16 changes: 8 additions & 8 deletions docs/build/wasm/transaction-fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Gas = Weight = (refTime, proofSize)

## Storage Rent

Storage rent, also called as *Automatic Deposit Collection* is a **mechanism** that ensure security of the chain by preventing on-chain storage spamming.
It prevents malicious actors from spamming the network with low-value transactions and to ensure that callers have a financial stake when storing data on-chain.
Storage rent, also called as *Automatic Deposit Collection* is a **mechanism** that ensure security of the chain by preventing onchain storage spamming.
It prevents malicious actors from spamming the network with low-value transactions and to ensure that callers have a financial stake when storing data onchain.

Users will be charged for every byte stored on-chain and the call will transfer this fee from the free balance of the user to the reserved balance of the contract. Note that the contract itself is unable to spend this reserved balance (but it can expose a function that remove on-chain storage and the caller will get the funds) .
It also incentives users to remove unused data from the chain by getting rent fees back. Any user can get back the rent fees if they remove on-chain data (not specifically the user that was first charged for). It's up to the contract developers and users to understand how and if they can get their storage deposit back.
Users will be charged for every byte stored onchain and the call will transfer this fee from the free balance of the user to the reserved balance of the contract. Note that the contract itself is unable to spend this reserved balance (but it can expose a function that remove onchain storage and the caller will get the funds) .
It also incentives users to remove unused data from the chain by getting rent fees back. Any user can get back the rent fees if they remove onchain data (not specifically the user that was first charged for). It's up to the contract developers and users to understand how and if they can get their storage deposit back.

### Storage Rent Calculation

Expand All @@ -47,12 +47,12 @@ This is because the first call will create a lot of new entries for the user (mo

If the consecutive calls only modify the existing database entry, the caller is only charged for the extra bytes they add to the entry. In the case they reduce the size of the DB entry, they will get storage rent back. What this means in practice is that user can increase their free balance after interacting with a smart contract!

If a user want to get it back, it should remove on-chain data. It is only possible if the smart-contract expose a function that remove data from chain (like `remove_mapping_entry` in the example below).
If a user want to get it back, it should remove onchain data. It is only possible if the smart-contract expose a function that remove data from chain (like `remove_mapping_entry` in the example below).

#### For smart-contracts developers

As the only way for users to get back their reserved balance is to remove on-chain data, it is important to make sure that the smart-contract expose functions that allow users to do so.
If the contracts don't expose such functions, there will be no way to remove on-chain data used by the contract and the
As the only way for users to get back their reserved balance is to remove onchain data, it is important to make sure that the smart-contract expose functions that allow users to do so.
If the contracts don't expose such functions, there will be no way to remove onchain data used by the contract and the
users will not be able to get back their reserved balance back (as it will be reserved balance on the contract account).

### StorageDepositLimit
Expand Down Expand Up @@ -147,6 +147,6 @@ The caller will get balance repatriated (and not the user that was first charged

#### `flip_bool` & `update_32`

It will not have rent fees because it will not store new data on-chain (only updating value).
It will not have rent fees because it will not store new data onchain (only updating value).

[weight]: https://docs.substrate.io/reference/how-to-guides/weights/
2 changes: 1 addition & 1 deletion docs/learn/Proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The proxy pallet provides the following extrinsics (functions):

**Why Proxy Deposits ?**
---
To create proxies within the network, it is necessary to provide deposits in the native currency (like ASTR or SDN). The deposit is required because adding a proxy requires some storage space on-chain, which must be replicated across every peer in the network. Due to the costly nature of this, these functions could open up the network to a Denial-of-Service attack.
To create proxies within the network, it is necessary to provide deposits in the native currency (like ASTR or SDN). The deposit is required because adding a proxy requires some storage space onchain, which must be replicated across every peer in the network. Due to the costly nature of this, these functions could open up the network to a Denial-of-Service attack.

When creating a proxy, a bond is deducted from your free balance and transferred to your reserved balance. This mechanism helps maintain the integrity and stability of the proxy system while providing assurance that the bond can be returned when the proxy is deactivated or removed.

Expand Down
6 changes: 3 additions & 3 deletions docs/learn/architecture/astar-parachain.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebar_position: 1
# Overview
If you are already building on Polkadot you will not need to go over the sections covering Substrate and how to create a Runtime, but it will be helpful for you to understand the environment, terminology and how to leverage Polkadot's highly interoperable environment.

Polkadot is a multi-chain environment which enables specialized blockchains (called Parachains) to communicate with each other in a secure, trustless environment.
Polkadot is a multi-chain environment which enables specialized blockchains (called Parachains) to communicate with each other in a secure, permissionless environment.

Astar is a parachain connected to the Polkadot Relay chain, specialized for:
Astar Network is a parachain connected to the Polkadot Relay chain, specialized for:
* Executing all types of smart contracts.
* Providing a hybrid EVM + Wasm environment with interoperability.
* Incentivizing ecosystem innovation and providing basic income for dApp developers.
Expand Down Expand Up @@ -52,7 +52,7 @@ Parachains construct and propose blocks to validators on the Relay Chain, where
Based on Polkadot's design, as long as a chain's logic can compile to Wasm and adheres to the Relay Chain API, then it can connect to the Polkadot network as a parachain.
However, the majority of parachains today are built using [Substrate](https://substrate.io/) because Substrate-based chains are easy to integrate into Polkadot or Kusama to become a parachain. Essentially, Substrate is the SDK which can be used to build parachains and Polkadot is the means of securing the chains and allowing them to communicate with each other.

Astar Network is built with Substrate and inherints many Substrate features, such as Accounts.
Astar Network is built with Substrate and inherits many Substrate features, such as Accounts.

At a high level, a Substrate node provides a layered environment with two main elements:
1. An outer node that handles network activity such as peer discovery, managing transaction requests, reaching consensus with peers, and responding to RPC calls.
Expand Down
Binary file removed docs/learn/architecture/img/fig4.jpg
Binary file not shown.
10 changes: 3 additions & 7 deletions docs/learn/architecture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
title: Architecture
---

import Figure from '/src/components/figure'

# Overview
Before you get started on your journey towards becoming an Astar network hacker, it will be beneficial to know about what Polkadot and Ethereum are, because Astar Network connects to both, and each have their own set of benefits benefits and limitations.

<Figure src={require('/docs/learn/architecture/img/fig4.jpg').default} />
Before building on Astar Network, it helps to understand both Polkadot and Ethereum, since Astar Network connects to both.

Some highlights on the Polkadot parachain side are dApp Staking, ink! smart contracts, cross-chain messaging (XCM), and forkless upgradability, and on the Ethereum layer 2 side are the highest levels of EVM equivalence, shared liquidity across layer 2 networks, and access to the largest pool of developers in the blockchain industry that we can tailor our products for, on-demand.
Some highlights on the Polkadot parachain side are dApp Staking, ink! smart contracts, cross-chain messaging (XCM), and forkless upgradability. Astar Network supports full EVM compatibility, enabling Solidity developers to deploy contracts without modification.

For now, let's go over some basics that apply to all blockchains whether they are sovereign layer 1 networks, or rely on another blockchain such as the Polkadot Relay Chain for shared security and interoperability.

## Blockchain Basics
A blockchain is a decentralized ledger that records information in a sequence of blocks. The information contained in a block is an ordered set of instructions that may or may not result in a change in state.

In a blockchain network, individual computerscalled nodescommunicate with each other to form a decentralized peer-to-peer (P2P) network. There is no central authority that controls the network and, typically, each node that participates in block production stores a copy of the blocks that make up the canonical chain.
In a blockchain network, individual computers, called nodes, communicate with each other to form a decentralized peer-to-peer (P2P) network. There is no central authority that controls the network and, typically, each node that participates in block production stores a copy of the blocks that make up the canonical chain.

In most cases, users interact with a blockchain by submitting a request that might result in a change in state, for example, a request to change the owner of a file or to transfer funds from one account to another. These transactions requests are gossiped to other nodes on the network and assembled into a block by a block author. To ensure the security of the data on the chain and the ongoing progress of the chain, the nodes use some form of consensus to agree on the state of the data in each block and on the order of transactions executed. [Read more...](https://docs.substrate.io/fundamentals/blockchain-basics/)

Expand Down
Loading
Loading