Skip to content

Instantly share code, notes, and snippets.

@AMIYA8597
Created October 17, 2022 09:44
Show Gist options
  • Select an option

  • Save AMIYA8597/1a0cb5d108d1318866b82244e5d2f729 to your computer and use it in GitHub Desktop.

Select an option

Save AMIYA8597/1a0cb5d108d1318866b82244e5d2f729 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.14+commit.80d49f37.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract SampleContract{
string public name;
string public persona;
string public company;
bool public isAdmin;
event DataUpdated(string name,string persona,string company,bool isAdmin);
function getData() public view returns(string memory,string memory,string memory, bool){
return (name,persona,company,isAdmin);
}
function writeData(string memory name_, string memory persona_, string memory company_, bool isAdmin_) public {
name = name_;
persona = persona_;
company = company_;
isAdmin = isAdmin_;
emit DataUpdated(name, persona, company, isAdmin);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment