Skip to content

Instantly share code, notes, and snippets.

View inhisprensence's full-sized avatar

inhisprensence

View GitHub Profile
@inhisprensence
inhisprensence / LoveToken.sol
Created February 12, 2025 01:53
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.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// 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);
@inhisprensence
inhisprensence / Subscription.sol
Created February 8, 2025 22:35
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.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// 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()
@inhisprensence
inhisprensence / samplechild.sol
Created February 3, 2025 06:02
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.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// 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;
@inhisprensence
inhisprensence / BuyMeACoffee.sol
Created January 30, 2025 10:17
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.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
contract BuyMeACoffee {
event NewMemo(
address indexed from,
uint256 timestamp,
string message,
string name
@inhisprensence
inhisprensence / vote.sol
Created January 28, 2025 22:47
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.28+commit.7893614a.js&optimize=false&runs=200&gist=
// 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;
@inhisprensence
inhisprensence / votee.sol
Created January 28, 2025 22:47
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.28+commit.7893614a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT License
pragma solidity ^0.8.20;
contract votingSystem{
//the variables
struct candidate{
address candidateAddress;
uint voteCount;
@inhisprensence
inhisprensence / health.sol
Created January 28, 2025 22:45
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.28+commit.7893614a.js&optimize=false&runs=200&gist=
// 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;
@inhisprensence
inhisprensence / indeed.sol
Created January 28, 2025 22:42
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.28+commit.7893614a.js&optimize=false&runs=200&gist=
// 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;