From e729a17670970fd9ae369d7a861e225a8a4cf211 Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Tue, 27 Feb 2024 15:43:08 -0300 Subject: [PATCH 1/5] Danger to info in languages and vms Review note in intro about on and off ledger requests, add link to actual explanation double check ShimmerEVM Testnet nomenclature Move test smart contracts down, add examples add link to deploy in basic SC remove highlight ERC721 move EVM to top layer (AKA group by intent or topic, rather than VM) rotate full example where it's different tabs in create foundry tabs in mint native tokens review intructions in register-token review headers allowance add warning about ERC20 in getbalance add note about onledger requests on /isc/explanations/invocation/ move /isc/explanations/proxies/ to wasm add link to JSON RPC in isc/getting-started/compatibility/#wrapped-calls-to-the-json-rpc --- .../_EVM-required-prior-knowledge.md | 2 +- .../docs/_admonitions/_EVM_compatibility.md | 2 +- .../_admonitions/_deploy_a_smart_contract.md | 5 + .../docs/_admonitions/_deploy_with_hardhat.md | 5 - .../docs/_admonitions/_deploy_with_remix.md | 5 - .../docs/_admonitions/_layer_balance_diff.md | 6 ++ .../docs/_admonitions/_off-ledger-requests.md | 5 + .../how-tos/token/_check_storage_deposit.md | 4 +- .../docs/explanations/how-accounts-work.md | 4 +- .../docs/explanations/invocation.md | 3 + .../docs/getting-started/compatibility.md | 2 +- .../docs/getting-started/quick-start.mdx | 2 +- .../docs/getting-started/tools.mdx | 7 +- .../docs/how-tos/{EVM => }/ERC20.md | 8 +- .../docs/how-tos/{EVM => }/ERC721.md | 10 +- .../docs/how-tos/allowance/allow.md | 12 ++- .../docs/how-tos/allowance/take-allowance.md | 4 + .../{EVM => }/create-a-basic-contract.md | 7 +- .../{EVM => }/deploy-a-smart-contract.mdx | 0 .../v1.0.0-rc.6/docs/how-tos/get-balance.md | 8 ++ .../docs/how-tos/get-randomness-on-l2.md | 100 +++++++++--------- .../v1.0.0-rc.6/docs/how-tos/introduction.md | 2 +- .../docs/how-tos/send-assets-to-l1.mdx | 42 ++++---- .../{EVM => }/send-funds-from-L1-to-L2.mdx | 2 +- .../how-tos/{EVM => }/test-smart-contracts.md | 4 +- .../docs/how-tos/token/create-foundry.md | 20 ++-- .../docs/how-tos/token/mint-token.md | 22 ++-- .../docs/how-tos/token/register-token.md | 9 +- .../isc/v1.0.0-rc.6/docs/introduction.md | 8 +- .../docs/reference/wasm-lib-data-types.mdx | 2 +- .../docs/schema/how-tos/funcdesc.mdx | 2 +- .../v1.0.0-rc.6/docs/schema/how-tos/state.mdx | 2 +- .../docs/schema/how-tos/typedefs.mdx | 2 +- .../docs/{explanations => schema}/proxies.mdx | 0 docs/build/isc/v1.0.0-rc.6/sidebars.js | 73 ++++++------- 35 files changed, 215 insertions(+), 176 deletions(-) create mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_a_smart_contract.md delete mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_hardhat.md delete mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_remix.md create mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md create mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md rename docs/build/isc/v1.0.0-rc.6/docs/how-tos/{EVM => }/ERC20.md (92%) rename docs/build/isc/v1.0.0-rc.6/docs/how-tos/{EVM => }/ERC721.md (94%) rename docs/build/isc/v1.0.0-rc.6/docs/how-tos/{EVM => }/create-a-basic-contract.md (82%) rename docs/build/isc/v1.0.0-rc.6/docs/how-tos/{EVM => }/deploy-a-smart-contract.mdx (100%) rename docs/build/isc/v1.0.0-rc.6/docs/how-tos/{EVM => }/send-funds-from-L1-to-L2.mdx (97%) rename docs/build/isc/v1.0.0-rc.6/docs/how-tos/{EVM => }/test-smart-contracts.md (98%) rename docs/build/isc/v1.0.0-rc.6/docs/{explanations => schema}/proxies.mdx (100%) diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM-required-prior-knowledge.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM-required-prior-knowledge.md index dff27f0c908..c1e17089a98 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM-required-prior-knowledge.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM-required-prior-knowledge.md @@ -8,7 +8,7 @@ EIP)) , [NFTs](/learn/protocols/stardust/core-concepts/multi-asset-ledger#non-fungible-tokens-nfts), [Smart Contracts](/learn/smart-contracts/introduction) and have already tinkered with [Solidity](https://docs.soliditylang.org/en/v0.8.16/). -You should also have basic knowledge on how to [create](../how-tos/EVM/create-a-basic-contract.md) and [deploy](../how-tos/EVM/deploy-a-smart-contract.mdx) +You should also have basic knowledge on how to [create](../how-tos/create-a-basic-contract.md) and [deploy](../how-tos/deploy-a-smart-contract.mdx) a smart contract. ::: \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM_compatibility.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM_compatibility.md index b180e76dc7c..1f20154e1ea 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM_compatibility.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_EVM_compatibility.md @@ -1,4 +1,4 @@ -:::warning EVM Compatibility +:::info EVM Compatibility The ISC EVM layer is also designed to be as compatible as possible with existing Ethereum [tools](../getting-started/tools.mdx) and functionalities. However, please make sure you have checked out the current diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_a_smart_contract.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_a_smart_contract.md new file mode 100644 index 00000000000..de4579b6d81 --- /dev/null +++ b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_a_smart_contract.md @@ -0,0 +1,5 @@ +:::tip Deploy a Smart Contract + +Deploy a Solidity Smart Contract following our [how to Deploy a Smart Contract guide](/isc/how-tos/deploy-a-smart-contract#remix). + +::: diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_hardhat.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_hardhat.md deleted file mode 100644 index 87a5ebacf19..00000000000 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_hardhat.md +++ /dev/null @@ -1,5 +0,0 @@ -:::tip Deploy a Smart Contract with Hardhat - -Deploy a Solidity Smart Contract using Hardhat following our [how-to Deploy a Smart Contract guide](/isc/how-tos/EVM/deploy-a-smart-contract#hardhat). - -::: diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_remix.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_remix.md deleted file mode 100644 index 3c7b30fccc9..00000000000 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_deploy_with_remix.md +++ /dev/null @@ -1,5 +0,0 @@ -:::tip Deploy a Smart Contract with Remix - -Deploy a Solidity Smart Contract using Remix following our [how-to Deploy a Smart Contract guide](/isc/how-tos/EVM/deploy-a-smart-contract#remix). - -::: diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md new file mode 100644 index 00000000000..70abc8b0ed3 --- /dev/null +++ b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md @@ -0,0 +1,6 @@ +:::warning Decimals + +Though ShimmerEVM has 18 decimal places, Shimmer only has 6 places. This means that you may have discrepancies in the +amount of funds when retrieving an L2 balance from L1. + +::: \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md new file mode 100644 index 00000000000..41a8d1145b9 --- /dev/null +++ b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md @@ -0,0 +1,5 @@ +:::note + +If you are using EVM, you will only need to use off-ledger requests for most of your contracts. + +::: \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_partials/how-tos/token/_check_storage_deposit.md b/docs/build/isc/v1.0.0-rc.6/docs/_partials/how-tos/token/_check_storage_deposit.md index 1f2ef198b22..f3b043b7ba5 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/_partials/how-tos/token/_check_storage_deposit.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/_partials/how-tos/token/_check_storage_deposit.md @@ -1,4 +1,6 @@ -1. Check if the amount paid to the contract is the same as the required [storage deposit](/learn/protocols/stardust/core-concepts/storage-deposit) +### 1. Check the Storage Deposit + +Check if the amount paid to the contract is the same as the required [storage deposit](/learn/protocols/stardust/core-concepts/storage-deposit) and set the allowance. ```solidity diff --git a/docs/build/isc/v1.0.0-rc.6/docs/explanations/how-accounts-work.md b/docs/build/isc/v1.0.0-rc.6/docs/explanations/how-accounts-work.md index ba854a289a9..f22f38ab0cf 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/explanations/how-accounts-work.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/explanations/how-accounts-work.md @@ -78,13 +78,13 @@ The [`accounts` core contract](../reference/core-contracts/accounts.md) is respo By calling this contract, it is possible to: - [View current account balances](../how-tos/get-balance.md) -- [Deposit funds to the chain](../how-tos/EVM/send-funds-from-L1-to-L2.mdx) +- [Deposit funds to the chain](../how-tos/send-funds-from-L1-to-L2.mdx) - [Withdraw funds from the chain](../how-tos/send-assets-to-l1.mdx) ## Example The following diagram illustrates an example situation. -The the IDs and hnames are shortened for simplicity. +The IDs and hnames are shortened for simplicity. [![Example situation. Two chains are deployed, with three smart contracts and one address.](/img/tutorial/accounts.png)](/img/tutorial/accounts.png) diff --git a/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md b/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md index 2eed8ebd08e..e7cc1d50397 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md @@ -13,6 +13,7 @@ tags: - explanation --- +import OffLedgerRequests from './../_admonitions/_off-ledger-requests.md' # Calling a Smart Contract @@ -78,6 +79,8 @@ time. Due to the shorter delay, off-ledger requests are preferred over on-ledger requests unless you need to move assets between chains or Layer 1 accounts. + + --- ## Gas diff --git a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md index 90cd85bd55a..91d4e5c0cb4 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md @@ -33,7 +33,7 @@ Here are some of the most important properties and limitations of EVM support in ### Wrapped Calls to the JSON-RPC -The Wasp node provides a JSON-RPC service, the standard protocol used by Ethereum tools. Upon receiving a signed +The Wasp node provides a [JSON-RPC](../reference/json-rpc-spec.md) service, the standard protocol used by Ethereum tools. Upon receiving a signed Ethereum transaction via JSON-RPC, the transaction is wrapped into an ISC [off-ledger request](../explanations/invocation.md#off-ledger-requests). The sender of the request is the Ethereum address that signed the original transaction (e.g., the Metamask account). diff --git a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/quick-start.mdx b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/quick-start.mdx index ac353660a4f..7b4a39d0bf4 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/quick-start.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/quick-start.mdx @@ -39,7 +39,7 @@ Please read [the MetaMask section in the tools guide](tools.mdx#metamask) for a :::tip ShimmerEVM -If you want to fund your ShimmerEVM account, please refer to our [How To Get Funds guide](../how-tos/EVM/send-funds-from-L1-to-L2.mdx). +If you want to fund your ShimmerEVM account, please refer to our [How To Get Funds guide](../how-tos/send-funds-from-L1-to-L2.mdx). ::: diff --git a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/tools.mdx b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/tools.mdx index d247c6014d4..cb840237ece 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/tools.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/tools.mdx @@ -19,8 +19,7 @@ tags: import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import {AddToMetaMaskButton, EVMNetworks} from '@theme/AddToMetaMaskButton'; -import DeployWithRemix from '../_admonitions/_deploy_with_remix.md'; -import DeployWithHardhat from '../_admonitions/_deploy_with_hardhat.md'; +import DeployAdmonition from '../_admonitions/_deploy_a_smart_contract.md'; import { ChainId } from '@theme/ChainId'; # Compatible Tools @@ -97,7 +96,7 @@ the `Environment` dropdown. ![Select Injected Provider from the Environment dropdown](/img/evm/remix-injected-provider-metamask.png) - + Metamask will ask to connect to Remix, and once connected, it will set the `Environment` to `Injected Web3` with the "Custom () network" or "Custom () network". @@ -144,7 +143,7 @@ networks: { - + :::caution diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/ERC20.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/ERC20.md similarity index 92% rename from docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/ERC20.md rename to docs/build/isc/v1.0.0-rc.6/docs/how-tos/ERC20.md index 4d6893593b1..9bbd6929beb 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/ERC20.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/ERC20.md @@ -12,9 +12,9 @@ tags: - how to --- -import DeployWithRemix from '../../_admonitions/_deploy_with_remix.md'; -import PriorKnowledge from '../../_admonitions/_EVM-required-prior-knowledge.md'; -import RemixIDE from '../../_admonitions/_remix-IDE.md'; +import DeployAdmonition from '../_admonitions/_deploy_a_smart_contract.md'; +import PriorKnowledge from '../_admonitions/_EVM-required-prior-knowledge.md'; +import RemixIDE from '../_admonitions/_remix-IDE.md'; # Create ERC20 Custom Tokens @@ -66,7 +66,7 @@ You can change the token name `ExampleERC20Token` and the token symbol `EET` for ::: - + ## 2. Add Your Custom Tokens to MetaMask diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/ERC721.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/ERC721.md similarity index 94% rename from docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/ERC721.md rename to docs/build/isc/v1.0.0-rc.6/docs/how-tos/ERC721.md index 18856406052..0b66f129e59 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/ERC721.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/ERC721.md @@ -11,9 +11,9 @@ tags: - mint tokens - how to --- -import DeployWithRemix from '../../_admonitions/_deploy_with_remix.md'; -import PriorKnowledge from '../../_admonitions/_EVM-required-prior-knowledge.md'; -import RemixIDE from '../../_admonitions/_remix-IDE.md'; +import DeployAdmonition from '../_admonitions/_deploy_a_smart_contract.md'; +import PriorKnowledge from '../_admonitions/_EVM-required-prior-knowledge.md'; +import RemixIDE from '../_admonitions/_remix-IDE.md'; # Create ERC721 NFTs @@ -44,7 +44,7 @@ your smart contracts. The following is an example NFT Smart Contract called "ShimmerEVMSampleNFT". -```solidity {2,11,16,19-22} +```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; @@ -107,7 +107,7 @@ Before you can deploy this contract, you will need to set the `Initial Owner` ad ::: - + ### Mint Your Custom NFTs diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/allow.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/allow.md index 825aba9773f..edf7027f439 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/allow.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/allow.md @@ -16,13 +16,17 @@ In ISC, we have a similar concept for our native assets. You might want to use t ## Example Code -1. Create a function which allows an address or contract to access a specific ID of your account: +### 1. Create the `allow` Function + +Create a function which allows an address or contract to access a specific ID of your account: ```solidity function allow(address _address, bytes32 _allowanceNFTID) public { ``` -2. Create an `ISCAssets` object to pass as allowance: +### 2. Create the `ISCAssets` object + +Create an `ISCAssets` object to pass as allowance: ```solidity NFTID[] memory nftIDs = new NFTID[](1); @@ -31,7 +35,9 @@ ISCAssets memory assets; assets.nfts = nftIDs; ``` -3. With that asset, you can call `allow` to allow address to take our NFT: +### 3. Use the Assets as Allowance + +With that asset, you can call `allow` to allow address to take our NFT: ```solidity ISC.sandbox.allow(_address, assets); diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/take-allowance.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/take-allowance.md index 571ac909cf2..b41689fb898 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/take-allowance.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/allowance/take-allowance.md @@ -16,6 +16,8 @@ After having [allowed](./allow.md) native assets, you can take the ones you need The following example will take the NFT which was allowed in the [allow how-to guide](./allow.md). +### Create the `ISCAssets` + First, you need to recreate the `ISCAssets` with the NFTID. ```solidity @@ -25,6 +27,8 @@ ISCAssets memory assets; assets.nfts = nftIDs; ``` +### Call `takeAllowedFunds()` + After that, you can call `takeAllowedFunds()` to take the allowance of the specified address/contract ```solidity diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/create-a-basic-contract.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/create-a-basic-contract.md similarity index 82% rename from docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/create-a-basic-contract.md rename to docs/build/isc/v1.0.0-rc.6/docs/how-tos/create-a-basic-contract.md index e9ddaf22b09..f4ff7ba674f 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/create-a-basic-contract.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/create-a-basic-contract.md @@ -8,6 +8,7 @@ tags: - how to - basic contract --- +import DeployAdmonition from '../_admonitions/_deploy_a_smart_contract.md'; # Solidity Smart Contract Example @@ -43,10 +44,12 @@ contract Counter { ``` This contract simply updates a `count` variable. It has -three [entry points](../../explanations/smart-contract-anatomy.md#entry-points): +three [entry points](../explanations/smart-contract-anatomy.md#entry-points): * `increment` and `decrement`: Two full entry points that can alter - the [state](../../explanations/smart-contract-anatomy.md#state), i.e. the `count variable`. + the [state](../explanations/smart-contract-anatomy.md#state), i.e. the `count variable`. * `getCount`: A view only entry point, which simply renders the current `count` state. For more information, please visit the [official Solidity documentation](https://docs.soliditylang.org/). + + \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/deploy-a-smart-contract.mdx b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/deploy-a-smart-contract.mdx similarity index 100% rename from docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/deploy-a-smart-contract.mdx rename to docs/build/isc/v1.0.0-rc.6/docs/how-tos/deploy-a-smart-contract.mdx diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md index 37f729d421c..06367db6bef 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md @@ -7,11 +7,14 @@ tags: - EVM - how-to --- +import LayerBalanceDiff from '../_admonitions/_layer_balance_diff.md'; # Get Balance Once you have your L1 assets on L2, you might want to check their balance. This guide explains how to do so by calling the three functions `getL2BalanceBaseTokens`, `getL2BalanceNativeTokens`and `getL2NFTAmount` for the corresponding token types. + + ## Example Code 1. Get the [AgentID](../explanations/how-accounts-work.md) from the sender by calling `ISC.sandbox.getSenderAccount()`. @@ -21,15 +24,20 @@ ISCAgentID memory agentID = ISC.sandbox.getSenderAccount(); ``` 2. To get the base token balance, you can call `getL2BalanceBaseTokens` using the `agentID`. + ```solidity uint64 baseBalance = ISC.accounts.getL2BalanceBaseTokens(agentID); ``` + 3. To get the native token balance of a specific `NativeTokenID`, use `ISC.accounts.getL2BalanceNativeTokens` with the `id` and `agentID`. + ```solidity NativeTokenID memory id = NativeTokenID({ data: nativeTokenID}); uint256 nativeTokens = ISC.accounts.getL2BalanceNativeTokens(id, agentID); ``` + 4. To get the number of NFTs, use `ISC.accounts.getL2NFTAmount` with the `agentID`. + ```solidity uint256 nfts = ISC.accounts.getL2NFTAmount(agentID); ``` diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md index cc2d03c5256..3bf4b3b35e1 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md @@ -26,56 +26,6 @@ While entropy is random for each smart contract request, entropy is constant wit ::: -## Example - -```solidity -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import "@iota/iscmagic/ISC.sol"; - -contract Random { - event Int(uint256); - event Bytes(bytes); - - uint256 private _nonce; - - function getNonce() internal returns (bytes32) { - return bytes32(_nonce++); - } - - function getInt() public returns (uint256) { - bytes32 entropy = ISC.sandbox.getEntropy(); - bytes32 nonce = getNonce(); - bytes32 digest = keccak256(bytes.concat(entropy, nonce)); - - uint256 value = uint256(digest); - - emit Int(value); - return value; - } - - function getBytes(uint length) public returns (bytes memory) { - bytes32 entropy = ISC.sandbox.getEntropy(); - bytes32 nonce = getNonce(); - bytes32 digest = keccak256(bytes.concat(entropy, nonce)); - - bytes memory value = new bytes(length); - for (uint i = 0; i < length; i += 32) { - digest = keccak256(bytes.concat(digest)); - for (uint j = 0; j < 32 && i + j < length; j++) { - value[i + j] = digest[j]; - } - } - - emit Bytes(value); - return value; - } -} - -``` - ## Explanation When you want to generate multiple random values within a single request, you need to take into account that entropy is constant within a request. In this contract we use an increasing nonce in addition to the entropy, to make sure we are generating unique values: @@ -125,3 +75,53 @@ for (uint i = 0; i < length; i += 32) { } } ``` + +## Full Example Code + +```solidity +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "@iota/iscmagic/ISC.sol"; + +contract Random { + event Int(uint256); + event Bytes(bytes); + + uint256 private _nonce; + + function getNonce() internal returns (bytes32) { + return bytes32(_nonce++); + } + + function getInt() public returns (uint256) { + bytes32 entropy = ISC.sandbox.getEntropy(); + bytes32 nonce = getNonce(); + bytes32 digest = keccak256(bytes.concat(entropy, nonce)); + + uint256 value = uint256(digest); + + emit Int(value); + return value; + } + + function getBytes(uint length) public returns (bytes memory) { + bytes32 entropy = ISC.sandbox.getEntropy(); + bytes32 nonce = getNonce(); + bytes32 digest = keccak256(bytes.concat(entropy, nonce)); + + bytes memory value = new bytes(length); + for (uint i = 0; i < length; i += 32) { + digest = keccak256(bytes.concat(digest)); + for (uint j = 0; j < 32 && i + j < length; j++) { + value[i + j] = digest[j]; + } + } + + emit Bytes(value); + return value; + } +} + +``` \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/introduction.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/introduction.md index b4e2d99705c..b19f8709b64 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/introduction.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/introduction.md @@ -21,7 +21,7 @@ beginner or an experienced developer, the how-to guides offer clear and concise functionality into your projects easier. To make the most of the how-to guides in this section, identify the specific topic or functionality you want to explore. -Whether you want to [get funds on L2](EVM/send-funds-from-L1-to-L2.mdx), [add ISC specific functionality](magic.md), +Whether you want to [get funds on L2](send-funds-from-L1-to-L2.mdx), [add ISC specific functionality](magic.md), or [send funds to L1](send-assets-to-l1.mdx), you can find dedicated guides that walk you through the process. With the how-to guides in the IOTA SDK, you can overcome implementation hurdles and gain a deeper understanding diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-assets-to-l1.mdx b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-assets-to-l1.mdx index a8a5437af57..04dfdf65d21 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-assets-to-l1.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-assets-to-l1.mdx @@ -20,27 +20,6 @@ This guide will show you how to use the ISC sandbox interface to send assets fro Note that assets on L1 require a storage deposit; therefore, the number of base tokens sent to L1 should cover at least the storage deposit required to hold the assets on L1. -## Example Code - -```solidity -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import "@iota/iscmagic/ISC.sol"; - -contract L1Assets { - function withdraw(L1Address memory to) public { - ISCAssets memory allowance = ISC.sandbox.getAllowanceFrom(msg.sender); - ISC.sandbox.takeAllowedFunds(msg.sender, allowance); - - ISCSendMetadata memory metadata; - ISCSendOptions memory options; - ISC.sandbox.send(to, allowance, false, metadata, options); - } -} -``` - ## Explanation First, you will find out what assets this contract is allowed to take from the caller by calling the `ISC.sandbox.getAllowanceFrom()` function. @@ -62,3 +41,24 @@ ISCSendMetadata memory metadata; ISCSendOptions memory options; ISC.sandbox.send(to, allowance, false, metadata, options); ``` + +## Full Example Code + +```solidity +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "@iota/iscmagic/ISC.sol"; + +contract L1Assets { + function withdraw(L1Address memory to) public { + ISCAssets memory allowance = ISC.sandbox.getAllowanceFrom(msg.sender); + ISC.sandbox.takeAllowedFunds(msg.sender, allowance); + + ISCSendMetadata memory metadata; + ISCSendOptions memory options; + ISC.sandbox.send(to, allowance, false, metadata, options); + } +} +``` \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/send-funds-from-L1-to-L2.mdx b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-funds-from-L1-to-L2.mdx similarity index 97% rename from docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/send-funds-from-L1-to-L2.mdx rename to docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-funds-from-L1-to-L2.mdx index 25d9614010b..242c7b5b573 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/send-funds-from-L1-to-L2.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/send-funds-from-L1-to-L2.mdx @@ -25,7 +25,7 @@ onto L2. :::tip Testnet -If you want to fund your ShimmerEVM Testnet account using the [ShimmerEVM Toolkit](https://evm-toolkit.evm.testnet.shimmer.network/), please refer to our [Public Testnet Quickstart Guide](../../getting-started/quick-start.mdx) +If you want to fund your ShimmerEVM Testnet account using the [ShimmerEVM Toolkit](https://evm-toolkit.evm.testnet.shimmer.network/), please refer to our [Public Testnet Quickstart Guide](../getting-started/quick-start.mdx) ::: diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/test-smart-contracts.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/test-smart-contracts.md similarity index 98% rename from docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/test-smart-contracts.md rename to docs/build/isc/v1.0.0-rc.6/docs/how-tos/test-smart-contracts.md index f015c31d222..a7962a4a4d8 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/EVM/test-smart-contracts.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/test-smart-contracts.md @@ -68,8 +68,8 @@ is popular amongst other developers. :::tip Solo -If you want to test ISC-specific functionalities, like the [magic contract](../magic.md), you should use -the [Solo Framework](../../solo/getting-started.md). +If you want to test ISC-specific functionalities, like the [magic contract](magic.md), you should use +the [Solo Framework](../solo/getting-started.md). ::: diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/create-foundry.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/create-foundry.md index 5f0a86712e1..f61c6f7aaf6 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/create-foundry.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/create-foundry.md @@ -19,20 +19,24 @@ This guide will show you how to create an L1 foundry using a L2 smart contract. -2. Define the `NativeTokenScheme`: +### 2. Define the Token Scheme + +Define the `NativeTokenScheme` by specifying its `mintedTokens`, `meltedTokens` and `maximumSupply`: ```solidity - NativeTokenScheme memory nativeTokenScheme = NativeTokenScheme({ - mintedTokens: _mintedTokens, - meltedTokens: _meltedTokens, - maximumSupply: _maximumSupply - }); +NativeTokenScheme memory nativeTokenScheme = NativeTokenScheme({ + mintedTokens: _mintedTokens, + meltedTokens: _meltedTokens, + maximumSupply: _maximumSupply +}); ``` -3. Create the foundry by calling the `ISC.accounts.foundryCreateNew(nativeTokenScheme, allowance)` function: +### 3. Create the Foundry + +Create the foundry by calling the `ISC.accounts.foundryCreateNew(nativeTokenScheme, allowance)` function: ```solidity - uint32 foundrySN = ISC.accounts.foundryCreateNew(nativeTokenScheme, allowance); +uint32 foundrySN = ISC.accounts.foundryCreateNew(nativeTokenScheme, allowance); ``` ### Full Example Code diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/mint-token.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/mint-token.md index 133eb6f5b44..328f59b2327 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/mint-token.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/mint-token.md @@ -19,7 +19,9 @@ so you should execute the `ISC.accounts.mintNativeTokens` function in the same c -2. Mint the native token specifying the foundry serial number, the amount to mint and the allowance. +### 2. Mint the Native Token + +Mint the native token specifying the foundry serial number, the amount to mint and the allowance. ```solidity ISC.accounts.mintNativeTokens(_foundrySN, _amount, allowance); @@ -28,13 +30,13 @@ ISC.accounts.mintNativeTokens(_foundrySN, _amount, allowance); ## Full Example Code ```solidity - event MintedNativeTokens(uint32 foundrySN, uint amount); - - function mintNativeTokens(uint32 _foundrySN, uint _amount, uint64 _storageDeposit) public payable { - require(msg.value == _storageDeposit*(10**12), "Please send exact funds to pay for storage deposit"); - ISCAssets memory allowance; - allowance.baseTokens = _storageDeposit; - ISC.accounts.mintNativeTokens(_foundrySN, _amount, allowance); - emit MintedNativeTokens(_foundrySN, _amount); - } +event MintedNativeTokens(uint32 foundrySN, uint amount); + +function mintNativeTokens(uint32 _foundrySN, uint _amount, uint64 _storageDeposit) public payable { + require(msg.value == _storageDeposit*(10**12), "Please send exact funds to pay for storage deposit"); + ISCAssets memory allowance; + allowance.baseTokens = _storageDeposit; + ISC.accounts.mintNativeTokens(_foundrySN, _amount, allowance); + emit MintedNativeTokens(_foundrySN, _amount); +} ``` diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/register-token.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/register-token.md index ca4aea0192a..179c194cd70 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/register-token.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/token/register-token.md @@ -17,7 +17,9 @@ To properly use your native tokens, you should register them as ERC20 using the -2. Register the native tokens specifying: +### 2. Register the Native Tokens + +Register the native tokens specifying: * the foundry serial number * a name * a symbol @@ -27,7 +29,10 @@ To properly use your native tokens, you should register them as ERC20 using the ISC.sandbox.registerERC20NativeToken(_foundrySN, _name, _symbol, _decimals, allowance); ``` -3. Get the ERC20 contract address with `erc20NativeTokensAddress`: +### 3. Get the Contract's Address + +Get the ERC20 contract address with `erc20NativeTokensAddress`: + ```solidity address erc20address = ISC.sandbox.erc20NativeTokensAddress(_foundrySN); ``` diff --git a/docs/build/isc/v1.0.0-rc.6/docs/introduction.md b/docs/build/isc/v1.0.0-rc.6/docs/introduction.md index 1b5a7d3c7f5..2baa80bddaf 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/introduction.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/introduction.md @@ -12,6 +12,7 @@ tags: --- import NetworkWarning from './_admonitions/_network_warning.md' +import OffLedgerRequests from './_admonitions/_off-ledger-requests.md' # Introduction @@ -74,5 +75,8 @@ for each request, with costs charged to your on-chain account. ## On-Ledger vs Off-Ledger Requests -Requests can be on-ledger, that is, processed through -the Tangle, or off-ledger, directly sent to validators for faster processing. + + +Requests can be [on-ledger](explanations/invocation.md#on-ledger-requests), that is, processed through +the Tangle, or [off-ledger](explanations/invocation.md#off-ledger-requests), directly sent to validators for faster +processing. diff --git a/docs/build/isc/v1.0.0-rc.6/docs/reference/wasm-lib-data-types.mdx b/docs/build/isc/v1.0.0-rc.6/docs/reference/wasm-lib-data-types.mdx index a4ef1e9f49c..28789a1772d 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/reference/wasm-lib-data-types.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/reference/wasm-lib-data-types.mdx @@ -55,7 +55,7 @@ WasmLib provides its own implementations for each of the ISC value data types. ## Full Matrix of WasmLib Types -WasmLib implements a full set of [value proxies](../explanations/proxies.mdx#value-proxies) for each +WasmLib implements a full set of [value proxies](../schema/proxies.mdx#value-proxies) for each predefined value type that provide access to data on the ISC host. But there is one aspect of this data that we have not considered yet. Some data provided by the host is mutable, whereas other data may be immutable. To facilitate this distinction, each value proxy type diff --git a/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/funcdesc.mdx b/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/funcdesc.mdx index 02cb861ba5c..bb4f18ee046 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/funcdesc.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/funcdesc.mdx @@ -391,7 +391,7 @@ export class ScFuncs { ## `dividend` Example - Generated Code -In the `dividend` example in `contract.xx`, specific structs for [Funcs and Views](../../explanations/proxies.mdx) are created. +In the `dividend` example in `contract.xx`, specific structs for [Funcs and Views](../../schema/proxies.mdx) are created. Here's how they operate: ### Access diff --git a/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/state.mdx b/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/state.mdx index 1c61ed7c5c2..70252bfb4a1 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/state.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/state.mdx @@ -173,7 +173,7 @@ export class MutableDividendState extends wasmtypes.ScProxy { Examining the `state.xx`code, generated by the [Schema Tool](usage.mdx), you can find the `MutableDividendState` struct. -This interface allows type-safe access to each state variable through mutable [proxies](../../explanations/proxies.mdx), +This interface allows type-safe access to each state variable through mutable [proxies](../../schema/proxies.mdx), establishing a one-to-one relationship with the `state` section in the schema definition file. ### Proxy Interfaces diff --git a/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/typedefs.mdx b/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/typedefs.mdx index e162d586d42..2d55e859696 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/typedefs.mdx +++ b/docs/build/isc/v1.0.0-rc.6/docs/schema/how-tos/typedefs.mdx @@ -23,7 +23,7 @@ You can find the complete list of [WasmLib Data Types](../../reference/wasm-lib- ::: -The WasmLib allows of [container types](../../explanations/proxies.mdx#container-proxies), but it +The WasmLib allows of [container types](../../schema/proxies.mdx#container-proxies), but it is not possible to specify these types directly because the type name syntax only allows you to specify a single container type. diff --git a/docs/build/isc/v1.0.0-rc.6/docs/explanations/proxies.mdx b/docs/build/isc/v1.0.0-rc.6/docs/schema/proxies.mdx similarity index 100% rename from docs/build/isc/v1.0.0-rc.6/docs/explanations/proxies.mdx rename to docs/build/isc/v1.0.0-rc.6/docs/schema/proxies.mdx diff --git a/docs/build/isc/v1.0.0-rc.6/sidebars.js b/docs/build/isc/v1.0.0-rc.6/sidebars.js index 2da1ba6f545..623c829b3d0 100644 --- a/docs/build/isc/v1.0.0-rc.6/sidebars.js +++ b/docs/build/isc/v1.0.0-rc.6/sidebars.js @@ -67,11 +67,6 @@ module.exports = { label: 'Calling a Smart Contract', id: 'explanations/invocation', }, - { - type: 'doc', - label: 'Data Access Proxies', - id: 'explanations/proxies', - }, { type: 'doc', label: 'State, Transitions and State Anchoring', @@ -111,41 +106,34 @@ module.exports = { items: [ 'how-tos/introduction', { - type: 'category', - label: 'EVM', - collapsed: true, - items: [ - { - type: 'doc', - label: 'Test Smart Contracts', - id: 'how-tos/EVM/test-smart-contracts', - }, - { - type: 'doc', - label: 'Send Funds from L1 to L2', - id: 'how-tos/EVM/send-funds-from-L1-to-L2', - }, - { - type: 'doc', - label: 'Create a Basic Solidity Contract', - id: 'how-tos/EVM/create-a-basic-contract', - }, - { - type: 'doc', - label: 'Deploy a Smart Contract', - id: 'how-tos/EVM/deploy-a-smart-contract', - }, - { - type: 'doc', - label: 'Create Custom Tokens - ERC20', - id: 'how-tos/EVM/ERC20', - }, - { - type: 'doc', - label: 'Create NFTs - ERC721', - id: 'how-tos/EVM/ERC721', - }, - ], + type: 'doc', + label: 'Send Funds from L1 to L2', + id: 'how-tos/send-funds-from-L1-to-L2', + }, + { + type: 'doc', + label: 'Create a Basic Solidity Contract', + id: 'how-tos/create-a-basic-contract', + }, + { + type: 'doc', + label: 'Deploy a Smart Contract', + id: 'how-tos/deploy-a-smart-contract', + }, + { + type: 'doc', + label: 'Test Smart Contracts', + id: 'how-tos/test-smart-contracts', + }, + { + type: 'doc', + label: 'Create Custom Tokens - ERC20', + id: 'how-tos/ERC20', + }, + { + type: 'doc', + label: 'Create NFTs - ERC721', + id: 'how-tos/ERC721', }, { type: 'category', @@ -362,6 +350,11 @@ module.exports = { label: 'The Schema Tool', id: 'schema/introduction', }, + { + type: 'doc', + label: 'Data Access Proxies', + id: 'schema/proxies', + }, { type: 'category', label: 'How To', From c0a8dfd4404d4d05f6e9f07357508232330e5653 Mon Sep 17 00:00:00 2001 From: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:29:04 -0300 Subject: [PATCH 2/5] Update docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md Co-authored-by: Dr-Electron --- .../build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md index 91d4e5c0cb4..86900b0936d 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/getting-started/compatibility.md @@ -33,7 +33,7 @@ Here are some of the most important properties and limitations of EVM support in ### Wrapped Calls to the JSON-RPC -The Wasp node provides a [JSON-RPC](../reference/json-rpc-spec.md) service, the standard protocol used by Ethereum tools. Upon receiving a signed +The Wasp node provides a JSON-RPC service, the standard protocol used by Ethereum tools. We try to keep our endpoint as compatible as possible, you can find a list of supported endpoints [here](../reference/json-rpc-spec.md). Upon receiving a signed Ethereum transaction via JSON-RPC, the transaction is wrapped into an ISC [off-ledger request](../explanations/invocation.md#off-ledger-requests). The sender of the request is the Ethereum address that signed the original transaction (e.g., the Metamask account). From cb0efc524ae60846a93d952eab1e2297ae87b213 Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Tue, 27 Feb 2024 16:37:10 -0300 Subject: [PATCH 3/5] address suggestions by @dr-electron --- .../v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md | 6 ------ .../v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md | 2 +- docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md | 1 + docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md | 3 +-- 4 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md deleted file mode 100644 index 70abc8b0ed3..00000000000 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_layer_balance_diff.md +++ /dev/null @@ -1,6 +0,0 @@ -:::warning Decimals - -Though ShimmerEVM has 18 decimal places, Shimmer only has 6 places. This means that you may have discrepancies in the -amount of funds when retrieving an L2 balance from L1. - -::: \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md index 41a8d1145b9..b3944f663d0 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md @@ -1,5 +1,5 @@ :::note -If you are using EVM, you will only need to use off-ledger requests for most of your contracts. +You can only use on-ledger requests using the [Magic Contract](../reference/magic-contract.md) or [Core](../reference/core-contracts/overview.md) Contracts. ::: \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md b/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md index e7cc1d50397..855702bea75 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md @@ -81,6 +81,7 @@ between chains or Layer 1 accounts. + --- ## Gas diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md index 06367db6bef..5ddffbdb885 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-balance.md @@ -7,13 +7,11 @@ tags: - EVM - how-to --- -import LayerBalanceDiff from '../_admonitions/_layer_balance_diff.md'; # Get Balance Once you have your L1 assets on L2, you might want to check their balance. This guide explains how to do so by calling the three functions `getL2BalanceBaseTokens`, `getL2BalanceNativeTokens`and `getL2NFTAmount` for the corresponding token types. - ## Example Code @@ -73,3 +71,4 @@ contract GetBalance { } } ``` + From bff684203ee7b6612f0c46454c99d26a68764f2b Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Tue, 27 Feb 2024 16:40:02 -0300 Subject: [PATCH 4/5] address suggestions by @dr-electron --- docs/build/isc/v1.0.0-rc.6/sidebars.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/build/isc/v1.0.0-rc.6/sidebars.js b/docs/build/isc/v1.0.0-rc.6/sidebars.js index 623c829b3d0..3f952476afe 100644 --- a/docs/build/isc/v1.0.0-rc.6/sidebars.js +++ b/docs/build/isc/v1.0.0-rc.6/sidebars.js @@ -112,7 +112,7 @@ module.exports = { }, { type: 'doc', - label: 'Create a Basic Solidity Contract', + label: 'Create a Basic Contract', id: 'how-tos/create-a-basic-contract', }, { @@ -120,11 +120,6 @@ module.exports = { label: 'Deploy a Smart Contract', id: 'how-tos/deploy-a-smart-contract', }, - { - type: 'doc', - label: 'Test Smart Contracts', - id: 'how-tos/test-smart-contracts', - }, { type: 'doc', label: 'Create Custom Tokens - ERC20', @@ -135,6 +130,11 @@ module.exports = { label: 'Create NFTs - ERC721', id: 'how-tos/ERC721', }, + { + type: 'doc', + label: 'Test Smart Contracts', + id: 'how-tos/test-smart-contracts', + }, { type: 'category', label: 'Use the Magic Contract', From aae8dff81064ed23489590eb8eb4387009da6f4a Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Tue, 27 Feb 2024 22:08:03 +0100 Subject: [PATCH 5/5] Remove admonition --- .../v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md | 5 ----- docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md | 4 ---- docs/build/isc/v1.0.0-rc.6/docs/introduction.md | 3 --- 3 files changed, 12 deletions(-) delete mode 100644 docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md diff --git a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md b/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md deleted file mode 100644 index b3944f663d0..00000000000 --- a/docs/build/isc/v1.0.0-rc.6/docs/_admonitions/_off-ledger-requests.md +++ /dev/null @@ -1,5 +0,0 @@ -:::note - -You can only use on-ledger requests using the [Magic Contract](../reference/magic-contract.md) or [Core](../reference/core-contracts/overview.md) Contracts. - -::: \ No newline at end of file diff --git a/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md b/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md index 855702bea75..2eed8ebd08e 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/explanations/invocation.md @@ -13,7 +13,6 @@ tags: - explanation --- -import OffLedgerRequests from './../_admonitions/_off-ledger-requests.md' # Calling a Smart Contract @@ -79,9 +78,6 @@ time. Due to the shorter delay, off-ledger requests are preferred over on-ledger requests unless you need to move assets between chains or Layer 1 accounts. - - - --- ## Gas diff --git a/docs/build/isc/v1.0.0-rc.6/docs/introduction.md b/docs/build/isc/v1.0.0-rc.6/docs/introduction.md index 2baa80bddaf..550ef4aaa94 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/introduction.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/introduction.md @@ -12,7 +12,6 @@ tags: --- import NetworkWarning from './_admonitions/_network_warning.md' -import OffLedgerRequests from './_admonitions/_off-ledger-requests.md' # Introduction @@ -75,8 +74,6 @@ for each request, with costs charged to your on-chain account. ## On-Ledger vs Off-Ledger Requests - - Requests can be [on-ledger](explanations/invocation.md#on-ledger-requests), that is, processed through the Tangle, or [off-ledger](explanations/invocation.md#off-ledger-requests), directly sent to validators for faster processing.