Skip to content

Instantly share code, notes, and snippets.

Avatar

Alejandro Santander ajsantander

View GitHub Profile
@ajsantander
ajsantander / create_dao.sh
Last active Nov 27, 2019
Aragon app installers using EVM scripts, bundling multiple arbitrary transactions into a single vote. Note: Requires that you use the #encode-commands branch of aragon-cli.
View create_dao.sh
#!/bin/bash
set -x
set -e
lastWordAtLine() {
tail -$1 | head -1 | grep -oE '[^ ]+$'
}
# Identify main account
@ajsantander
ajsantander / Hasher.sol
Created Sep 5, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.c082d0b4.js&optimize=false&gist=
View Hasher.sol
/*
* SPDX-License-Identitifer: MIT
*/
pragma solidity ^0.4.24;
contract APMNamehash {
string pm = "aragonpm";
@ajsantander
ajsantander / Hasher.sol
Created Sep 5, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.c082d0b4.js&optimize=false&gist=
View Hasher.sol
/*
* SPDX-License-Identitifer: MIT
*/
pragma solidity ^0.4.24;
contract APMNamehash {
/* Hardcoded constants to save gas
bytes32 internal constant APM_NODE = keccak256(abi.encodePacked(ETH_TLD_NODE, keccak256(abi.encodePacked("aragonpm"))));
@ajsantander
ajsantander / LotsaValues.sol
Created Aug 7, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
View LotsaValues.sol
pragma solidity ^0.5.0;
contract Configuration {
uint256 public val1 = 1;
uint256 public val2 = 2;
uint256 public val3 = 3;
uint256 public val4 = 4;
uint256 public val5 = 5;
uint256 public val6 = 6;
uint256 public val7 = 7;
View keybase.md

Keybase proof

I hereby claim:

  • I am ajsantander on github.
  • I am ajsantander (https://keybase.io/ajsantander) on keybase.
  • I have a public key whose fingerprint is A6E1 E886 5788 3183 598C A02B D50A 71EE 4A4C AF5F

To claim this, I am signing this object:

@ajsantander
ajsantander / BadError.sol
Created Apr 16, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.0+commit.1d4f565a.js&optimize=false&gist=
View BadError.sol
pragma solidity ^0.5.0;
contract BadError {
function test() public payable {
require(address(this).balance < msg.value + 1);
msg.sender.transfer(msg.value + 1);
}
}
@ajsantander
ajsantander / Loopy.sol
Created Apr 10, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
View Loopy.sol
pragma solidity ^0.5.0;
contract Loopy {
// 7750 gas
// 5732 gas (optimized)
function loop_1() public pure returns (uint acum) {
for(uint i = 0; i < 100; i++) {
acum++;
}
@ajsantander
ajsantander / Changeling.sol
Created Apr 4, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
View Changeling.sol
pragma solidity ^0.5.7;
import "./ImplementationProvider.sol";
contract Changeling {
constructor(address implementationProvider) public {
// Request the current implementation address from the provider.
address implementation = ImplementationProvider(implementationProvider).getImplementation();
@ajsantander
ajsantander / Changeling.sol
Last active Apr 10, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
View Changeling.sol
pragma solidity ^0.5.7;
import "./ImplementationProvider.sol";
contract Changeling {
constructor(address implementationProvider) public {
// Request the current implementation address from the provider.
address implementation = ImplementationProvider(implementationProvider).implementation();
View vouching-deploy-log-1.txt
vouching-deploy-scripts*!+1› »»»» npm run dodathing-ropsten 0|17:08:13
> zos-vouching@2.0.0-alpha.1 dodathing-ropsten /home/ajs/zos/packages/vouching
> npm run prepare && npm run deploy-ropsten && npm run create-ropsten && npm run configure-ropsten && npm run validate-ropsten
> zos-vouching@2.0.0-alpha.1 prepare /home/ajs/zos/packages/vouching
> rm -rf lib && babel src --out-dir lib
src/bin/configure.js -> lib/bin/configure.js