Skip to content

Instantly share code, notes, and snippets.

View Guzbyte-tech's full-sized avatar
🎯
Focusing

Chiagoziem David Guzbyte-tech

🎯
Focusing
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract StudentRecord {
address owner;
constructor () {
owner = msg.sender;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract StakeEth_2 {
//function stake
//Multiple User can stake.
/**
* stakes => [user][amount, duration, interest]
import { ethers } from "hardhat";
const helpers = require("@nomicfoundation/hardhat-network-helpers");
async function main() {
const ROUTER_ADDRESS = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D";
const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
const UNI = "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984";
const TOKEN_HOLDER = "0xf584F8728B874a6a5c7A8d4d387C9aae9172D621";
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
contract EventOrganizer {
address nftCollectionAddress;
uint256 public totalEventsCreated;
constructor() {}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
// Assuming VIP_Bank is imported or defined in the same project
import "./VIP_Bank.sol";
contract CombinedExploit {
VIP_Bank public bank;
address public manager;
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.24;
import {Test, console, console2} from "forge-std/Test.sol";
import {ChallengeTwo} from "../src/ChallengeTwo.sol";
contract ChallengeTwoTest is Test {
ChallengeTwo chal;
uint8 private attemptCounter = 0;
// SPDX-License-Identifier: UNKNOWN
pragma solidity ^0.8.17;
import {Web3BridgeCXIPool} from "./web3bridgecxipool.sol";
interface IFlashLoanEtherReceiver {
function execute() external payable;
}
contract Exploiter is IFlashLoanEtherReceiver {
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./ErrorLib.sol";
import "./IPriceOracle.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IFlashLoanReceiver {
function executeOperation(
address token,
  1. Solidity version is not the latest 0.8.0
  2. Duplicate Address Check in enterRaffle is not Gas efficient
  • No address zero within the players.
  • Time Check tto make sure they enter within the acurate time.
 for (uint256 i = 0; i < players.length - 1; i++) {
      for (uint256 j = i + 1; j < players.length; j++) {
          require(players[i] != players[j], "PuppyRaffle: Duplicate player");
      }
@Guzbyte-tech
Guzbyte-tech / Vault.sol
Created September 22, 2025 19:58
Simple Vault Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/token/ERC20/IERC20.sol";
import "@openzeppelin/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/security/ReentrancyGuard.sol";
import "@openzeppelin/access/Ownable.sol";
import "@openzeppelin/security/Pausable.sol";
/**