Skip to content

Instantly share code, notes, and snippets.

View federicosan's full-sized avatar

federicosan

View GitHub Profile
@federicosan
federicosan / Multicall.sol
Created March 22, 2022 04:25 — forked from 0xAlcibiades/Multicall.sol
A Pre EIP-1559 MEV/Multicall in pure Yul integrated with ApeBank and with Native GasTokens
// SPDX-License-Identifier: MIT
object "Multicall" {
code {
// Deploy the contract
// Store gas token burn cost in zero slot
sstore(0, 0)
sstore(1, 0)
sstore(2, 0)
datacopy(0x0, dataoffset("MulticallRuntime"), datasize("MulticallRuntime"))
@federicosan
federicosan / airdrop_farming.ipynb
Created February 7, 2022 04:59 — forked from 0xAlcibiades/airdrop_farming.ipynb
ENS Token Sybil Attack Analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@federicosan
federicosan / Sheepdog.sol
Created February 7, 2022 04:58 — forked from 0xAlcibiades/Sheepdog.sol
Trivial exploit for weak Pseudo Random Number Generation in the Wolf Game
// SPDX-License-Identifier: UNLICENSED
// It's trivially easy to exploit a weak PRNG based NFT.
// Just bundle this with a flashbots bundle where the mint occurs.
//
// It's also trivially easy to detect/prevent with a took like slither:
// https://github.com/crytic/slither/wiki/Detector-Documentation#weak-PRNG
pragma solidity ^0.8.0;
@federicosan
federicosan / Multisig.sol
Created December 26, 2021 04:33 — forked from z0r0z/Multisig.sol
Simple gas-optimized multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
error NotSigner();
@federicosan
federicosan / gist:b233544196630f78c90cf16160469aa6
Created April 18, 2018 01:31 — forked from glasmasin/gist:6737584
Google Apps Script to use mail merge the old fashioned way - to output merged Documents!
/**
* This script will output a mailmerge of documents.
* All document variables are of the form <<var_name>> (spaces are ok)
* Requires a spreadsheet with two sheets
* The first is the data table, the second has the template url in A1
* and the merged document's title in A2 (optional and can use data variables)
*
* With thanks to:
* drzaus: http://webapps.stackexchange.com/a/47255
* Google Apps Script Tutorial: Simple Mail Merge
<ul class="horizontal unstyled clearfix">
{% for link in linklists.main-menu.links %}
{% if linklists[link.handle] == empty %}
<li>
<a href="{{ link.url }}" class="{% if link.active %} current{% endif %}">
<span>{{ link.title }}</span></a>
</li>
{% else %}
<!-- Menu level 1 -->
<li class="dropdown"><a href="{{ link.url }}" class="{% if link.active %} current{% endif %}">
@federicosan
federicosan / shopify-sub.liquid
Created November 9, 2017 07:09 — forked from joe-dempsey/shopify-sub.liquid
Shopify menu with submenu
{% comment %} this is a barebones menu with submenu items for Shopify {% endcomment %}
{% comment %} see shopify docu for creating submenu items: https://help.shopify.com/manual/sell-online/online-store/menus-and-links#create-a-drop-down-menu {% endcomment %}
{% comment %} first assign the menu - this is the only thing you need to change {% endcomment %}
{% assign linklist = settings.collections_nav %}
{% comment %} in the above line change the collections_nav to the handle of your main naivgation {% endcomment %}
{% comment %} the code below will do the rest {% endcomment %}
@federicosan
federicosan / facebook-page-invite.js
Created November 5, 2017 22:33 — forked from guiliredu/facebook-page-invite.js
Facebook - Script to auto invite people who liked a page post do like the page
var buttons;
buttons = document.getElementsByClassName('_42ft');
for (var i = 0; i < buttons.length; i++) {
if(buttons[i].getAttribute('ajaxify') != null){
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){
buttons[i].click();
}
}
}
@federicosan
federicosan / inspiration
Created July 14, 2017 08:55 — forked from meodai/inspiration
Sexy Frontend
One-pager / Scroll:
- http://www.north2.net/
- http://10x16.com/
- http://www.hm.com/us/kenzo#inspiration
- http://www.stinkdigital.com/
- https://nameoflove.com/
- https://www.thened.com/
- https://thecreativeindependent.com/
- http://www.melville-design.com/
- http://designgest.com/