# Deploy a contract on Scroll

By [Untitled](https://paragraph.com/@0x16862662b5a97e696f76fd05b64c5bf00db6320e) · 2023-03-20

---

1、open this website with chrome.

[https://remix.ethereum.org/](https://remix.ethereum.org/)

2、accept and then click next, done.

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

3、click the small button（create new file),name new file with Function.sol

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

4、copy this code to Function.sol

    // 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;
        }
    }
    

5、click the red “1” and then click “2” to compile the file

     use a high level compiler , such as 0.8.8
    

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

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

6、Turn the metamsk network to scroll alpha testnet, click “red 1”，

then choose injected provider-metamsk,

and then click deploy

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

---

*Originally published on [Untitled](https://paragraph.com/@0x16862662b5a97e696f76fd05b64c5bf00db6320e/deploy-a-contract-on-scroll)*
