Skip to content

Instantly share code, notes, and snippets.

@BellaBe
Created December 29, 2022 15:10
Show Gist options
  • Save BellaBe/150ef80f83dbe9725349793b8cd418d7 to your computer and use it in GitHub Desktop.
Save BellaBe/150ef80f83dbe9725349793b8cd418d7 to your computer and use it in GitHub Desktop.
Create Smart contract with constructor
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract Demo {
uint private simpleUint;
constructor() {
simpleUint = 5;
}
function getValue() public view returns(uint){
return simpleUint;
}
function setValue(uint _value) public{
simpleUint = _value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment