Skip to content

Instantly share code, notes, and snippets.

M | Approval Race Protections

Description :-

Some tokens (e.g. USDT, KNC) do not allow approving an amount M > 0 when an existing amount N > 0 is already approved. This is to protect from an ERC20 attack vector describe here

Proof Of Concept

File:wemix-lending-contract-main/contracts/lending/TeamMinter.sol
@MGF15
MGF15 / report-arbitrum.md
Created August 4, 2023 15:05
Arbitrum Bot Race Report
ID Title Category Severity Instances
[1] Centralization Risk for trusted owners Centralization / Privilege Med 7
[2] will not work properly on Optimism due to use of block.number Volatile Code Med 4
[3] Initializers could be front-run Data Flow Low 3
[4] Loss of precision Data Flow Low 1
[5] Use safeTransferOwnership instead of transferOwnership function Control Flow Low 2
[6] Unbounded loop Control Flow Low 21
[7] Use Ownable2Step's transfer function rather than Ownable's for transfers of ownership Centralization / Privilege Low 1

Gas Optimizer Report

Medium Risk Issues

Issue Instances
Med-1 Centralization Risk for trusted owners 7
Med-2 Contracts are vulnerable to fee-on-transfer-token-related accounting issues 3
@MGF15
MGF15 / fisic.py
Last active October 22, 2017 16:51
song finder script
#!/usr/bin/python
import os,urllib,re,json,sys
#simple script based on acoustid audio identification api and fpcalc tool
#download Chromaprint-fpcalc from https://acoustid.org/chromaprint
#you know ! it's just get fingerprint from audio file by fpcalc and make a request to acoustid as simple as that !
def main(file):
url = "https://api.acoustid.org/v2/lookup?client="
@MGF15
MGF15 / morse.py
Last active October 7, 2016 17:06
Morse Code Encode & Decode
#!/usr/bin/python
# Morse Code
# Encode & Decode
# http://stackoverflow.com/questions/32094525/morse-code-to-english-python3?answertab=votes#tab-top
# direction from ^ LOL i'm too lazy
# add . to @ from wiki ;) https://en.wikipedia.org/wiki/Morse_code
CODE = {'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F': '..-.',
'G': '--.', 'H': '....', 'I': '..',