Skip to content

Instantly share code, notes, and snippets.

View shopglobal's full-sized avatar
💻
deploying Electronero 2.0

⛓️INTERCHAINED ⚡Electronero Network ʕ•̫͡•ʔ-̫͡-ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ-̫͡-ʔ shopglobal

💻
deploying Electronero 2.0
View GitHub Profile
@shopglobal
shopglobal / Crystaleum.md
Created August 23, 2024 01:30
Crystaleum

Crystaleum Whitepaper


Abstract

Crystaleum is an innovative decentralized blockchain platform designed to enable secure, transparent, and efficient peer-to-peer transactions. Built on a foundation of cryptographic integrity and decentralized consensus, Crystaleum aims to provide a robust framework for the development and deployment of decentralized applications (dApps) and smart contracts. With a focus on scalability, security, and user autonomy, Crystaleum seeks to redefine the landscape of digital finance and asset management.


@shopglobal
shopglobal / MUMarket.md
Last active August 21, 2024 23:47
Multi user marketplace

To create this marketplace with multi-user authentication in PHP, you'll need to build several key components:

1. User Authentication

  • Registration and Login:

    • Create a registration system where users sign up with their email and password.
    • Implement a login system with proper password hashing (e.g., using password_hash() and password_verify() in PHP).
  • Session Management:

    • Use PHP sessions to keep users logged in and maintain their state across pages.
@shopglobal
shopglobal / DualRewards.md
Last active August 21, 2024 22:35
Dual Layer rewards mechanics

Creating a unique smart contract that incentivizes liquidity providers to earn decent liquidity requires a creative approach. One concept is to design a contract that offers rewards not only in the form of trading fees but also additional incentives like staking rewards, governance tokens, or even NFT rewards.

Here’s a basic framework for a "Liquidity Incentive Contract" that offers multiple layers of rewards:

Key Features:

  1. Dual Reward System: Liquidity providers earn rewards in both the base token and a governance token.
  2. Staking Boost: Liquidity providers can stake their LP tokens to earn higher rewards.
  3. NFT Rewards: Milestone-based rewards in the form of NFTs for top liquidity providers.
  4. Flexible Withdrawal: Allows liquidity providers to withdraw their funds anytime but penalizes early withdrawals by reducing rewards.
@shopglobal
shopglobal / LRST.md
Created August 21, 2024 21:34
Liquid restaking token

Here’s a basic implementation of a liquid restaking token in Solidity that takes a percentage of each transaction, swaps it for WETH, and adds liquidity to a Uniswap WETH pair:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
@shopglobal
shopglobal / BankOfEthereum.md
Created August 20, 2024 23:20
Ethereum Bank

Here's an example of how to create a basic bank in Solidity that allows users to deposit, withdraw, and check their balance. This example also includes some additional features such as interest calculation and ownership.

Bank Contract in Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Bank {
    address public owner;
@shopglobal
shopglobal / ERC20Factory.md
Last active August 20, 2024 22:19
ERC20 Token Factory

To create a token factory on Ethereum that deploys ownable ERC20 tokens and charges 0.02 ETH per deployment, you can follow these steps. The token factory will be a smart contract written in Solidity that deploys new instances of an ERC20 token contract. The deployer (caller of the deploy function) will be the owner of the new ERC20 token.

Step 1: Create the Ownable ERC20 Token Contract

First, create an ERC20 token contract that implements the Ownable pattern. This contract will be used by the token factory to deploy new tokens.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
@shopglobal
shopglobal / SOLFactory.md
Created August 20, 2024 21:31
Solana token farm

Creating a token factory on Solana using Rust involves writing a Solana program (smart contract) that can create SPL tokens. Below is a high-level guide on how to implement this, along with a sample Rust program.

Prerequisites

  1. Rust Toolchain: Install Rust if you haven’t already. You can install it using:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Solana CLI: Install the Solana CLI tools:

@shopglobal
shopglobal / CPaint.md
Last active August 20, 2024 16:19
C# paint job calculator

To create a C# application that calculates the cost of a paint job based on the square feet of wall space, the price of the paint per gallon, and labor costs, you can follow the steps below:

Step 1: Create a New C# Console Application

Open Visual Studio, create a new C# Console Application, and name it appropriately (e.g., PaintJobCalculator).

Step 2: Write the Code

Here is the code that performs the calculations based on user input:

@shopglobal
shopglobal / BTCFutures.md
Last active August 19, 2024 23:25
Bitcoin futures

To build a Bitcoin futures market using PHP and MySQL, we can create a simple platform where users can place bets on the future price of Bitcoin. The platform will involve the following components:

  1. User Authentication: Users need to sign up and log in to place futures bets.
  2. Market Creation: Admin or users create futures contracts for Bitcoin price predictions.
  3. Placing Bets: Users can place bets on the outcome of these futures contracts.
  4. Market Settlement: When the contract expires, the system will settle the market based on the actual Bitcoin price.
  5. Payouts: Users who predicted correctly receive payouts.

Step 1: Setting Up the Database

@shopglobal
shopglobal / Monerowebwallet.md
Last active August 19, 2024 22:10
Simple monero web wallet

Below is a comprehensive guide to creating a mobile wallet application for Monero cryptocurrency using React Native for the frontend and PHP with MySQL for user authentication. This guide will cover setting up user authentication, integrating Monero transactions, and displaying transaction history.


1. Project Setup

Frontend (React Native)

  1. Initialize a new React Native project:
    npx react-native init MoneroWallet