diff --git a/src/config/menu.ts b/src/config/menu.ts index 571b9ab45..677abca41 100644 --- a/src/config/menu.ts +++ b/src/config/menu.ts @@ -13,13 +13,8 @@ export const MENU: MenuItems = { link: "/getting-started/overview", section: "gettingStarted", }, - { text: "Developers", link: "/developers", section: "developer" }, - { text: "Research", link: "/research", section: "research" }, - { text: "zkEVM", link: "/zkevm", section: "zkevm" }, - { - text: "Infrastructure", - link: "/infrastructure", - section: "infrastructure", - }, + { text: "Developers", link: "/developers", section: "developers" }, + { text: "Technology", link: "/technology", section: "technology" }, + { text: "Learn", link: "/learn", section: "learn" }, ], } diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index b003122de..e0af16f6c 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -2,18 +2,12 @@ export const SIDEBAR = { gettingStarted: [ { section: "Getting Started", - contents: [ - { title: "Overview", url: "getting-started/overview" }, - { - title: "Deploy Your First Contract", - url: "getting-started/deploy-your-first-contract", - }, - ], + contents: [{ title: "Overview", url: "getting-started/overview" }], }, { - section: "Pre-Alpha Testnet", + section: "Alpha Testnet", contents: [ - { title: "Introduction", url: "https://l2scan.scroll.io/" }, + // { title: "Introduction", url: "https://l2scan.scroll.io/" }, { title: "User Guide", url: "user-guide/", @@ -24,8 +18,7 @@ export const SIDEBAR = { }, { title: "Faucet", - // url: "user-guide/faucet", - url: "https://scroll.io/prealpha/faucet", + url: "user-guide/faucet", }, { title: "Bridge", @@ -35,35 +28,27 @@ export const SIDEBAR = { title: "Transfer Tokens", url: "user-guide/transfer-tokens", }, - { - title: "Swap", - url: "user-guide/swap", - }, { title: "Common Errors", url: "user-guide/common-errors", }, ], }, - { title: "Roll-up Explorer", url: "/pre-alpha/rollup-explorer" }, - { title: "L1 & L2 Block Explorer", url: "/pre-alpha/block-explorer" }, + { title: "Rollup Explorer", url: "https://scroll.io/alpha/rollupscan" }, + { title: "Alpha Block Explorer", url: "https://blockscout.scroll.io/" }, + { title: "Goerli Block Explorer", url: "https://goerli.etherscan.io/" }, ], }, { - section: "Resources", + section: "Community", contents: [ { - title: "Other stuff", - url: "getting-started/other-tutorials", + title: "Discord", + url: "https://discord.gg/scroll", }, - ], - }, - { - section: "Next Steps", - contents: [ { - title: "Something else to do", - url: "architecture-overview/architecture-overview", + title: "Community Forum", + url: "https://community.scroll.io/", }, ], }, @@ -71,29 +56,33 @@ export const SIDEBAR = { developers: [ { section: "Developers", - contents: [{ title: "Overview", url: "/" }], + contents: [ + { title: "Building on Scroll", url: "developers" }, + { title: "Developer Quickstart", url: "developers/developer-quickstart" }, + { title: "Alpha Testnet Contracts", url: "developers/alpha-testnet-contracts" }, + { title: "Integrations", url: "developers/integrations" }, + { title: "Ethereum & Alpha Testnet Differences", url: "developers/ethereum-and-alpha-testnet-differences" }, + ], }, { - section: "Section", + section: "Guides", contents: [ { - title: "Using Scroll", - url: "", + title: "Contract Deployment Tutorial", + url: "developers/guides/contract-deployment-tutorial", }, ], }, { section: "Resources", contents: [ - { title: "Getting Help", url: "resources/getting-help" }, - { - title: "Off-site Link (Doesn't work)", - url: "https://scroll.io/", - }, + { title: "Rollup Explorer", url: "https://scroll.io/alpha/rollupscan" }, + { title: "Alpha Block Explorer", url: "https://blockscout.scroll.io/" }, + { title: "Goerli Block Explorer", url: "https://goerli.etherscan.io/" }, ], }, ], - research: [ + technology: [ { section: "Overview", contents: [ @@ -123,7 +112,7 @@ export const SIDEBAR = { ], }, ], - zkevm: [ + learn: [ { section: "zkEVM", contents: [{ title: "Overview", url: "/" }], diff --git a/src/pages/developers.mdx b/src/pages/developers.mdx deleted file mode 100644 index 7e1bd0513..000000000 --- a/src/pages/developers.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: ../layouts/MainLayout.astro -section: developers -title: "Developers Landing Title" ---- - -import button from "../styles/design-system/button.module.css" - -Scroll is great. - -
- - ## Possible Card A with Icon - - Description of card A.. - - - {"Button A Text"} - - -
- -
- - ## New to Scroll and ZK Rollups? -

Text about how to get started and learn the basics.

- - {"Getting Started Button"} - -
diff --git a/src/pages/developers/alpha-testnet-contracts.md b/src/pages/developers/alpha-testnet-contracts.md new file mode 100644 index 000000000..0bedec826 --- /dev/null +++ b/src/pages/developers/alpha-testnet-contracts.md @@ -0,0 +1,67 @@ +--- +layout: ../../layouts/MainLayout.astro +section: developers +date: Last Modified +title: "Alpha Testnet Contracts" +permalink: "developers/alpha-testnet-contracts" +excerpt: "The network info and contract addresses you need to start with Scroll Alpha Testnet." +--- + +## Network Info + +| Network Name | Scroll Alpha Testnet | Goerli Testnet | +| ------------------ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| RPC URL | [https://alpha-rpc.scroll.io/l2](https://alpha-rpc.scroll.io/l2) | [https://endpoints.omniatech.io/v1/eth/goerli/public](https://endpoints.omniatech.io/v1/eth/goerli/public) | +| Chain ID | 534353 | 5 | +| Currency Symbol | ETH | ETH | +| Block Explorer URL | [https://blockscout.scroll.io](https://blockscout.scroll.io/) | [https://goerli.etherscan.io](https://goerli.etherscan.io) | + +## Scroll Contracts + +### Rollup + +- L1 Rollup: `0x3C584eC7f0f2764CC715ac3180Ae9828465E9833` + +### Bridge + +- L1 Messenger: `0x5260e38080BFe97e6C4925d9209eCc5f964373b6` +- L1 Gateway Router: `0xe5E30E7c24e4dFcb281A682562E53154C15D3332` +- L2 Messenger: `0xb75d7e84517e1504C151B270255B087Fd746D34C` +- L2 Gateway Router: `0x6d79Aa2e4Fbf80CF8543Ad97e294861853fb0649` + +### L2 Predeploys + +- Message Queue: `0x5300000000000000000000000000000000000000` +- Block Container: `0x5300000000000000000000000000000000000001` +- Gas Price Oracle: `0x5300000000000000000000000000000000000002` +- Whitelist: `0x5300000000000000000000000000000000000003` +- WETH L2: `0xa1EA0B2354F5A344110af2b6AD68e75545009a03` +- Transaction Fee Vault: `0x5300000000000000000000000000000000000005` + +## Protocols + +### Uniswap V3 + +- Frontend website: [https://uniswap-v3.scroll.io/](https://uniswap-v3.scroll.io/) +- Main Contracts + - Core Factory: `0x6E7E0d996eF50E289af9BFd93f774C566F014660` + - NFT Position Manager: `0xbd1A5920303F45d628630E88aFbAF012bA078F37` + - Router: `0xD9880690bd717189cC3Fbe7B9020F27fae7Ac76F` +- Additional Contracts + - multicall2Address: `0x2117f703867a2B7E6813c7e5Edd96bf9a8d8eC30` + - proxyAdminAddress: `0x7023D099DcAE54c3ed93B8C07bC8948150A68bb4` + - tickLensAddress: `0xf39a3f98Bc7e03cB9A8dBF8246B8C66a1A5c025F` + - nftDescriptorLibraryAddressV1_3_0: `0x9590F386eC21A221646A19ac03984683713366d7` + - nonfungibleTokenPositionDescriptorAddressV1_3_0: `0xdbb991616CE0E6a0553258bd34bC1478042C03C2` + - descriptorProxyAddress: `0x9590F386eC21A221646A19ac03984683713366d7` + - v3MigratorAddress: `0x5Db25d2b7dba65c8aA2b16465438Ec44f75b0511` + - v3StakerAddress: `0xF957376105987D25EFe7D403eA63929e0dAc9E0c` + - quoterV2Address: `0xbf1c1FE1e9e900aFd5ba2Eb67480c44266D5eD84` + +## Tokens + +> ℹ️ **Note** +> +> Bridged tokens from Goerli using the native bridge can be added to the [token-list](https://github.com/scroll-tech/token-list) repo. + +- Goerli USDC: `0x67aE69Fd63b4fc8809ADc224A9b82Be976039509` diff --git a/src/pages/developers/developer-quickstart.md b/src/pages/developers/developer-quickstart.md new file mode 100644 index 000000000..3ab6deb9b --- /dev/null +++ b/src/pages/developers/developer-quickstart.md @@ -0,0 +1,180 @@ +--- +layout: ../../layouts/MainLayout.astro +section: developers +date: Last Modified +title: "Developer Quickstart" +permalink: "developers/developer-quickstart" +--- + +With Scroll, your favorite tools for building and testing smart contracts just work. + +Since Scroll is bytecode equivalent with the EVM, you’ll just need to point your favorite builder tools at a Scroll Alpha Testnet RPC Provider. + +If you run into any issues, please reach out in [our Discord](https://discord.gg/scroll). + +## Acquiring Testnet Ether + +To start building on Scroll, you'll first need to acquire some testnet ETH. See the [Faucet](/user-guide/faucet) page for tips on getting test tokens on Goerli. After this, you can bridge your testnet ETH to the Scroll Alpha Testnet (Layer 2) using our [Bridge](/user-guide/bridge). + +For a walkthrough, start with the User Guide's [Setup](/user-guide/setup) page. + +## Network Configuration + +Use the table below for configuring your Ethereum tools to the Scroll Alpha Testnet. + +| Network Name | Scroll Alpha Testnet | Goerli test network | +| ------------------ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| RPC URL | [https://alpha-rpc.scroll.io/l2](https://alpha-rpc.scroll.io/l2) | [https://endpoints.omniatech.io/v1/eth/goerli/public](https://endpoints.omniatech.io/v1/eth/goerli/public) | +| Chain ID | 534353 | 5 | +| Currency Symbol | ETH | ETH | +| Block Explorer URL | [https://blockscout.scroll.io](https://blockscout.scroll.io/) | [https://goerli.etherscan.io](https://goerli.etherscan.io) | + +## Configure your tooling + +### Hardhat + +Modify your Hardhat config file `hardhat.config.ts` to point at the Scroll Alpha Testnet public RPC. + +```jsx +... + +const config: HardhatUserConfig = { + ... + networks: { + scrollAlpha: { + url: "https://alpha-rpc.scroll.io/l2" || "", + accounts: + process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, + }, +}; + +... +``` + +### Foundry + +To deploy using the Scroll Alpha Testnet Public RPC, run: + +`forge create ... --rpc-url=https://alpha-rpc.scroll.io/l2` + +### Remix Web IDE + +After compiling your contracts, the easiest way to deploy using Remix is by [setting up Metamask](/user-guide/setup#metamask), then selecting the **Scroll Alpha Testnet** network. + +

Metamask with the Scroll Alpha Testnet selected as Network

+ +Now, in the “Deploy and Run Transactions” tab, use the “Environment” drop down and select “Injected Provider - MetaMask.” + +

Remix using MetaMask as a Network Provider for accessing the Scroll Alpha Testnet

+ +Connect your wallet and select the Scroll Alpha Testnet. Your account should be selected automatically in Remix, and you can click “Deploy.” + +### Truffle + +Assuming you already have a truffle environment setup, go to the Truffle [configuration file](https://trufflesuite.com/docs/truffle/reference/configuration/), `truffle.js`. Make sure to have installed HDWalletProvider: `npm install @truffle/hdwallet-provider@1.4.0` + +```jsx +const HDWalletProvider = require("@truffle/hdwallet-provider") +... +module.exports = { + networks: { + scrollAlpha: { + provider: () => + new HDWalletProvider(process.env.PRIVATE_KEY, "https://alpha-rpc.scroll.io/l2"), + network_id: '*', + }, + } +} +``` + +### Brownie + +To add the Scroll Alpha Testnet, run the following command: + +```bash +brownie networks add Ethereum scrollAlpha host=https://alpha-rpc.scroll.io/l2 chainid=534353 +``` + +To set this as your default network, add the following in your project config file: + +```yaml +networks: + default: scrollAlpha +``` + +### ethers.js + +Setting up a Scroll Alpha Testnet provider in an `ethers` script: + +```jsx +import { ethers } from "ethers" + +const provider = new ethers.providers.JsonRpcProvider("https://alpha-rpc.scroll.io/l2") +``` + +### scaffold-eth + +To deploy using Scaffold-eth, you’ll need to point both your Hardhat and React settings at the Scroll Alpha Testnet. + +#### Configure Hardhat + +In the `packages/hardhat/hardhat.config.js` file, you’ll add the network and select it as the default network. + +```jsx +... +// +// Select the network you want to deploy to here: +// +const defaultNetwork = "scrollAlpha"; +... +module.exports = { +... + networks: { +... + scrollAlpha: { + url: "https://alpha-rpc.scroll.io/l2", + accounts: { + mnemonic: mnemonic(), + }, + }, + } +... +} +``` + +Be sure to fund the deployment wallet as well! Run `yarn generate` to create the wallet and `yarn account` to check its funds. Once funded, run `yarn deploy --network scrollAlpha` to deploy on the Alpha testnet. + +> ⚠️ Warning +> +> On some project forks, you'll want to disable the contract verification which relies on Etherscan. This can be commented out in `packages/hardhat/deploy/00_deploy_your_contract.js` + +#### Configure the Frontend + +To configure your frontend, you need to add the Scroll Alpha Testnet as a network option, then select it as default. + +To add the network, modify `packages/react-app/src/constants.js` . + +```jsx +... +export const NETWORKS = { +... + scrollAlpha: { + name: "scrollAlpha", + color: "#e9d0b8", + chainId: 534353, + rpcUrl: "https://alpha-rpc.scroll.io/l2", + blockExplorer: "https://blockscout.scroll.io", + }, +... +} +``` + +Next, in `packages/react-app/src/App.jsx` modify + +```jsx +... +/// 📡 What chain are your contracts deployed to? +const initialNetwork = NETWORKS.scrollAlpha; +... +``` diff --git a/src/pages/developers/ethereum-and-alpha-testnet-differences.md b/src/pages/developers/ethereum-and-alpha-testnet-differences.md new file mode 100644 index 000000000..bd149ec02 --- /dev/null +++ b/src/pages/developers/ethereum-and-alpha-testnet-differences.md @@ -0,0 +1,87 @@ +--- +layout: ../../layouts/MainLayout.astro +section: developers +date: Last Modified +title: "Ethereum & Alpha Testnet Differences" +permalink: "developers/ethereum-and-alpha-testnet-differences" +excerpt: "There are a number of technical details that differ between Ethereum mainnet's EVM and Scroll's modified design for a zkEVM. Below you can see those differences as they exist now." +--- + +There are a number of technical details that differ between Ethereum mainnet's EVM and Scroll's modified design for a zkEVM. Below you can see those differences as they exist now. + +For open-source contributors and infrastructure builders, please contact our team for additional support. + +> ℹ️ **Info** +> +> For the average Solidity developer, these details won't affect your development experience. + +## EVM Opcodes + +| Opcode | Solidity equivalent | Ethereum Behavior | Scroll Behavior | +| --------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BLOCKHASH` | `block.blockhash` |

Input: blockNumber from top of the stack, and the valid range is [NUMBER-256, NUMBER-1].

Output: hash of the given block number, or 0 if the block number is not in the valid range.

| Matches Ethereum, but limits the range of input `blockNumber` to be `NUMBER`-1. | +| `COINBASE` | `block.coinbase` | In Ethereum Clique, the eth address of the signer. | Returns the pre-deployed fee vault contract address. See [Alpha Testnet Contracts](/developers/alpha-testnet-contracts). | +| `DIFFICULTY` / `PREVRANDAO` | `block.difficulty` | After PoS, the previous block’s `randao` value. | Returns 0. | +| `SELFDESTRUCT` | `selfdestruct` | [Plans to deprecate and substitute with `SENDALL`](https://eips.ethereum.org/EIPS/eip-4758) |

Disabled in the sequencer. Runtime error, same behavior as the INVALID opcode.
Will change to adopt Ethereum’s solution in the future.

| + +## State Account + +### **Additional Fields** + +We added two fields in the current `StateAccount` object: `PoseidonCodehash` and `CodeSize`. + +```go +type StateAccount struct { + Nonce uint64 + Balance *big.Int + Root common.Hash // merkle root of the storage trie + KeccakCodeHash []byte // still the Keccak codehash + // added fields + PoseidonCodeHash []byte // the Poseidon codehash + CodeSize uint64 +} +``` + +### **CodeHash** + +Related to this, we maintain two types of codehash for each contract bytecode: Keccak hash and Poseidon hash. + +`KeccakCodeHash` is kept to maintain compatibility for `EXTCODEHASH`. `PoseidonCodeHash` is used for verifying correctness of bytecodes loaded in the zkEVM, where Poseidon hashing is far more efficient. + +### CodeSize + +When verifying `EXTCODESIZE`, it is expensive to load the whole contract data into the zkEVM. Instead, we store the contract size in storage during contract creation. This way, we do not need to load the code — a storage proof is sufficient to verify this opcode. + +## Block Time + +The Alpha Testnet aims for a constant block time of 3 seconds. This is shorter and more consistent than the 12 seconds used in the Ethereum under ideal conditions. + +This was chosen for two reasons: + +- Having faster, constant block time results in quicker feedback and a better user experience. +- As we optimize the zkEVM circuits in our testnets, even if we maintain a smaller gas limit per block or batch, we can still reach higher throughput than Ethereum. + +## Future EIPs + +We keep a close on eye on all emerging EIPs adopted by Ethereum and adopt them when suitable. If you’re interested in more specifics, reach out in [our community forum](https://community.scroll.io) or on the [Scroll Discord](https://discord.gg/scroll). + +## Address Aliasing + +#### Rationale behind address aliasing + +Because of how the `CREATE` opcode functions, it is possible to create contracts that share the same address but different bytecode on different networks. + +This breaks some trust assumptions since a contract that looks trustworthy on the L2 may have a malicious counterpart on the L1. + +To prevent this the value of the `msg.sender` and `tx.origin` can vary depending on how some contract was called. (From the L2 directly or through the bridge) + +If a contract is called **from a contract on the L2** or **from an EOA** the functionality stays **the same as on Ethereum**. + +- The value of `msg.sender` and the value of tx.origin will be the same at the top level of the transaction (The first contract that's called in the chain of calls) +- The value of `tx.origin` is going to be the address of the caller + +If a contract is called **from a smart contract on the L1 through the bridge**, this is treated differently. + +- The value of `tx.origin` is going to be calculated in the next manner: + - `tx.origin = L1ContractAddress + offset` + - Where `offset=0x1111000000000000000000000000000000001111` diff --git a/src/pages/developers/guides/contract-deployment-tutorial.md b/src/pages/developers/guides/contract-deployment-tutorial.md new file mode 100644 index 000000000..2f726d97b --- /dev/null +++ b/src/pages/developers/guides/contract-deployment-tutorial.md @@ -0,0 +1,84 @@ +--- +layout: ../../../layouts/MainLayout.astro +section: developers +date: Last Modified +title: "Contract Deployment Tutorial" +permalink: "developers/guides/contract-deployment-tutorial" +excerpt: "Our Alpha Testnet allows the community to deploy smart contracts on Scroll. In this tutorial, we will teach you how to deploy a contract on the Scroll Testnet." +--- + +Our Alpha Testnet allows the community to deploy smart contracts on Scroll. In this tutorial, we will teach you how to deploy a contract on the Scroll Testnet. This [demo repo](https://github.com/scroll-tech/scroll-contract-deploy-demo) illustrates contract deployment with [Hardhat](https://hardhat.org/) and [Foundry](https://github.com/foundry-rs/foundry). + +> ℹ️ **Note** +> +> Before you start deploying the contract, you need to request test tokens from a Goerli faucet and use the [bridge](https://scroll.io/alpha/bridge) to transfer some test ETH from _Goerli_ to _Scroll Alpha_. + +### Deploy contracts with Hardhat + +1. If you haven't already, install [nodejs](https://nodejs.org/en/download/) and [yarn](https://classic.yarnpkg.com/lang/en/docs/install). +2. Clone the repo and install dependencies + +```shell +git clone https://github.com/scroll-tech/scroll-contract-deploy-demo.git +cd scroll-contract-deploy-demo +yarn install +``` + +3\. Create a `.env` file following the example `.env.example` in the root directory. Change `PRIVATE_KEY` to your own account private key in the `.env`. + +4\. Run `yarn compile` to compile the contract. + +5\. Run `yarn deploy:scrollTestnet` to deploy the contract on the Scroll Alpha Testnet. + +6\. Run `yarn test` for hardhat tests. + +### Deploy contracts with Foundry + +1. Clone the repo. + +```shell +git clone https://github.com/scroll-tech/scroll-contract-deploy-demo.git +cd scroll-contract-deploy-demo +``` + +2\. Install Foundry. + +```shell +curl -L https://foundry.paradigm.xyz | bash +foundryup +``` + +3\. Run `forge build` to build the project. + +4\. Deploy your contract with Foundry + +```bash +forge create --rpc-url https://alpha-rpc.scroll.io/l2 \ + --value \ + --constructor-args \ + --private-key \ + --legacy \ + contracts/Lock.sol:Lock +``` + +- `` is the amount of test `ETH` to be locked in the contract. Try setting this to some small amount, like `0.0000001ether`. +- `` is the Unix timestamp after which the funds locked in the contract will become available for withdrawal. Try setting this to some Unix timestamp in the future, like `1696118400` (this Unix timestamp corresponds to October 1, 2023). + +For example: + +```bash +forge create --rpc-url https://alpha-rpc.scroll.io/l2 \ + --value 0.00000000002ether \ + --constructor-args 1696118400 \ + --private-key 0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 \ + --legacy contracts/Lock.sol:Lock +``` + +### Questions and Feedback + +Thank you for participating in and developing on the Scroll Alpha Testnet. If you encounter any issues, join our [Discord](https://discord.gg/scroll) and ask us in the `developers` channel. + +#### Developer Notes + +1. The `SELFDESTRUCT` opcode is disabled and will not be supported in Scroll, as it is slated to be removed from the EVM at a later date. +2. For now, we have set Layer 2 gas prices to be the same as on Ethereum Layer 1. However, these gas prices are subject to change and will be set in the future to match proving costs. We will endeavor to minimize these changes, primarily applying them to ZK-unfriendly precompiles when necessary for security. diff --git a/src/pages/developers/index.mdx b/src/pages/developers/index.mdx new file mode 100644 index 000000000..9c57b85bd --- /dev/null +++ b/src/pages/developers/index.mdx @@ -0,0 +1,61 @@ +--- +layout: ../../layouts/MainLayout.astro +section: developers +date: Last Modified +title: "Building on Scroll" +permalink: "developers/" +excerpt: "Building on Scroll feels just like Ethereum and you can bring your favorite tooling and contracts with you." +whatsnext: { "Developer Quickstart": "/developers/developer-quickstart" } +--- + +Welcome to the Scroll developer documentation! + +Scroll is its own Layer 2 network built on Ethereum (more specifically, a “zero-knowledge rollup”). + +If you’re experienced in building on Ethereum, your code, dependencies, and tooling work with Scroll out of the box. This is possible because our network is compatible with EVM bytecode and designed to feel just like developing on Ethereum. + +> **New to zero-knowledge rollups?** +> +> Scroll gains its security and speed by executing transactions off-chain, and also producing a cryptographic proof that the transactions were executed correctly. This cryptographic proof is verified in a smart contract on Layer 1, ensuring that all code executed on the Scroll Layer 2 behaves just as if it were executed on Ethereum Layer 1. +> +> [Learn more about Scroll’s architecture →](https://scroll.io/blog/architecture) + +In our latest Alpha Testnet release, the Scroll rollup builds on Ethereum's Goerli Testnet. + +## Getting Started + +**Looking to build on the Scroll Alpha Testnet?** + +- For the essentials: Check out the [Developer Quickstart](/developers/developer-quickstart) +- For a tutorial walking through deploying your first smart contract on Scroll, read our [contract deployment tutorial](/developers/guides/contract-deployment-tutorial) +- We also have a number of [integrations](/developers/integrations) and [deployed contract addresses](/developers/alpha-testnet-contracts) to build on. + +## Why Build on Scroll? + +#### Throughput — Scroll creates more secure blockspace for Ethereum. + +ZK Rollups allow for more activity on the network, minimizing congestion. By inheriting the security of Ethereum, which verifies the behavior of the network using zero-knowledge proofs, Scroll can process more transactions without compromising on decentralization. + +#### Cost — Scroll saves users gas fees. + +On Ethereum, competition for blockspace results in higher costs per transaction, as each transaction makes a bid to be included in the next block. Scroll leverages recent breakthroughs in zero-knowledge proofs and hardware acceleration to vastly increase secure blockspace and minimize transaction costs for users. + +#### Speed — Scroll delivers feedback to users, faster. + +After the merge, Ethereum blocks reliably confirm every 12 seconds. Scroll blocks are minted every 3 seconds, and for the sake of lower-risk operations, transactions can be assumed to be final once included in a block. This opens up new possibilities for on-chain interaction in social and gaming applications. + +#### Alignment — Scroll builds on Ethereum’s vision. + +Scroll builds on Ethereum’s vision. Our ethos is to build Ethereum, not to splinter it. Decentralization, permissionlessness, censorship-resistance, and community ownership are the core of what we do and the roadmap we’re building. We believe in open-source software, and we work closely with the Ethereum Foundation’s Privacy and Scaling Explorations team to support their work on a zkEVM that might someday be the heart of Ethereum. + +We also work with governance DAOs and other open-source protocols to make sure that as applications are deployed, we’re working to grow their impact — whether that be in public goods, core infrastructure, or the next generation of zero-knowledge use cases. + +#### Community — Scroll brings together users and builders. + +We know the challenges of building in the open and getting user engagement before mainnet release! Scroll has a blossoming community of users and builders, and with a Discord community of over 100,000 users eager to try out applications on our testnet, we’re excited to connect builders with users that can provide real-world feedback. + +## Thank you for building with us. + +We’re working to bring more integrations and support infrastructure to the network, and are excitedly working towards our Mainnet release. + +Join our growing developer community. You can find us on [Discord](https://discord.gg/scroll), join our [discussion forum](https://community.scroll.io/), or follow our progress on [Twitter](https://twitter.com/Scroll_ZKP). diff --git a/src/pages/developers/integrations.md b/src/pages/developers/integrations.md new file mode 100644 index 000000000..1e579ac7f --- /dev/null +++ b/src/pages/developers/integrations.md @@ -0,0 +1,63 @@ +--- +layout: ../../layouts/MainLayout.astro +section: developers +date: Last Modified +title: "" +permalink: "developers/integrations" +excerpt: "Lots of projects have already deployed support for Scroll’s Alpha Testnet. If you’re looking for infrastructure to build on or projects to collaborate with, these are already live, with many more coming on our Goerli release!" +--- + +# Integrations + +Lots of projects have already deployed support for Scroll’s Alpha Testnet. If you’re looking for infrastructure to build on or projects to collaborate with, these are already live, with many more coming on our Goerli release! + +> ℹ️ **Note** +> +> Some of these projects may not have updated their integrations from our Pre-Alpha network. + +### RPC Providers + +- [Unifra](https://unifra.io/) +- [BlockPI](https://blockpi.io/) +- [Blast API](https://blastapi.io/public-api/scroll) + +### Indexers + +- [Covalent](https://www.covalenthq.com/) +- [Transpose](https://www.transpose.io/) + +### Wallets + +- [Keystone](https://keyst.one/) +- [BlockWallet](https://blockwallet.io/) +- [Ledger](https://www.ledger.com/) +- [MPC Vault](https://mpcvault.com/) +- [SoulWallet](https://www.soulwallets.me/) +- [Open Block](https://openblock.com/) +- [Unipass](https://unipass.id/) + +### Identity + +- [zCloak](https://zcloak.network/) + +### Ecosystem + +- [Questbook](https://www.questbook.app/) + +### Infra + +- [Empiric](https://empiric.network/) +- [Unifra](https://unifra.io/) + +### Social + +- [Lens](https://www.lens.xyz/) +- [Atem](https://www.atem.io/) + +### Defi + +- [Loanshark](https://loanshark.tech/) + +### Oracle + +- [Redstone](https://redstone.finance/) diff --git a/src/pages/infrastructure.mdx b/src/pages/infrastructure.mdx deleted file mode 100644 index 8f8f5bd3e..000000000 --- a/src/pages/infrastructure.mdx +++ /dev/null @@ -1,119 +0,0 @@ ---- -layout: ../layouts/MainLayout.astro -section: infrastructure -title: Infra page Title ---- - -import button from "../styles/design-system/button.module.css" -import styles from "@features/landing/styles/EthereumLandingPage.module.css" - -Operating a Chainlink node allows you to be part of the Chainlink Network, helping developers build hybrid smart contracts, giving them access to real-world data and services. - -Learn more about Chainlink nodes with our step‑by‑step tutorials and documentation: - -
-
- -

Set Up a Chainlink Node

-

- Install and Run your own node on a local machine or remote server. -

- - {"Learn More"} - Right arrow - - -
-
-
- -

Fulfill Your First Job Request

-

- Deploy an Oracle contract and make job requests to your node. -

- - {"Learn More"} - Right arrow - -
- -
-
- -

Add External Adapters to Your Node

-

- Bring high-quality data and premium web APIs to contract developers. -

- - {"Learn More"} - Right arrow - - -
-
- -
-
-
- -
-

New to Chainlink and Smart Contracts?

-

Learn the basics in the Getting Started Guide. Build your first smart contract on Ethereum.

- - {"Getting Started Guide"} - -
-
- - diff --git a/src/pages/research.mdx b/src/pages/learn/index.mdx similarity index 80% rename from src/pages/research.mdx rename to src/pages/learn/index.mdx index db06ad061..6dd472ea1 100644 --- a/src/pages/research.mdx +++ b/src/pages/learn/index.mdx @@ -1,12 +1,12 @@ --- -layout: ../layouts/MainLayout.astro -section: research -title: "Research Landing Title" +layout: ../../layouts/MainLayout.astro +section: learn +title: "Learn Landing Title" isMdx: true --- -import ClickToZoom from "../components/ClickToZoom.astro" -import priceAggr from "../assets/images/contract-devs/price-aggr.png" +import ClickToZoom from "../../components/ClickToZoom.astro" +import priceAggr from "../../assets/images/contract-devs/price-aggr.png" Content for the Research landing page. for fancy stuff, see the infrastructure page. diff --git a/src/pages/technology/index.mdx b/src/pages/technology/index.mdx new file mode 100644 index 000000000..0a49ff4fa --- /dev/null +++ b/src/pages/technology/index.mdx @@ -0,0 +1,7 @@ +--- +layout: ../../layouts/MainLayout.astro +section: technology +title: "Technology Landing Page" +--- + +Content for the Technolgoy section landing page. for fancy stuff, see the infrastructure page. diff --git a/src/pages/template.md b/src/pages/template.md new file mode 100644 index 000000000..fc941ccc2 --- /dev/null +++ b/src/pages/template.md @@ -0,0 +1,14 @@ +--- +layout: ../layouts/MainLayout.astro +section: gettingStarted-developers-technology-learn +date: Last Modified +title: "" +permalink: "section/page" +excerpt: "" +whatsnext: { "Link Text": "/section/pagePermalink" } +metadata: + title: "" + description: "" + image: + 0: "/files/fileInPublicFolder.png" +--- diff --git a/src/pages/user-guide/bridge.mdx b/src/pages/user-guide/bridge.mdx index 5dc7c57ac..d64c6b213 100644 --- a/src/pages/user-guide/bridge.mdx +++ b/src/pages/user-guide/bridge.mdx @@ -4,68 +4,91 @@ section: gettingStarted date: Last Modified title: "Bridge" permalink: "user-guide/bridge/" +excerpt: "To start bridging assets from Goerli, navigate to the Bridge app." --- -import bridgeTransactions from "./images/JyubYls.png" -import transactionDetails from "./images/VCIjf52.png" -import transactionDetailsWithdraw from "./images/spaces_N0h75.webp" +import ClickToZoom from "../../components/ClickToZoom.astro" +import bridge1 from "./images/bridge1.png" +import bridge2 from "./images/bridge2.png" +import bridge3 from "./images/bridge3.png" +import bridge4 from "./images/bridge4.png" +import bridge5 from "./images/bridge5.png" +import bridge6 from "./images/bridge6.png" +import bridge7 from "./images/bridge7.png" +import bridge8 from "./images/bridge8.png" -Click the `Bridge`` button in the navigation bar to open the Bridge app, which is based on [Hop Exchange]('https://hop.exchange/') UI. The Bridge supports **Deposit** and **Withdraw** operations. +Click the `Bridge`` button in the navigation bar to open [the Bridge app](https://scroll.io/alpha/bridge), which is based on [Hop Exchange]('https://hop.exchange/') UI. The Bridge supports **Deposit** and **Withdraw** operations. -## Deposit from Scroll L1 to Scroll L2 +## Deposit from Goerli to Scroll -### Instructions +#### Instructions -1. First, switch to the **Scroll L1** network in your wallet. -1. In the bridge app, ensure that **Scroll L1** is on top and **Scroll L2** is on the bottom. You can click the "**↓**" button to switch the positions. -1. Select the token (`TSETH` or `TSUSDC`) that you want to transfer from Scroll L1 to Scroll L2. -1. If this is your first time transferring TSUSDC token, you need to **Approve** the Scroll L1 Bridge contract to access your TSUSDC token. -1. Next, click the **Send** button to make the deposit. Your wallet will pop up a window asking for confirmation of the transfer transaction. -1. Once the transfer transaction is sent and confirmed, the token will be deducted from your Scroll L1 wallet. +1. First, switch to the **Goerli** network in your wallet. +2. In the bridge app, ensure that **Goerli** is on top and **Scroll Alpha** is on the bottom. You can click the "**↓**" button to switch the positions. +3. Select the token that you want to transfer from Goerli to Scroll Alpha. +4. If this is your first time transferring an ERC20 token, you need to **Approve** the Goerli Bridge contract to access your ERC20 token. +5. Next, click the **Send** button to make the deposit. Your wallet will pop up a window asking for confirmation of the transfer transaction. +6. Once the transfer transaction is sent and confirmed, the token will be deducted from your Goerli wallet. -### When will the token arrive in your Scroll L2 wallet? +#### When will the token arrive in your Scroll Alpha wallet? -It takes about **2 minutes** (6 block confirmations on Scroll L1) before the token shows up in your Scroll L2 wallet. You can check the progress of deposit transactions as follows: +It could take between **8 to 14 minutes** (awaiting block to become [_Safe_](https://www.alchemy.com/overviews/ethereum-commitment-levels#what-are-ethereum-commitment-levels) on Goerli) before the token shows up in your Scroll Alpha wallet. You can check the progress of deposit transactions as follows: -1. Click your wallet address at the top-right corner of the Bridge web app. The pop-up panel lists the most recent 3 transactions that you made in the Bridge app (see the image below). +1. Click your wallet address at the top-right corner of the Bridge web app. - A preview of the Bridge UI showing recent transactions. + -1. Click the transaction hash of the recent deposit. It will open the _Transaction Details_ page in a new tab. You can find the block number containing this transaction. +The pop-up panel lists the most recent transactions that you made in the Bridge app (see the image below). There are two statuses: L1 status and L2 status. For deposit transactions (L1 -> L2), once your transaction becomes _Safe_ on Goerli (**8 to 14 minutes**), you will see the **`success`** status shown. Your funds will be relayed to L2 after this. - Viewing the transaction details and block number of bridging an asset. +2. Click on the most recent transaction’s Goerli transaction hash: -1. You can then check the latest block height in the [Scroll L1 Block Explorer]('https://l1scan.scroll.io/'). If the difference between the latest block height and the block number in Step 2 is greater than 6, the deposited token should be funded in your Scroll L2 wallet. + -## Withdraw from Scroll L2 to Scroll L1 +It will open the Transaction Details page in a new tab. You can see this transaction is confirmed on Goerli. -### Instructions + -1. First, switch to the Scroll L2 network in your wallet. -1. In the bridge app, make sure that Scroll L2 is on top, and Scroll L1 is on the bottom. You can click the "↓" button to switch the positions. -1. Select the token (TSETH or TSUSDC) that you want to transfer from Scroll L2 to Scroll L1. -1. If this is your first time transferring TSUSDC token, you need to Approve the L2 Bridge contract to access your TSUSDC token. -1. Next, click the Send button to make the withdrawal. Your wallet will pop up a window asking for confirmation of the transfer transaction. -1. Once the transfer transaction is sent and confirmed, the token will be deducted from your Scroll L2 wallet. +3. Go back to the [Bridge](https://scroll.io/alpha/bridge) app. Once your transaction status shows **`success`** on L2, you should see the funds in your Scroll L2 wallet and a transaction hash: -### When will the token arrive in your Scroll L1 wallet? + -The transferred token will arrive in your Scroll L1 wallet after the Scroll L2 block containing this withdrawal transaction is Finalized. On our Pre-Alpha Testnet, it will take tens of minutes to a few hours for a Scroll L2 block to be finalized, but we expect this time to be significantly lower on Mainnet. +## Withdraw from Scroll to Goerli -> The rollup status `Finalized` indicates that the correct execution of transactions in this block has been proven by verifying -> a validity proof on-chain on Scroll L1. For more information about rollup status, see [Scroll's Architecture Overview]('https://scroll.mirror.xyz/nDAbJbSIJdQIWqp9kn8J0MVS4s6pYBwHmK7keidQs-k'). +#### Instructions + +1. First, switch to the **Scroll L2** network in your wallet. +2. In the bridge app, make sure that **Scroll L2** is on top, and **Goerli** is on the bottom. You can click the "**↓**" button to switch the positions. +3. Select the token (`ETH`) that you want to transfer from Scroll L2 to **Goerli**. +4. If this is your first time transferring an ERC20 token, you need to **Approve** the L2 Bridge contract to access your ERC20 token. +5. Next, click the **Send** button to make the withdrawal. Your wallet will pop up a window asking for confirmation of the transfer transaction. +6. Once the transfer transaction is sent and confirmed, the token will be deducted from your Scroll L2 wallet. + +#### When will the token arrive in your Goerli wallet? + +The transferred token will arrive in your Goerli wallet after the Scroll L2 block containing this withdrawal transaction is **`Finalized`**. On the Alpha Testnet, it will take tens of minutes to a few hours for a Scroll L2 block to be finalized, but we expect this time to be significantly lower on Mainnet. + +> ℹ️ Info +> +> The rollup status `Finalized` indicates that the correct execution of transactions in this block has been proven by verifying a validity proof on-chain on Goerli. For more information about rollup status, see [Scroll's Architecture Overview](https://scroll.mirror.xyz/nDAbJbSIJdQIWqp9kn8J0MVS4s6pYBwHmK7keidQs-k). You can check the progress of withdrawal transactions as follows: -1. Click your wallet address at the top-right corner of the Bridge web app. The pop-up panel lists the most recent 3 transactions you made in the Bridge app (see the image below). +1\. Click your wallet address at the top-right corner of the Bridge web app. + + + +The pop-up panel lists the most recent transactions you made in the Bridge app (see the image below). There are two statuses: L1 status and L2 status. In this case, because we are bridging from L2 -> L1, we will quickly get a **`success`** status after submitting the transaction to the L2 Bridge. L1, on the other hand, takes **10 minutes to a few hours** to reach **`success`**. + +2\. Click on the most recent transaction’s L2 transaction hash: + + + +It will open the _Transaction Details_ page in a new tab. You can see this transaction is confirmed on L2. - A preview of the Bridge UI showing recent transactions. + -1. Click the transaction hash of the recent withdrawal. It will open the Transaction Details page in a new tab. You can find the block number containing this transaction. +The transaction is confirmed on L2, but still needs to be finalized on Goerli. - Viewing the transaction details and block number of a widthdrawn asset. +3\. Go back to the [Bridge](https://scroll.io/alpha/bridge) app. It takes about 10 minutes before the token shows up in your Goerli wallet. Once your transaction status shows success on L2, you should see the funds in your Goerli wallet and a transaction hash: -1. Open the [Rollup Explorer]('https://scroll.io/prealpha/rollupscan') and check the rollup status of the corresponding block. If the block is finalized, the transferred token should be funded in your Scroll L1 wallet. + diff --git a/src/pages/user-guide/common-errors.md b/src/pages/user-guide/common-errors.md index e0fabd082..7f484eca2 100644 --- a/src/pages/user-guide/common-errors.md +++ b/src/pages/user-guide/common-errors.md @@ -2,8 +2,38 @@ layout: ../../layouts/MainLayout.astro section: gettingStarted date: Last Modified -title: "Swap" -permalink: "user-guide/swap/" +title: "Common Errors" +permalink: "user-guide/common-errors/" +excerpt: "Seeing an error when trying to interact with Scroll Alpha Testnet? Here are some common configuration errors and how to quickly fix them." --- -Click the Swap button in the navigation bar to open the Swap app. +## Incorrect nonce error when sending a transaction in MetaMask + +You will encounter this error when the local nonce stored in your MetaMask wallet is different from the nonce in the Scroll testnet node. It could be because there is a recent pending transaction, or the network was reset for bug fixes and feature releases. Although we aim to minimize this, we may reset the network in this Alpha phase to enable rapid development. We will notify users in advance before resetting the network. + +To fix this issue, you need to reset your account in MetaMask for the Scroll Alpha Testnet. The steps to reset the account are: + +1. Open the **MetaMask** extension in the browser +2. Select **Scroll Alpha Testnet** in the top area +3. Click the round **account icon** in the top-right corner +4. Select **Settings** +5. Go to **Advanced** +6. Click **Reset account** + +You will not lose any assets during the MetaMask account reset. + +_Note: Removing and re-adding a network is NOT enough to fix this - you must reset your account._ + +## Nothing happens when confirming a bridging/swapping transaction + +If no error or console logs appear, this is likely due to a nonce issue, please reset your MetaMask account as outlined above at [#incorrect-nonce-error-when-sending-a-transaction-in-metamask](#incorrect-nonce-error-when-sending-a-transaction-in-metamask). + +## Block Explorer shows "Internal server error" + +Use an incognito window, or open your browser developer console and remove the `_explorer_key` cookie (or all cookies). [See this guide for how to remove cookies.](https://www.contentstack.com/docs/developers/how-to-guides/clear-caches-and-cookies-in-different-browsers/). + +## Sending max amount of Ether in MetaMask results in a "Failed" error + +When sending Ether using MetaMask, if you try sending the "Max" amount, it's going to result in a "Failed" error. This is because MetaMask doesn't account for the additional "L1 Fee" that rollups have on top of regular gas fees and falls short for a small amount needed to pay for the gas of the transaction. + +To solve this, manually lower the amount of ether to be a little smaller than suggested and the transaction will go through. diff --git a/src/pages/user-guide/faucet.md b/src/pages/user-guide/faucet.md index e0fabd082..2ea822b7c 100644 --- a/src/pages/user-guide/faucet.md +++ b/src/pages/user-guide/faucet.md @@ -2,8 +2,20 @@ layout: ../../layouts/MainLayout.astro section: gettingStarted date: Last Modified -title: "Swap" -permalink: "user-guide/swap/" +title: "Faucet" +permalink: "user-guide/faucet/" +whatsnext: { "Bridge your ETH to Scroll Alpha": "/user-guide/bridge" } +excerpt: "To interact with our testnet, you first need to acquire Goerli ETH. There are a few Goerli faucet apps to get you started." --- -Click the Swap button in the navigation bar to open the Swap app. +To interact with our testnet, you first need to receive testnet ETH on _Goerli._ Then you may bridge from **Goerli Testnet** to **Scroll Alpha Testnet.** Here are a few Goerli faucet apps: + +- [https://goerlifaucet.com](https://goerlifaucet.com/) +- [https://goerli-faucet.pk910.de](https://goerli-faucet.pk910.de/) +- [https://faucet.paradigm.xyz](https://faucet.paradigm.xyz/) + +Once you receive ETH on Goerli, you should see it in your wallet on the **Goerli Network**. It may take a few seconds for them to appear, but you can check the status by looking for a transaction to your address on any [Goerli Block Explorer](https://goerli.etherscan.io/). + +> ℹ️ **Note** +> +> You can only request test tokens once every 24 hours. diff --git a/src/pages/user-guide/images/JyubYls.png b/src/pages/user-guide/images/JyubYls.png deleted file mode 100644 index a9e3cb004..000000000 Binary files a/src/pages/user-guide/images/JyubYls.png and /dev/null differ diff --git a/src/pages/user-guide/images/VCIjf52.png b/src/pages/user-guide/images/VCIjf52.png deleted file mode 100644 index 15ca7fb3b..000000000 Binary files a/src/pages/user-guide/images/VCIjf52.png and /dev/null differ diff --git a/src/pages/user-guide/images/bridge1.png b/src/pages/user-guide/images/bridge1.png new file mode 100644 index 000000000..dd552310e Binary files /dev/null and b/src/pages/user-guide/images/bridge1.png differ diff --git a/src/pages/user-guide/images/bridge2.png b/src/pages/user-guide/images/bridge2.png new file mode 100644 index 000000000..e3fe4701f Binary files /dev/null and b/src/pages/user-guide/images/bridge2.png differ diff --git a/src/pages/user-guide/images/bridge3.png b/src/pages/user-guide/images/bridge3.png new file mode 100644 index 000000000..03772fee9 Binary files /dev/null and b/src/pages/user-guide/images/bridge3.png differ diff --git a/src/pages/user-guide/images/bridge4.png b/src/pages/user-guide/images/bridge4.png new file mode 100644 index 000000000..a060b2ce3 Binary files /dev/null and b/src/pages/user-guide/images/bridge4.png differ diff --git a/src/pages/user-guide/images/bridge5.png b/src/pages/user-guide/images/bridge5.png new file mode 100644 index 000000000..7e75aeb4d Binary files /dev/null and b/src/pages/user-guide/images/bridge5.png differ diff --git a/src/pages/user-guide/images/bridge6.png b/src/pages/user-guide/images/bridge6.png new file mode 100644 index 000000000..80066a330 Binary files /dev/null and b/src/pages/user-guide/images/bridge6.png differ diff --git a/src/pages/user-guide/images/bridge7.png b/src/pages/user-guide/images/bridge7.png new file mode 100644 index 000000000..66ee3ff94 Binary files /dev/null and b/src/pages/user-guide/images/bridge7.png differ diff --git a/src/pages/user-guide/images/bridge8.png b/src/pages/user-guide/images/bridge8.png new file mode 100644 index 000000000..4b78a8b9e Binary files /dev/null and b/src/pages/user-guide/images/bridge8.png differ diff --git a/src/pages/user-guide/images/spaces_N0h75.webp b/src/pages/user-guide/images/spaces_N0h75.webp deleted file mode 100644 index 05f9396bb..000000000 Binary files a/src/pages/user-guide/images/spaces_N0h75.webp and /dev/null differ diff --git a/src/pages/user-guide/index.md b/src/pages/user-guide/index.md index cdb6a274e..bf038c8c1 100644 --- a/src/pages/user-guide/index.md +++ b/src/pages/user-guide/index.md @@ -2,176 +2,32 @@ layout: ../../layouts/MainLayout.astro section: gettingStarted date: Last Modified -title: "Pre-Alpha Testnet Guide" +title: "Alpha Testnet User Guide" permalink: "user-guide/" -excerpt: "index page in userguide" -whatsnext: { "Whats Next A": "/", "Whats Next B": "/" } -metadata: - title: "Conceptual Overview" - description: "Learn the basic concepts about what smart contracts are and, how to write them, and how Chainlink oracles work with smart contracts." - image: - 0: "/files/1a63254-link.png" +excerpt: "Thank you for testing out our Alpha Testnet. The Alpha Testnet consists of Ethereum's Goerli Testnet and the Scroll Alpha test network." +whatsnext: { "Set Up Your Wallet": "/user-guide/setup" } --- -Welcome to the Smart Contract Getting Started guide. This overview explains the basic concepts of smart contract development and oracle networks. +### Welcome to Scroll's Alpha Testnet! -**Skip ahead:** -To get your hands on the code right away, you can skip this overview: +Thank you for testing out our Alpha Testnet. If you have questions or want to give feedback, join our [Discord](https://discord.gg/scroll)! -- [Deploy Your First Smart Contract](/getting-started/deploy-your-first-contract/): If you are new to smart contracts, deploy your first smart contract in an interactive web development environment. -- [Learn how to use Data Feeds](/getting-started/consuming-data-feeds/): If you are already familiar with smart contracts and want to learn how to create _hybrid_ smart contracts, use Chainlink Data Feeds to get asset price data on-chain. +The Alpha Testnet consists of _Ethereum's Goerli Testnet_ and the _Scroll Alpha_ test network. Goerli is an Ethereum test network with PoS-based consensus, while Scroll Alpha is a zero-knowledge rollup testnet deployed on top of the former. There are some pre-deployed demo applications: a bridge between _Goerli_ and _Scroll Alpha_ based on the [Hop Exchange](https://hop.exchange/) UI, a block explorer for _Scroll Alpha_ using [Blockscout](https://blockscout.com/), and a rollup explorer. - +To view submitted transactions, check out Ethereum's official Goerli block explorers on [Etherscan](https://goerli.etherscan.io/) and [Blockscout](https://eth-goerli.blockscout.com/). \ +\_\_ -## What is a smart contract? What is a hybrid smart contract? +Here is the suggested workflow to explore the Testnet: -When deployed to a blockchain, a _smart contract_ is a set of instructions that can be executed without intervention from third parties. The smart contract code defines how it responds to input, just like the code of any other computer program. +1. Add the [**Alpha Testnet**](https://scroll.io/alpha) configurations to your wallet. +2. Request test tokens in the _Goerli_ network from any Ethereum Faucet app. ([example](https://goerlifaucet.com/)) +3. Transfer test tokens from _Goerli_ to _Scroll Alpha_ through the **Bridge** app. +4. Transfer tokens to other wallets on _Scroll Alpha_ using your wallet. +5. View the status of transactions and blocks in the **Goerli & Alpha Block Explorers** and the **Rollup Explorer**. +6. Withdraw tokens from _Scroll Alpha_ to _Goerli_ through the **Bridge** app. -A valuable feature of smart contracts is that they can store and manage on-chain assets (like [ETH or ERC20 tokens](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/)), just like you can with an Ethereum wallet. Because they have an on-chain address like a wallet, they can do everything any other address can. This enables you to program automated actions when receiving and transferring assets. +You can find the instructions for each app in the rest of this user guide. -Smart contracts can connect to real-world market prices of assets to produce powerful applications. Securely connecting smart contracts with off-chain data and services is what makes them _hybrid_ smart contracts. This is done using oracles. +## Questions & Feedback -## What language is a smart contract written in? - -The most popular language for writing smart contracts on Ethereum and EVM Chains is [Solidity](https://docs.soliditylang.org/en/v0.8.7/). It was created by the Ethereum Foundation specifically for smart contract development and is constantly being updated. Other languages exist for writing smart contracts on Ethereum and EVM Chains, but Solidity is the language used for Chainlink smart contracts. - -If you've ever written Javascript, Java, or other object-oriented scripting languages, Solidity should be easy to understand. Similar to object-oriented languages, Solidity is considered to be a _contract_-oriented language. - -Some networks are not EVM-compatible and use languages other than Solidity for smart contracts: - -- [Solana](/solana/) - - - [Writing Solana contracts in Rust](https://docs.solana.com/developing/on-chain-programs/developing-rust) - - [Writing Solana contracts in C](https://docs.solana.com/developing/on-chain-programs/developing-c) - -## What does a smart contract look like? - -The structure of a smart contract is similar to that of a class in Javascript, with a few differences. For example, the following `HelloWorld` contract is a simple smart contract that stores a single variable and includes a function to update the value of that variable. - -::solidity-remix[samples/Tutorials/HelloWorld.sol] - -### Solidity versions - -The first thing that every Solidity file must have is the Solidity version definition. The `HelloWorld.sol` contract uses version `0.8.7`, which is defined in the contract as `pragma solidity 0.8.7;` - -You can see the latest versions of the Solidity compiler [here](https://github.com/ethereum/solc-bin/blob/gh-pages/bin/list.txt/?target=_blank). You might also notice smart contracts that are compatible with a range of versions. - - -```solidity -pragma solidity >=0.7.0 <0.9.0; -``` - -This means that the code is written for Solidity version 0.7.0, or a newer version of the language up to, but not including version 0.9.0. The `pragma` selects the compiler, which defines how the code is treated. - -### Naming a Contract - -The `contract` keyword defines the name of the contract, which in this example is `HelloWorld`. This is similar to declaring a `class` in Javascript. The implementation of `HelloWorld` is inside this definition and denoted with curly braces. - - -```solidity -contract HelloWorld { - -} -``` - -### Variables - -Like Javascript, contracts can have state variables and local variables. **State variables** are variables with values that are permanently stored in contract storage. The values of **local variables**, however, are present only until the function is executing. There are also different types of variables you can use within Solidity, such as `string`, `uint256`, etc. Check out the [Solidity documentation](https://docs.soliditylang.org/en/v0.8.7/) to learn more about the different kinds of variables and types. - -_Visibility modifiers_ are used to define the level of access to these variables. Here are some examples of state variables with different visibility modifiers: - - -```solidity -string public message; -uint256 internal internalVar; -uint8 private privateVar; -``` - -Learn more about state variables visibility [here](https://docs.soliditylang.org/en/latest/contracts.html#state-variable-visibility). - -### Constructors - -Another familiar concept to programmers is the **constructor**. When you deploy a contract, the constructor sets the state of the contract when it is first created. - -In `HelloWorld`, the constructor takes in a `string` as a parameter and sets the `message` state variable to that string. - - -```solidity -constructor(string memory initialMessage) { - message = initialMessage; -} -``` - -### Functions - -**Functions** can access and modify the state of the contract or call other functions on external contracts. `HelloWorld` has a function named `updateMessage`, which updates the current message stored in the state. - - -```solidity -constructor(string memory initialMessage) { - message = initialMessage; -} - -function updateMessage(string memory newMessage) public { - message = newMessage; -} -``` - -Functions use visibility modifiers to define the access level. Learn more about functions visibility [here](https://docs.soliditylang.org/en/latest/contracts.html#function-visibility). - -### Interfaces - -An **interface** is another concept that is familiar to programmers of other languages. Interfaces define functions without their implementation, which leaves inheriting contracts to define the actual implementation themselves. This makes it easier to know what functions to call in a contract. Here's an example of an interface: - -::solidity-remix[samples/Tutorials/Test.sol] - -For this example, `override` is necessary in the `Test` contract function because it overrides the base function contained in the `numberComparison` interface. The contract uses `pure` instead of `view` because the `isSameNum` function in the `Test` contract does not return a storage variable. - -## What does "deploying" mean? - -**Deploying** a smart contract is the process of pushing the code to the blockchain, at which point it resides with an on-chain address. Once it's deployed, the code cannot be changed and is said to be _immutable_. - -As long as the address is known, its functions can be called through an interface, on [Etherscan](https://etherscan.io/), or through a library like [web3js](https://web3js.readthedocs.io/), [web3py](https://web3py.readthedocs.io/), [ethers](https://docs.ethers.io), and more. Contracts can also be written to interact with other contracts on the blockchain. - -## What is a LINK token? - -The LINK token is an ERC677 token that inherits functionality from the [ERC20 token standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) and allows token transfers to contain a data payload. It is used to pay node operators for retrieving data for smart contracts and also for deposits placed by node operators as required by contract creators. - -Any wallet that handles ERC20 tokens can store LINK tokens. The ERC677 token standard that the LINK token implements still retains all functionality of ERC20 tokens. - -## What are oracles? - -**Oracles** provide a bridge between the real-world and on-chain smart contracts by being a source of data that smart contracts can rely on, and act upon. - -Oracles play a critical role in facilitating the full potential of smart contract utility. Without a reliable connection to real-world conditions, smart contracts cannot effectively serve the real-world. - -## How do smart contracts use oracles? - -Oracles are most popularly used with [_Data Feeds_](/data-feeds/). DeFi platforms like [AAVE](https://aave.com/) and [Synthetix](https://www.synthetix.io/) use Chainlink data feed oracles to obtain accurate real-time asset prices in their smart contracts. - -Chainlink are sources of data [aggregated from many independent Chainlink node operators](/architecture-overview/architecture-decentralized-model/). Each data feed has an on-chain address and functions that enable contracts to read from that address. For example, the [ETH / USD feed](https://data.chain.link/eth-usd/). - -![Chainlink Feeds List](/images/contract-devs/price-aggr.png) - -Smart contracts also use oracles to get other capabilities on-chain: - -- [Generate Verifiable Random Numbers (VRF)](/vrf/v2/introduction/): Use Chainlink VRF to consume randomness in your smart contracts. -- [Call External APIs (Any API)](/any-api/introduction/): Request & Receive data from any API using the Chainlink contract library. -- [Automate Smart Contract Functions (Automation)](/chainlink-automation/introduction/): Automating smart contract functions and regular contract maintenance. - -## What is Remix? - - - -[Remix](https://remix.ethereum.org/) is a web IDE (integrated development environment) for creating, running, and debugging smart contracts in the browser. It is developed and maintained by the Ethereum foundation. Remix allows Solidity developers to write smart contracts without a development machine since everything required is included in the web interface. It allows for a simplified method of interacting with deployed contracts, without the need for a command line interface. Remix also has support for samples. This means that Remix can load code from Github. - -To learn how to use Remix, see the [Deploying Your First Smart Contract -](/getting-started/deploy-your-first-contract/) guide. - - - -## What is Metamask? - -Contracts are deployed by other addresses on the network. To deploy a smart contract, you need an address. Not only that, but you need an address which you can easily use with Remix. Fortunately, [MetaMask](https://metamask.io) is just what is needed. **Metamask** allows anyone to create an address, store funds, and interact with Ethereum compatible blockchains from a browser extension. +If you encounter any issues, join our [Discord](https://discord.gg/scroll) and talk to us in the `Alpha Testnet` section. We would love to hear your thoughts or feedback on how we can improve your experience, too. diff --git a/src/pages/user-guide/setup.md b/src/pages/user-guide/setup.md index e0fabd082..28e755ff2 100644 --- a/src/pages/user-guide/setup.md +++ b/src/pages/user-guide/setup.md @@ -2,8 +2,29 @@ layout: ../../layouts/MainLayout.astro section: gettingStarted date: Last Modified -title: "Swap" -permalink: "user-guide/swap/" +title: "Setup" +permalink: "user-guide/setup/" +whatsnext: { "Grab Goerli ETH from a Faucet": "/user-guide/faucet" } +excerpt: "You need to have a wallet to interact with the Scroll Testnet. You can find some example wallets and configuration tips here." --- -Click the Swap button in the navigation bar to open the Swap app. +## Wallet + +You need to have a wallet to interact with dApps on the Scroll Testnet. You can find some example wallets and configuration tips below. + +### MetaMask + +You can install MetaMask from their [official website](https://metamask.io/download/). + +You need to import the Alpha Testnet configurations to your MetaMask wallet. To do this, click all **Add to wallet** buttons on the [Alpha Testnet homepage](https://scroll.io/alpha). This will import the chain ID and RPC URLs for the Scroll Alpha Testnet. The Goerli Testnet is configured on Metamask by default. To show it, click "Show/hide test networks" in the MetaMask network selection dropdown menu. + +### Manual network configuration (for other wallets) + +Currently, the **Add to wallet** links may not be compatible with all wallets yet. If you are having issues using them, you may need to manually add the _Goerli Testnet_ and _Scroll Alpha_ network by inserting the configuration details from the table below: + +| Network Name | Scroll Alpha Testnet | Goerli Testnet | +| ------------------ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| RPC URL | [https://alpha-rpc.scroll.io/l2](https://alpha-rpc.scroll.io/l2) | [https://endpoints.omniatech.io/v1/eth/goerli/public](https://endpoints.omniatech.io/v1/eth/goerli/public) | +| Chain ID | 534353 | 5 | +| Currency Symbol | ETH | ETH | +| Block Explorer URL | [https://blockscout.scroll.io](https://blockscout.scroll.io/) | [https://goerli.etherscan.io](https://goerli.etherscan.io) | diff --git a/src/pages/user-guide/swap.md b/src/pages/user-guide/swap.md deleted file mode 100644 index e0fabd082..000000000 --- a/src/pages/user-guide/swap.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -layout: ../../layouts/MainLayout.astro -section: gettingStarted -date: Last Modified -title: "Swap" -permalink: "user-guide/swap/" ---- - -Click the Swap button in the navigation bar to open the Swap app. diff --git a/src/pages/user-guide/transfer-tokens.md b/src/pages/user-guide/transfer-tokens.md index e0fabd082..bd628a5f1 100644 --- a/src/pages/user-guide/transfer-tokens.md +++ b/src/pages/user-guide/transfer-tokens.md @@ -2,8 +2,15 @@ layout: ../../layouts/MainLayout.astro section: gettingStarted date: Last Modified -title: "Swap" -permalink: "user-guide/swap/" +title: "Transfer Tokens" +permalink: "user-guide/transfer-tokens/" +excerpt: "You can use your wallet as usual to transfer tokens within the Scroll Alpha Testnet." --- -Click the Swap button in the navigation bar to open the Swap app. +You can use your wallet as usual to transfer tokens within the Scroll Alpha Testnet. + +1. Open your wallet and switch to **Scroll Alpha Testnet**. +2. Click the **Send** button in the middle and type the address you want to transfer to in the text box. +3. Select the token in the **Asset** box and type the amount of token that you want to transfer. +4. Click the **Next** button and then click the **Confirm** button to send out the transaction. +5. After sending, you can find the transaction in the **Activity** tab in your wallet. diff --git a/src/pages/zkevm.mdx b/src/pages/zkevm.mdx deleted file mode 100644 index 6ccc322f4..000000000 --- a/src/pages/zkevm.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: ../layouts/MainLayout.astro -section: zkevm -title: "zkEVM Landing Title" ---- - -Content for the zkEVM landing page. for fancy stuff, see the infrastructure page.