Skip to content

Instantly share code, notes, and snippets.

View theethernaut's full-sized avatar

Alejandro Santander theethernaut

View GitHub Profile
{
"public_identifier": "johnrmarty",
"profile_pic_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/johnrmarty/profile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20230807%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20230807T011526Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=2966fb9cd36c8e26a3fef8efc442e524b969c2a7868d019cce513b7517dbb668",
"background_cover_image_url": null,
"first_name": "John",
"last_name": "Marty",
"full_name": "John Marty",
"follower_count": null,
"occupation": "Co-Founder at FF Real Estate",
"headline": "LinkedIn Top Voice",
pragma solidity ^0.4.24;
contract BasicToken {
uint256 totalSupply_;
mapping(address => uint256) balances;
constructor(uint256 _initialSupply) public {
totalSupply_ = _initialSupply;
balances[msg.sender] = _initialSupply;
608060405234801561001057600080fd5b5060405160208061021783398101604090815290516000818155338152600160205291909120556101d1806100466000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318160ddd811461005b57806370a0823114610082578063a9059cbb146100b0575b600080fd5b34801561006757600080fd5b506100706100f5565b60408051918252519081900360200190f35b34801561008e57600080fd5b5061007073ffffffffffffffffffffffffffffffffffffffff600435166100fb565b3480156100bc57600080fd5b506100e173ffffffffffffffffffffffffffffffffffffffff60043516602435610123565b604080519115158252519081900360200190f35b60005490565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b600073ffffffffffffffffffffffffffffffffffffffff8316151561014757600080fd5b3360009081526001602052604090205482111561016357600080fd5b503360009081526001602081905260408083208054859003905573ffffffffffffffffffffffffffffffffffffffff85168352909120805483019055929150505600a165627a7a72305820a5d999f4459642872a29be
000 PUSH1 80
002 PUSH1 40
004 MSTORE
005 CALLVALUE
006 DUP1
007 ISZERO
008 PUSH2 0010
011 JUMPI
012 PUSH1 00
014 DUP1
@theethernaut
theethernaut / create_dao.sh
Last active November 27, 2019 22:10
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.
#!/bin/bash
set -x
set -e
lastWordAtLine() {
tail -$1 | head -1 | grep -oE '[^ ]+$'
}
# Identify main account
@theethernaut
theethernaut / Hasher.sol
Created September 5, 2019 20:48
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=
/*
* SPDX-License-Identitifer: MIT
*/
pragma solidity ^0.4.24;
contract APMNamehash {
string pm = "aragonpm";
@theethernaut
theethernaut / Hasher.sol
Created September 5, 2019 15:51
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=
/*
* 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"))));
@theethernaut
theethernaut / LotsaValues.sol
Created August 7, 2019 13:37
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=
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;

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:

@theethernaut
theethernaut / BadError.sol
Created April 16, 2019 21:11
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=
pragma solidity ^0.5.0;
contract BadError {
function test() public payable {
require(address(this).balance < msg.value + 1);
msg.sender.transfer(msg.value + 1);
}
}