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.26; | |
contract LoveSmartContract { | |
mapping(address => uint256) public loveBalances; | |
mapping(address => mapping(address => uint256)) public loveLocks; | |
address[] public lovers; | |
event LoveSent(address indexed from, address indexed to, uint256 amount); | |
event LoveLocked(address indexed lover1, address indexed lover2, uint256 amount); |
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.26; | |
contract Subscription{ | |
address public owner; | |
uint256 public monthlyFee;//Monthly fee in wei | |
mapping(address => uint256) public subscriptionEndTime; //tracks when a user's subscription ends | |
event Subscribed(address user, uint256 endTime); //Event emitted on subscribe() |
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.0; | |
// Child contract to be deployed by the factory | |
contract Child { | |
address public owner; | |
string public data; | |
constructor(string memory _data) { | |
owner = msg.sender; |
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.26; | |
contract BuyMeACoffee { | |
event NewMemo( | |
address indexed from, | |
uint256 timestamp, | |
string message, | |
string name | |
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.8; | |
//candidate , name ,voteCount | |
//voters, name,authorized, voted | |
//admin address | |
contract VotingSystem { | |
struct Candidate { | |
string name; | |
uint256 voteCount; |
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 License | |
pragma solidity ^0.8.20; | |
contract votingSystem{ | |
//the variables | |
struct candidate{ | |
address candidateAddress; | |
uint voteCount; |
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.26; | |
contract HealthRecord{ | |
struct Person { | |
uint256 favoriteNumber; | |
string name; | |
uint256 idNumber; | |
// uint256 idNumbershall be the file number of the patient; | |
// uint256 favoriteNumber shall be their health status encoded; |
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 | |
// Compatible with OpenZeppelin Contracts ^5.0.0 | |
pragma solidity ^0.8.22; | |
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
contract IndeedToken is ERC721, ERC721URIStorage, Ownable { | |
uint256 private _nextTokenId; |