# Scroll smart contract in the Scroll Alpha Testnet network

By [CryptoProfit](https://paragraph.com/@cryptoprofit) · 2023-03-10

---

### We go to the site and connect our metamask wallet in the Scroll Alpha network here

    https://remyh.etgereum.org/ 
    

### Next, click on the icon (1), give a name to the contract, for example Scroll and be sure to put a dot and add .sol (2) and click on any part under our inscription with the left mouse button

![](https://storage.googleapis.com/papyrus_images/ac9cfbfe77ce0fe46b50464612293eccc1ea5bdea172f483682a08c4179b08d3.png)

Copying the code:
-----------------

// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; contract FunctionTypes{ uint256 public number = 5;

    constructor() payable {}
    
    // 函数类型
    // function (<parameter types>) {internal|external} \[pure|view|payable\] \[returns (<return types>)\]
    // 默认function
    function add() external{
        number = number + 1;
    }
    
    // pure: 纯纯牛马
    function addPure(uint256 \_number) external pure returns(uint256 new_number){
        new_number = \_number+1;
    }
    
    // view: 看客
    function addView() external view returns(uint256 new_number) {
        new_number = number + 1;
    }
    
    // internal: 内部
    function minus() internal {
        number = number - 1;
    }
    
    // 合约内的函数可以调用内部函数
    function minusCall() external {
        minus();
    }
    
    // payable: 递钱，能给合约支付eth的函数
    function minusPayable() external payable returns(uint256 balance) {
        minus();    
        balance = address(this).balance;
    }
    

}

### We return to the site, left-click in the black box in the center of the screen and press CTRL + V (paste the copied code) and click OK on the message that appears:

![](https://storage.googleapis.com/papyrus_images/efa82e679ddd1594dc7a9461bba257cd29aaa20e21553fab72d0dec9d3e8b350.png)

### Then press the key combination CTRL + S (if you do everything with Windows) and Command + S (for Mac) after which you should see a green check mark on the left, go to this item:

![](https://storage.googleapis.com/papyrus_images/18739d95767c67a9cc5f36fe9618b716e7e7804463e5dea0be4d71a30ba6a981.png)

### In the upper field, change the compiler version to the newest (1) and click the Compile button (2):

![](https://storage.googleapis.com/papyrus_images/1225a046fb45f11d485e2ced66ace03a84b7727cc27979fd2abb6cd565fd746c.png)

### If everything is done correctly, you should see a green checkmark:

![](https://storage.googleapis.com/papyrus_images/b6954786ade3e7f0d6604d83b437539749684090808857782ab6b9a94e21bb3f.png)

### Now we go to the lowest menu item (1), in item (2) Injected Provider - Metamask should be selected, in item (3) your Metamask wallet should be pulled up

![](https://storage.googleapis.com/papyrus_images/ea5df181b8289de3fc58731eee2f6c702b3e508c13f9c8f9c399cd44a7352ab5.png)

### press the Deploy button (1) and sign the transaction in our wallet by clicking the Approve button(2):

![](https://storage.googleapis.com/papyrus_images/d130a8916fbb64c086b035cdbb1cc63686aa8dc2fe9cab1ec8b3fd9e46bfd76b.png)

### After a few seconds, our smart contract is deployed, in confirmation of this, we should see a green inscription at the bottom of the screen:

![](https://storage.googleapis.com/papyrus_images/a29e8a9af1358d57455d80c5716c844c7c36e0285a0029fc4df3cd5182fed77c.png)

### Everyone, congratulations! We have successfully deployed the Scroll smart contract on the Alpha network!

---

*Originally published on [CryptoProfit](https://paragraph.com/@cryptoprofit/scroll-smart-contract-in-the-scroll-alpha-testnet-network)*
