Skip to content

Instantly share code, notes, and snippets.

View Meharab's full-sized avatar
🔥
💥 Cold ❄ Blooded 🩸 Coder 💻

Meharab G Meharab

🔥
💥 Cold ❄ Blooded 🩸 Coder 💻
View GitHub Profile
@ac12644
ac12644 / Attack.sol
Last active March 22, 2022 17:43
Contract Attack
import "EtherStore.sol";
contract Attack {
EtherStore public etherStore;
// intialize the etherStore variable with the contract address
constructor(address _etherStoreAddress) {
etherStore = EtherStore(_etherStoreAddress);
}
@ac12644
ac12644 / EtherStore.sol
Last active March 22, 2022 17:42
Vulnerable Contract
contract EtherStore {
uint256 public withdrawalLimit = 1 ether;
mapping(address => uint256) public lastWithdrawTime;
mapping(address => uint256) public balances;
function depositFunds() external payable {
balances[msg.sender] += msg.value;
}
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// [MIT License]
/// @title Base64
@adilanchian
adilanchian / App.js
Last active February 25, 2023 11:59
Section 5: Update UI + deploy to an Ethereum testnet so anyone on the internet can wave at you using their
import React, { useEffect, useState } from "react";
import { ethers } from "ethers";
import './App.css';
import wavePortal from './utils/WavePortal.json';
const App = () => {
const [currentAccount, setCurrentAccount] = useState("");
const [allWaves, setAllWaves] = useState([]);
const contractAddress = "0xd5f08a0ae197482FA808cE84E00E97d940dBD26E";
let storage = []
let callbackFNConstructor = (index) => (error, contractData) => {
storage[index] = contractData
}
for(var i = 0; i < 6; i++) {
web3.eth.getStorageAt(contract.address, i, callbackFNConstructor(i))
}
@critesjosh
critesjosh / lookup.js
Last active October 13, 2022 21:46
A node script to run a phone number lookup with ODIS on the Celo blockchain
// In this example, we will go over how to look up a Celo address that is registered with a phone number with ODIS
// 1. Import the appropriate packages
const ContractKit = require('@celo/contractkit')
const OdisUtils = require('@celo/identity').OdisUtils
// 2. Import these packages to help with private key management for the example
const privateKeyToAddress = require('@celo/utils/lib/address').privateKeyToAddress
const normalizeAddressWith0x = require('@celo/utils/lib/address').normalizeAddressWith0x
pragma solidity ^0.6.6;
import './GateKeeperOne.sol';
import "https://github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol";
contract GateKeeperOneAttack {
using SafeMath for uint256;
bytes8 key;
GatekeeperOne gateKeeper;
pragma solidity ^0.6.10;
import "https://github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol";
contract Reentrance {
using SafeMath for uint256;
mapping(address => uint) public balances;
function donate(address _to) public payable {
@Meharab
Meharab / Auction.sol
Created May 7, 2020 19:06
smart contract for auction
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@Meharab
Meharab / data-preprocessing-template.ipynb
Created April 19, 2020 16:49
Data Preprocessing Template.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.