Skip to content

Commit

Permalink
Refactor multisig and multicall3 pages
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekjain23 committed May 9, 2024
1 parent 3ff870e commit 4be3111
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 37 deletions.
38 changes: 24 additions & 14 deletions docs/build/getting-started/multicall.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: 'It allows you to bundle multiple calls to various contracts, for both reading and writing data, into a single transaction.'
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
---

Expand All @@ -8,23 +8,29 @@ image: /img/logo/WASP_logo_dark.png

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 Shimmer EVM, the Multicall3 contract is deployed at this address: [0xcA11bde05977b3631167028862bE2a173976CA11](https://explorer.evm.iota.org/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=write_contract).
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. You can use the Multicall3 contract on Shimmer EVM deployed at the following address: [0xcA11bde05977b3631167028862bE2a173976CA11](https://explorer.evm.iota.org/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=write_contract).

## Benefits of Multicall3
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.
### Reduced Gas Costs
Multicall3 minimizes the total gas fees associated with interacting with the blockchain by grouping calls together.

- **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.
### 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.
### 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.
### 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.
### 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

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

:::

Expand Down Expand Up @@ -87,9 +93,12 @@ function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls)


### Function: blockAndAggregate
- ## Description:

- Description:

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

```solidity
function blockAndAggregate(Call[] calldata calls)
public
payable
Expand All @@ -107,8 +116,8 @@ function blockAndAggregate(Call[] calldata calls)


### Function: aggregate3
- ## Description:
This function aggregates calls similar to aggregate but allows specifying whether failures are allowed for each call individually.
- #### 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);
Expand All @@ -119,11 +128,11 @@ function aggregate3(Call3[] calldata calls) public payable returns (Result[] mem
| 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.
- returnData (Result[] memory): An array of Result structs, as defined in `tryAggregate`.


### Function: aggregate3Value
- ## Description:
- #### 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.


Expand All @@ -141,6 +150,7 @@ function aggregate3Value(Call3Value[] calldata calls) public payable returns (Re


## 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.
Expand Down
71 changes: 48 additions & 23 deletions docs/build/getting-started/safe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,70 @@ description: 'Multisig wallet refers to having multiple private keys for a singl
image: /img/logo/WASP_logo_dark.png
---

# Safe Wallet
### Safe wallet is IOTA's exclusive [MultiSig](https://safe.iotaledger.net/welcome) wallet. The term “multisig” is short for "multisignature".
# MultiSig Wallet
:::note TL;DR;
Safe Wallet is IOTA's exclusive [MultiSig](https://safe.iotaledger.net/welcome) wallet. The term “
multisig” is short for "multisignature".

The security of cryptocurrency demands greater attention as digital assets gain traction. Individuals and organizations need robust strategies to safeguard their funds. Multisignature (multisig) wallets are emerging as a powerful cybersecurity tool in the crypto space.
:::

The security of cryptocurrency demands greater attention as digital assets gain traction. Individuals and organizations need robust strategies to safeguard their funds. Multisignature (multisig) wallets are emerging as a powerful cybersecurity tool in crypto.

Unlike traditional finance, decentralized digital assets require a different approach to security. Thankfully, innovative technologies like multisig wallets provide an extra layer of protection, allowing you to trade cryptocurrencies on chains like [Shimmer EVM](https://explorer.evm.shimmer.network/) or [IOTA](https://explorer.evm.iota.org/).
Decentralized digital assets require a different approach to security than traditional finance. Thankfully, innovative technologies like multisig wallets provide an extra layer of protection, allowing you to trade cryptocurrencies on chains like [Shimmer EVM](https://explorer.evm.shimmer.network/) or [IOTA](https://explorer.evm.iota.org/).

![IOTA MultiSig](/icons/iota/safe.png)
![IOTA Sandbox](/img/get-started/safe/safe.png)

## Why are multisig wallets more secure for crypto?
## Why Are Multisig Wallets More Secure?
Traditional crypto wallets rely on a single signature for transactions, making them vulnerable if that key is compromised. Multisig wallets offer superior security by requiring multiple approvals before funds can be moved. This added layer of verification significantly reduces the risk of unauthorized transactions, even if a hacker gains access to one of your keys.

## Use Cases for multisig Wallet

## Use Cases for multisig wallet
### Shared Asset Security

### Shared Asset Security:
- Joint Ownership: Securely manage crypto held jointly by couples, business partners, or organizations. Requires approval from all parties for transactions, preventing unauthorized spending.
- Company Funds: For businesses with substantial crypto holdings, enforce multi-approval workflows for withdrawals, minimizing internal theft risk.
#### Joint Ownership

### Enhanced Threat Protection:
- Lost/Compromised Keys: Mitigate the impact of lost or compromised keys. Remaining keys can still safeguard funds, unlike single-signature wallets.
- Hacking Defense: Add a significant hurdle for attackers. Even with access to one key, they cannot steal funds without additional signatures.
- Custodial Account Control: Maintain control over crypto held in exchanges or IRA providers. Multisig wallets ensure withdrawals require approval from both the - user and the custodian, preventing unauthorized access.
Securely manage crypto held jointly by couples, business partners, or organizations. Requires approval from all parties for transactions, preventing unauthorized spending.

### Important Considerations:
- Technical Complexity: Setting up and using multisig wallets requires more technical expertise compared to traditional wallets.
- Signatory Balance: Finding the optimal balance between security (more signatories) and practicality (fewer signatories) is crucial.
- Individual Suitability: For most individual users with smaller crypto holdings, a standard single-signature wallet might be sufficient.
#### Company Funds

For businesses with substantial crypto holdings, enforce multi-approval workflows for withdrawals, minimizing internal theft risk.

:::tip
### Enhanced Threat Protection

Learn more about safe account [here](https://help.safe.global/en/articles/40835-what-safe-setup-should-i-use).
#### Lost/Compromised Keys

:::
Mitigate the impact of lost or compromised keys. Remaining keys can still safeguard funds, unlike single-signature wallets.

#### Hacking Defense

Add a significant hurdle for attackers. Even with access to one key, they cannot steal funds without additional signatures.

#### Custodial Account Control

Maintain control over crypto held in exchanges or IRA providers. Multisig wallets ensure withdrawals require approval from both the - user and the custodian, preventing unauthorized access.

### Important Considerations

:::info
#### Technical Complexity

Setting up and using multisig wallets requires more technical expertise compared to traditional wallets.

#### Signatory Balance

Finding the optimal balance between security (more signatories) and practicality (fewer signatories) is crucial.

#### Individual Suitability

For most individual users with smaller crypto holdings, a standard single-signature wallet might be sufficient.


:::tip

Setting up safe account: [here](https://help.safe.global/en/articles/40868-creating-a-safe-on-a-web-browser).
Learn more about safe accounts in the [Safe documentation](https://help.safe.global/en/articles/40835-what-safe-setup-should-i-use).

:::

## IOTA has its own dedicated MultiSig wallet - [safe(Wallet)](https://safe.iotaledger.net/welcome)
:::info Set Up a Safe Account
You can find instructions on setting up a safe account in the [Safe documentation](https://help.safe.global/en/articles/40868-creating-a-safe-on-a-web-browser).
:::

0 comments on commit 4be3111

Please sign in to comment.