Skip to content

Instantly share code, notes, and snippets.

Avatar
🦅
Fight for freedom

Jorge Izquierdo izqui

🦅
Fight for freedom
View GitHub Profile
@izqui
izqui / forwarder.sol
Last active Mar 30, 2019
Very cheap to deploy (66k gas) forwarder contracts that can clone any contract and still have their own storage
View forwarder.sol
// Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/
// Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/
// Credits to Jordi Baylina for this way of deploying contracts https://gist.github.com/jbaylina/e8ac19b8e7478fd10cf0363ad1a5a4b3
// Forwarder is slightly modified to only return 256 bytes (8 normal returns)
// Deployed Factory in Kovan: https://kovan.etherscan.io/address/0xaebc118657099e2110c90494f48b3d21329b23eb
// Example of a Forwarder deploy using the Factory: https://kovan.etherscan.io/tx/0xe995dd023c8336685cb819313d933ae8938009f9c8c0e1af6c57b8be06986957
// Just 66349 gas per contract
View burn-and-prosope.sol
import "./ERC20.sol";
interface ApproveAndCallReceiver {
function receiveApproval(address _from, uint256 _amount, address _token, bytes memory _data) public;
}
contract BurnAndPropose is ApproveAndCallReceiver {
ERC20 constant public ANT = ERC20(0x960b236A07cf122663c4303350609A66A7B288C0);
address public voting;
uint256 public burn;
@izqui
izqui / ActorApp.sol
Last active Jul 27, 2018
Prototype of Aragon app that can be used for interacting with other protocols and external contracts. 🚨Unaudited and experimental code, do not deploy to production!
View ActorApp.sol
pragma solidity 0.4.18;
import "./Vault.sol";
contract Actor is Vault {
bytes32 constant public PERFORM_ACTION_ROLE = keccak256("PERFORM_ACTION_ROLE");
bytes32 constant public RETURN_TO_PARENT_ROLE = keccak256("RETURN_TO_PARENT_ROLE");
bytes4 constant internal ERC20_TRANSFER_SIG = 0xa9059cbb; // bytes4(keccak256("transfer(address,uint256)"))
@izqui
izqui / account-proxy.sol
Last active Jun 17, 2018
Quick spike to demonstrate a generic account proxy pattern and a specific implementation for cold/hot wallets. Not reviewed, use it at your own risk.
View account-proxy.sol
contract AccountProxy {
event Fwded(address indexed to, uint256 value, bytes calldata, bool succeeded);
// must be implemented by super contract
function canFwd(address who, address to, uint256 value, bytes calldata) public view returns (bool);
function () payable {} // allow to deposit eth
function fwd(address to, uint256 value, bytes calldata) external {
require(canFwd(msg.sender, to, value, calldata));
@izqui
izqui / evm_opening.md
Last active May 3, 2018
Senior Solidity/EVM/Ethereum opening at Aragon
View evm_opening.md

Senior Solidity/EVM/Ethereum opening at Aragon

We are looking for an Ethereum wizard to work with us on Aragon Core and the future Aragon Network.

Conditions:

  • Fulltime commitment. Side projects and open source are accepted (and encouraged).
  • Completely remote position, no relocation required.
  • Very competitive and negotiable compensation.
  • You decide how to allocate your salary in USD, ETH or ANT. Rates will be revisited every 6 months.
@izqui
izqui / channels.json
Created Oct 11, 2015
Spanish TV Channels
View channels.json
[
[
"1",
"sp",
"es",
"0",
"100",
"La 1",
"i_tve1.png",
"http://iphonelive.rtve.es/LA1_LV3_IPH/LA1_LV3_IPH.m3u8",
View counter.sol
library CounterLib {
struct Counter { uint i; }
function incremented(Counter storage self) returns (uint) {
return ++self.i;
}
}
contract CounterContract {
using CounterLib for CounterLib.Counter;
View gist:bd3afb85f2b97c5d7f150cc873bad432
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
d5a097877b835c71581d1af86b333ffc5a207923bc2047c417e7af0c3d89dea5
-----BEGIN PGP SIGNATURE-----
wsFcBAEBCAAQBQJZ8KPVCRCeAcUjFK2zTAAAChwQAKqPRl++r3Dy9bFB8CeKD3Cz
cuLnWzSmKyHbqfV4zHdRGk2n76iuuOy/ZSciGOqtgLCOctfIRwlSLR/WKR3sp50k
SDQrij20326nwQsVp/FwcQharp6fBSBu8j4iKWGMkQuYRu8Q2qVEFL5zYKT1OIZ+
yaErpK1ozAVbcyR2Ou1ltWLDwWy9d0crlfXI2ZgvmjBKa0//Kg8CdE4uJAMajT8e
View fix_test.js
it('fixes', () => {
return BrokenContract.new()
.then(c => {
contract = c
return contract.broken()
})
.then(broken => {
assert.equal(broken, true)
return contract.executeCode(Fixer.binary)
})
View gist:527649e48ba3b6a087470f09db267376
contract Fixer is BrokenContract {
function execute(address fixer) {
broken = false;
}
}
You can’t perform that action at this time.