Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file modified .DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions MempoolListener/listener.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Network, Alchemy } from 'alchemy-sdk';

// Optional Config object, but defaults to demo api-key and eth-mainnet.
const settings = {
apiKey: '2ayGuJawCT2fsUbqE1q6JLGuddT6A-qe', // Replace with your Alchemy API Key.
network: Network.ETH_MAINNET, // Replace with your network.
};

const alchemy = new Alchemy(settings);

var ethers = require("ethers");
var url = "wss://eth-mainnet.g.alchemy.com/v2/2ayGuJawCT2fsUbqE1q6JLGuddT6A-qe";
var init = function () {
var customWsProvider = new ethers.providers.WebSocketProvider(url);
customWsProvider.on("pending", (tx) => {

customWsProvider.getTransaction(tx).then(function (transaction) {
if (transaction != null){
if (transaction.to==="0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"){
console.log(transaction);
}
}
});
}); };
init();
Binary file added SHAMEcoin/.DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions SHAMEcoin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts

3 changes: 3 additions & 0 deletions SHAMEcoin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SHAMEcoin

This contract creates 'SHM', a token that is undesirable. Only the contract admin can transfer to a particular address. Only the contract admin can run transferFrom, and only with approval from the address holder.
Binary file added SHAMEcoin/contracts/.DS_Store
Binary file not shown.
46 changes: 46 additions & 0 deletions SHAMEcoin/contracts/SHAMEcoin.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: None
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

pragma solidity ^0.8.17;

contract SHAMEcoin is ERC20, Ownable {

constructor(uint256 initialSupply) ERC20("SHAME", "SHM"){
_mint(msg.sender, initialSupply);
}

function decimals() public view override returns (uint8) {
return 0;
}

function transfer(address recipient, uint256 amount) public override returns (bool) {
require (amount == 1);
if (msg.sender == owner()){
_transfer(owner(), recipient, 1);
}
else {
_transfer(owner(), msg.sender, 1);
}
return true;
}

function transferFrom(address shameHodler, address DEAD, uint256 amount) public override returns (bool) {
require (msg.sender == owner());
uint256 currentAllowance = allowance(shameHodler, owner());
require(currentAllowance >= 1, "ERC20: transfer amount exceeds allowance");
_burn(shameHodler, 1);
_approve(shameHodler, _msgSender(), currentAllowance - 1);

return true;
}

function approve(address hodler, uint256 amount) public override returns (bool) {
require (msg.sender == hodler);
_approve(_msgSender(), owner(), amount);
return true;
}



}
6 changes: 6 additions & 0 deletions SHAMEcoin/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
};
Loading