Created
June 19, 2022 15:28
-
-
Save abhik-99/c3610e713f3cc3a4680300f058827a29 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.12+commit.f00d7308.js&optimize=false&runs=200&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.12; | |
contract Contract3 { | |
uint constant c1 = 10; | |
constructor() {} | |
function getSum(uint _v) public returns (uint){ | |
return c1 + _v; | |
} | |
} | |
contract Contract4 { | |
uint v1; | |
constructor(uint _v) { | |
v1=_v; | |
} | |
function getSum(uint _v) public returns (uint) { | |
return v1 + _v; | |
} | |
} | |
contract Contract5 { | |
uint immutable i1; | |
constructor(uint _v) { | |
i1=_v; | |
} | |
function getSum(uint _v) public returns (uint) { | |
return i1 + _v; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment