Deployment of smart contract on Remix

As we make any smart contract in solidity then next step is to deploy that contract. Remix IDE is tool allow us to deploy a Smart contract. In this blog we will see deployment of smart contract step by step.

1. Search online :

Very first step is to open Remix IDE.

Enter “Remix IDE online” in the search box.

2.Opening Remix IDE.

Above step navigate us on below interface.

3.Creating new folder and file

In the left above corner we can find “file explorer” option. Under which we are facilitate with variety of option like create file, upload file many more. For our Smart contract we are now create New folder, then New file in it.

4.Text editor to write a Smart Contract.

As we click on file with .sol extension i.e. newly created then we will see blank text editor on right hand side.  

5.Writing a Smart Contract.

By deciding our “Logic” start writing Smart contract (Solidity) here. We have taken very simple “Hello word” smart contract code.

pragma solidity ^0.8.0;

contract Hello {

    string public message;

    function GetMessage(string memory initialMessage) public {

        message = initialMessage;

    }

function SetMessage(string memory newMessage) public {

        message = newMessage;

    }

}

6.Compilation

After completing Smart contract writing, next step is to compile it. Left side vertical panel of file explorer have option Solidity compiler, under which we have lots of facility like selecting compiler version, auto compilation, advanced configuration, selecting particular contract for compilation, where to publish, compilation details etc.

At very bottom we can see two options, ABI(Application Binary Interface) and Bytecode which are totally related to how smart contract works. Also after successful compilation we can see green tick on compiler.

ABI of our SMART CONTRACT

[

        {

                “inputs”: [

                        {

                                “internalType”: “string”,

                                “name”: “initialMessage”,

                                “type”: “string”

                        }

                ],

                “name”: “GetMessage”,

                “outputs”: [],

                “stateMutability”: “nonpayable”,

                “type”: “function”

        },

        {

                “inputs”: [

                        {

                                “internalType”: “string”,

                                “name”: “newMessage”,

                                “type”: “string”

                        }

                ],

                “name”: “SetMessage”,

                “outputs”: [],

                “stateMutability”: “nonpayable”,

                “type”: “function”

        },

        {

                “inputs”: [],

                “name”: “message”,

                “outputs”: [

                        {

                                “internalType”: “string”,

                                “name”: “”,

                                “type”: “string”

                        }

                ],

                “stateMutability”: “view”,

                “type”: “function”

        }

]

Bytecode

608060405234801561001057600080fd5b506106b2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806312c1db731461004657806388fabb3a14610062578063e21f37ce1461007e575b600080fd5b610060600480360381019061005b91906102aa565b61009c565b005b61007c600480360381019061007791906102aa565b6100af565b005b6100866100c2565b6040516100939190610372565b60405180910390f35b80600090816100ab91906105aa565b5050565b80600090816100be91906105aa565b5050565b600080546100cf906103c3565b80601f01602080910402602001604051908101604052809291908181526020018280546100fb906103c3565b80156101485780601f1061011d57610100808354040283529160200191610148565b820191906000526020600020905b81548152906001019060200180831161012b57829003601f168201915b505050505081565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6101b78261016e565b810181811067ffffffffffffffff821117156101d6576101d561017f565b5b80604052505050565b60006101e9610150565b90506101f582826101ae565b919050565b600067ffffffffffffffff8211156102155761021461017f565b5b61021e8261016e565b9050602081019050919050565b82818337600083830152505050565b600061024d610248846101fa565b6101df565b90508281526020810184848401111561026957610268610169565b5b61027484828561022b565b509392505050565b600082601f83011261029157610290610164565b5b81356102a184826020860161023a565b91505092915050565b6000602082840312156102c0576102bf61015a565b5b600082013567ffffffffffffffff8111156102de576102dd61015f565b5b6102ea8482850161027c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561032d578082015181840152602081019050610312565b60008484015250505050565b6000610344826102f3565b61034e81856102fe565b935061035e81856020860161030f565b6103678161016e565b840191505092915050565b6000602082019050818103600083015261038c8184610339565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806103db57607f821691505b6020821081036103ee576103ed610394565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026104567fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82610419565b6104608683610419565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006104a76104a261049d84610478565b610482565b610478565b9050919050565b6000819050919050565b6104c18361048c565b6104d56104cd826104ae565b848454610426565b825550505050565b600090565b6104ea6104dd565b6104f58184846104b8565b505050565b5b818110156105195761050e6000826104e2565b6001810190506104fb565b5050565b601f82111561055e5761052f816103f4565b61053884610409565b81016020851015610547578190505b61055b61055385610409565b8301826104fa565b50505b505050565b600082821c905092915050565b600061058160001984600802610563565b1980831691505092915050565b600061059a8383610570565b9150826002028217905092915050565b6105b3826102f3565b67ffffffffffffffff8111156105cc576105cb61017f565b5b6105d682546103c3565b6105e182828561051d565b600060209050601f8311600181146106145760008415610602578287015190505b61060c858261058e565b865550610674565b601f198416610622866103f4565b60005b8281101561064a57848901518255600182019150602085019450602081019050610625565b868310156106675784890151610663601f891682610570565b8355505b6001600288020188555050505b50505050505056fea26469706673582212205e0ca78ffb90238c67e971ab98d1a7b13ba6abc22cdf230ba5918fddb19775bb64736f6c63430008120033

7.Deployment of Smart Contract

After compilation next step is to deploy smart contract.

Left side vertical panel of file explorer have option Deploy & Run Transaction, under which we have lots of facility like selecting environment, account for deployment, gas limit, value, contract etc.

At last by clicking  “Deploy” option, deployment of our smart contract completes.

8.After Deployment

At bottom we can see deployed contract option by clicking it we can get address of Smart Contract.

i.e.0xd8b934580fcE35a11B58C6D73aDeE468a2833fa8

9.Transacting deployed contract

By entering some input parameters we will get output of smart contract in this section.

In simple word here we can check behavior of Smart contract

Final word

By following above steps we can deploy any  Smart contract.

Leave a Reply

Your email address will not be published. Required fields are marked *