# How To deploy a contract on Scroll

By [ali3a.eth](https://paragraph.com/@ali3a) · 2023-03-11

---

1、open this website with chrome :[https://remix.ethereum.org/#lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.18+commit.87f61d96.js](https://remix.ethereum.org/#lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.18+commit.87f61d96.js)

2、accept and then click next, done

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

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

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

You Will can get:

![](https://storage.googleapis.com/papyrus_images/c0bb60f3062ede93c2d1d1271bf77c8b5f6516af6ec90551c55aeda6f03531c1.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;
        }
    }
    

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

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

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

And Done :) Hope this be usefull for You !

---

*Originally published on [ali3a.eth](https://paragraph.com/@ali3a/how-to-deploy-a-contract-on-scroll)*
