Skip to content

Instantly share code, notes, and snippets.

View dhruvinparikh's full-sized avatar
💭
😈 | Building cool stuff at @FraxFinance | Breaking stuff

Dhruvin Parikh dhruvinparikh

💭
😈 | Building cool stuff at @FraxFinance | Breaking stuff
View GitHub Profile

Best viewed in Obsidian

Reviews every important function and its call trace

- BorrowingModule ^BorrowingModule

  • touch -- [[#^Base-initOperation]] (update storage: accum + lastUpdated, fees, shares, borrows), set a snapshot. (After the call it will be all checked on EVC)
    • How is a snapshot used? [[#^Base-snapshot]]
      • checkVaultStatus [[#^RiskManager-checkVaultStatus]]
  • flashLoan -- get acc (msg.sender or ~msg.sender), send all the balance to acc, callback, check balance
    • Is a nonReentrant modifier inherited? -- no, but since we do delegateCall it will be used
  • Why no events!? -- didn't do delegate
@0age
0age / c000r.sol
Last active June 10, 2024 18:32
0xMonaco car (top-ranked finisher by ELO, Paradigm CTF 2022) https://0xmonaco.ctf.paradigm.xyz/viewTeam/OpenSea
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16; // (10M optimization runs)
interface MonacoInterface {
struct CarData {
uint32 balance; // Where 0 means the car has no money.
uint32 speed; // Where 0 means the car isn't moving.
uint32 y; // Where 0 means the car hasn't moved.
Car car;
}
@shsunmoonlee
shsunmoonlee / async-http.js
Last active June 26, 2021 17:31
How to asynchronously use nested http.get request using native node.js method.
/*
* Complete the function below.
* Instead of returning the answer, log the answer to the console.
* https://jsonmock.hackerrank.com/api/countries/search?name=
*/
function getCountries(s, p) {
let answer = 0;
const https = require("https");
let base_url = `https://jsonmock.hackerrank.com/api/countries/search`;
@seresistvanandras
seresistvanandras / OBWS_2.md
Last active June 3, 2024 06:08
Hacking smart contracts for fun and profit

Hacking smart contracts for fun and profit

Description of the game

The goal of the game to break as many contracts as possible! Note: one of these contracts is a HONEYPOT! BE CAREFUL!!

Claim your Ropsten test ether here!

The contracts you need to break and their addresses: