Created
March 23, 2024 11:37
-
-
Save Jesserc/c217620a1a4636449a4da20fedae8cc2 to your computer and use it in GitHub Desktop.
For Ethereum Dev workshop
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.4; | |
contract MyFirstContract{ | |
// string, integers (uint, int), address | |
address myAddress = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4; | |
uint number = 2024; | |
int negativeNumber = -2024; | |
string name = "Jesserc"; | |
function retrieveAllVars() public view returns(address,uint,int, string memory){ | |
return (myAddress,number,negativeNumber,name); | |
} | |
function updateAddress(address newAddr) public { | |
myAddress = newAddr; | |
} | |
function updateNumber(uint newNumber) public { | |
number = newNumber; | |
} | |
function updateNegNumber(int newNegNumber) public { | |
negativeNumber = newNegNumber; | |
} | |
function updateName(string memory newName) public { | |
name = newName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment