Last active
January 28, 2024 22:40
-
-
Save Zeegaths/40c8d634cfe27e15d5099c8b19e37d12 to your computer and use it in GitHub Desktop.
A smart contract that uses view, pure, and payable functions.
This file contains 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.17; | |
contract Function { | |
uint public a = 5; | |
// View function | |
function multiplyNumbers(uint b) public view returns (uint) { | |
return a * b; | |
} | |
// Pure function | |
function multiply(uint x, uint y) public pure returns (uint) { | |
return x * y; | |
} | |
// Payable function | |
function deposit () public payable {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment