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

Make Wiki ready for IOTA EVM launch #1577

Merged
merged 8 commits into from
Jun 4, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/build/_partials/_metamask_buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { Networks } from '@theme/constant';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId='network'>
<Tabs groupId='network' queryString>
<TabItem value='iota' label='IOTA EVM'>
<AddToMetaMaskButton {...Networks['iota']}/>
</TabItem>
<TabItem value='iota_testnet' label='IOTA EVM Testnet'>
<AddToMetaMaskButton {...Networks['iota_testnet']}/>
</TabItem>
Expand Down
37 changes: 37 additions & 0 deletions docs/build/_partials/_oracles_contract_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { AddToMetaMaskButton } from '@theme/AddToMetaMaskButton';
import { Networks } from '@theme/constant';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId='network' queryString>
<TabItem value='iota' label='IOTA EVM'>

| Contract Type | Contract Address |
|:----------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Pyth contract | [https://explorer.evm.iota.org/address/0x8D254a21b3C86D32F7179855531CE99164721933](https://explorer.evm.iota.org/address/0x8D254a21b3C86D32F7179855531CE99164721933) |
| Supra Pull Contract | [https://explorer.evm.iota.org/address/0x2FA6DbFe4291136Cf272E1A3294362b6651e8517](https://explorer.evm.iota.org/address/0x2FA6DbFe4291136Cf272E1A3294362b6651e8517) |
| Supra Storage Contract | [https://explorer.evm.iota.org/address/0xD02cc7a670047b6b012556A88e275c685d25e0c9](https://explorer.evm.iota.org/address/0xD02cc7a670047b6b012556A88e275c685d25e0c9) |
| Supra Push Contract | [https://explorer.evm.iota.org/address/0xD02cc7a670047b6b012556A88e275c685d25e0c9](https://explorer.evm.iota.org/address/0xD02cc7a670047b6b012556A88e275c685d25e0c9) |

</TabItem>
<TabItem value='shimmer' label='ShimmerEVM'>

| Contract Type | Contract Address |
|:----------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Pyth contract | [https://explorer.evm.shimmer.network/address/0x290f23E4a034Db5237edCb5aA2D94Acb4DD19fD2](https://explorer.evm.shimmer.network/address/0x290f23E4a034Db5237edCb5aA2D94Acb4DD19fD2) |
| Supra Pull Contract | [https://explorer.evm.shimmer.network/address/0xe41444462709484272F54371F3f53bBF900Ec49E](https://explorer.evm.shimmer.network/address/0xe41444462709484272F54371F3f53bBF900Ec49E) |
| Supra Storage Contract | [https://explorer.evm.shimmer.network/address/0x3E5E89d14576cE9f20a8347aA682517fe65B4ACB](https://explorer.evm.shimmer.network/address/0x3E5E89d14576cE9f20a8347aA682517fe65B4ACB) |
| Supra Push Contract | [https://explorer.evm.shimmer.network/address/0x3df842b27c997cEc63160E79CB4398c82645A1c3](https://explorer.evm.shimmer.network/address/0x3df842b27c997cEc63160E79CB4398c82645A1c3) |

</TabItem>
</Tabs>

:::tip Oracle Documentation

You can find detailed documentation on the Oracles in their official documentation:

* [Pyth Oracle Docs](https://docs.pyth.network/price-feeds/contract-addresses/evm)
* [Supra Pull Docs](https://gb-docs.supraoracles.com/docs/data-feeds/pull-model/networks)
* [Supra Push Docs](https://gb-docs.supraoracles.com/docs/data-feeds/decentralized/networks)

:::
42 changes: 42 additions & 0 deletions docs/build/getting-started/blastAPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
description: Blast API is a decentralized platform providing scalable node infrastructure for accessing blockchain data, supporting multiple networks including IOTA EVM.
keywords:
- IOTA EVM
- blockchain API
- decentralized
- node infrastructure
- tools
- Blast api
- archive node
image: /img/logo/WASP_logo_dark.png
---

# Blast API

[Blast API](https://blastapi.io/) is a decentralized platform that provides reliable and scalable node infrastructure
for accessing blockchain data. It supports multiple blockchain networks, offering seamless integration and
high-performance API endpoints for cross-chain decentralized applications (dApps).

## Enhanced Performance and Reliability

Blast API uses a decentralized network of third-party node providers, that ensure high availability and fast response
times. This architecture provides resilient infrastructure services crucial for dApps requiring real-time data access.

## Multi-Blockchain Support

Besides IOTA EVM, Blast API supports a wide range of blockchain networks, allowing access to multiple blockchains
through a single unified platform, therefore simplifying the development process and expanding the potential use cases
for dApps.

## Archival Nodes

Blast API includes archival nodes, which store all historical transaction data from the blockchain’s
genesis block to the present. This allows developers to query and retrieve past information, which is essential for
applications needing access to comprehensive blockchain histories.


:::tip Blast API Endpoints

You can find a full list of Blast API endpoints in the [Networks & Endpoints section](networks-endpoints.mdx).

:::
194 changes: 194 additions & 0 deletions docs/build/getting-started/multicall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
---
description: 'Multicall3 allows you to bundle multiple calls to various contracts, for both reading and writing data, into a single transaction.'
image: /img/logo/WASP_logo_dark.png
---

# Multicall3
## Powering Efficient Batch Transactions on L2 Networks

Multicall3 is a smart contract on the Ethereum Virtual Machine (EVM) that streamlines transactions. It allows you to bundle multiple calls to various contracts, for both reading and writing data, into a single transaction.

This can be particularly useful when working with decentralized applications that require multiple contract interactions or when batching multiple calls to save on gas costs. To use the Multicall3 contract on IOTA EVM, the Multicall3 contract is deployed at this address: [0xcA11bde05977b3631167028862bE2a173976CA11](https://explorer.evm.iota.org/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=write_contract).

This contract offers significant advantages for optimizing transaction processing on L2 networks, also known as Layer 2 scaling solutions. Here's how Multicall3 enhances efficiency:

- **Reduced Gas Costs:** By grouping calls together, Multicall3 minimizes the total gas fees associated with interacting with the blockchain. Gas refers to the computational effort required to execute a transaction on the network.

- **Guaranteed Data Consistency:** Multicall3 fetches data from a single block on the blockchain, ensuring that all the information you receive reflects a consistent state. This eliminates discrepancies that might arise from fetching data across separate transactions.

- **Faster Execution Speeds:** You no longer need to wait for individual transactions to be confirmed one by one. Multicall3 processes everything efficiently in a single transaction, significantly speeding up the overall process.

- **Simplified Workflows:** Multicall3 removes the complexity of worrying about the order in which transactions are processed, eliminating potential issues caused by race conditions. Race conditions occur when multiple transactions compete for resources, and the outcome can depend on the order they are executed.

- **All-or-Nothing Execution:** Multicall3 ensures data integrity by functioning on an all-or-nothing basis. This means that either all the calls within the Multicall3 transaction succeed, or none of them do. This prevents partial execution and maintains data consistency.

:::tip

You can find the ABI of the contract in the [Multicall3 website](https://www.multicall3.com/abi).

:::


## Contract Information

### Function: aggregate

#### Description:
This function aggregates the results of multiple function calls made to different contracts within a single transaction.

```solidity
function aggregate(Call[] calldata calls) public payable returns (uint256 blockNumber, bytes[] memory returnData);
```


|Parameter Name | Description|
|-----------|---------------------------------------------------------------------
| calls (Call[] calldata) | An array of Call structs. Each Call struct contains the target contract address (address) and the encoded function call data (bytes).|

#### Return Values:
- blockNumber (uint256): The block number where the calls were executed.
- returnData (bytes[] memory): An array of bytes containing the return data from each call.

### Function: tryAggregate

#### Description:
This function performs a similar function to `aggregate` but allows individual calls to fail without halting the entire execution.


```solidity
function tryAggregate(bool requireSuccess, Call[] calldata calls) public payable returns (Result[] memory returnData);
```

| Parameter Name | Description |
|----------------|-----------------------------------------------------------------------------|
| requireSuccess (bool) | A boolean flag indicating whether all calls must succeed (true) or if failures are allowed (false). |
| calls (Call[] calldata) | An array of Call structs. Each Call struct contains the target contract address (address) and the encoded function call data (bytes). |


#### Return Values:
returnData (Result[] memory): An array of Result structs. Each Result struct contains a bool indicating success (success) and the return data for the corresponding call (bytes returnData).

### Function: tryBlockAndAggregate

#### Description:
This function combines features of `tryAggregate` and retrieves additional block information.


```solidity
function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls)
public
payable
returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData);
```

| Parameter Name | Description |
|----------------|-----------------------------------------------------------------------------|
| requireSuccess (bool) | A boolean flag indicating whether all calls must succeed (true) or if failures are allowed (false). |
| calls (Call[] calldata) | An array of Call structs. Each Call struct contains the target contract address (address) and the encoded function call data (bytes). |

#### Return Values:
- blockNumber (uint256): The block number where the calls were executed.
- blockHash (bytes32): The hash of the block where the calls were executed.
- returnData (Result[] memory): An array of Result structs, as defined in tryAggregate.


### Function: blockAndAggregate

#### Description:
This function is a simplified version of `tryBlockAndAggregate` that always requires all calls to succeed.

```solidity
function blockAndAggregate(Call[] calldata calls)
public
payable
returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData);
```

|Parameter Name | Description|
|-----------|---------------------------------------------------------------------
| calls (Call[] calldata) | An array of Call structs, as defined in aggregate.|

#### Return Values:
- blockNumber (uint256): The block number where the calls were executed.
- blockHash (bytes32): The hash of the block where the calls were executed.
- returnData (Result[] memory): An array of Result structs, as defined in tryAggregate.


### Function: aggregate3
#### Description:
This function aggregates calls similar to `aggregate` but allows specifying whether failures are allowed for each call individually.

```solidity
function aggregate3(Call3[] calldata calls) public payable returns (Result[] memory returnData);
```

|Parameter Name | Description|
|-----------|---------------------------------------------------------------------
| calls (Call[] calldata) | An array of Call3 structs. Each Call3 struct includes the target contract address (address), a flag indicating if failure is allowed (bool allowFailure), and the encoded function call data (bytes callData).|

#### Return Values:
- returnData (Result[] memory): An array of Result structs, as defined in `tryAggregate`.


### Function: aggregate3Value
#### Description:
This function aggregates calls with a specified value for each call, allowing sending funds along with the call data. It ensures the total sent value matches the sum of individual call values.


```solidity
function aggregate3Value(Call3Value[] calldata calls) public payable returns (Result[] memory returnData);
```

|Parameter Name | Description|
|-----------|---------------------------------------------------------------------
| calls (Call[] calldata) | An array of Call3Value structs. Each Call3Value struct includes the target contract address (address), a flag indicating if failure is allowed (bool allowFailure), the value to send along with the call (uint256 value), and the encoded function call data (bytes callData).

#### Return Values:
- returnData (Result[] memory): An array of Result structs, as defined in `tryAggregate`.



## Additional Functions
The contract also includes several view functions that retrieve blockchain data without modifying the state:

- `getBlockHash(uint256 blockNumber)`: Returns the block hash for a given block number.
- `getBlockNumber()`: Returns the current block number.
- `getCurrentBlockCoinbase()`: Returns the address of the block miner (coinbase).
- `getCurrentBlockDifficulty()`: Returns the difficulty of the current block.
- `getCurrentBlockGasLimit()`: Returns the gas limit of the current block.
- `getCurrentBlockTimestamp()`: Returns

## Structs

- Call
```solidity
struct Call {
address target;
bytes callData;
}
```
- Call3
```solidity
struct Call3 {
address target;
bool allowFailure;
bytes callData;
}

```
- Call3 Value
```solidity
struct Call3Value {
address target;
bool allowFailure;
uint256 value;
bytes callData;
}
```
- Result
```solidity
struct Result {
bool success;
bytes returnData;
}
```
14 changes: 13 additions & 1 deletion docs/build/getting-started/networks-endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ tags:
import { AddToMetaMaskButton } from '@theme/AddToMetaMaskButton';
import { Networks } from '@theme/constant';
import NetworkInfo from '@theme/NetworkInfo';
import { ChainId } from '@theme/ChainId';

# Networks & Endpoints

Expand All @@ -41,6 +40,18 @@ This network runs under a [Coordinator PoA scheme](/learn/protocols/coordinator/

<NetworkInfo.L1 {...Networks['iota']}/>

### IOTA EVM

[IOTA EVM](https://explorer.evm.iota.org) is the L2 EVM running on top of the IOTA network.

<AddToMetaMaskButton {...Networks['iota']} />

<NetworkInfo.Evm {...Networks['iota']}/>

#### Additional Info

<NetworkInfo.EvmCustom {...Networks['iota']}/>

## IOTA Testnet

[The IOTA Testnet](https://explorer.iota.org/iota-testnet) acts as a test bed for builders without any real world value.
Expand All @@ -64,6 +75,7 @@ This network is subject to occasional resets (no data retention) which are usual
<AddToMetaMaskButton {...Networks['iota_testnet']} />

<NetworkInfo.Evm {...Networks['iota_testnet']}/>

#### Additional Info

<NetworkInfo.EvmCustom {...Networks['iota_testnet']}/>
Expand Down
Loading
Loading