Skip to content

Instantly share code, notes, and snippets.


Alejandro Santander ajsantander

View GitHub Profile
ajsantander / birthday-bet-testoutput
Created Jun 22, 2017
Unit test output for the birthday-bet smart contract on 2017/06/21
View birthday-bet-testoutput
Compiling ./contracts/BetOnDate.sol...
Contract: BetOnDate(BetTests)
✓ should accept funds from the user when a valid bet is made (521ms)
✓ should reject and return funds from the user when an invalid bet is attempted (wrong unitBet) (569ms)
✓ should accept a number of valid bets (559ms)
✓ shoud not allow invalid bet refunds to be exploited to deplete the contracts balance (493ms)
✓ should reject bets with an invalid amount (56ms)
✓ should allow players to only bet once (53ms)
View rinkeby
ajsantander / proof_of_ownership.js
Created Aug 28, 2017
Simple demonstration of how to do a "proof of ownership" in web3
View proof_of_ownership.js
var EthUtil = require('ethereumjs-util');
var Web3 = require('web3');
var provider = new Web3.providers.HttpProvider('http://localhost:8545');
var web3 = new Web3(provider);
// Client side (user signs a message) ------------------------------
// User's keys
var privKey = '0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200';
var pubKey = '0xdf08f82de32b8d460adbe8d72043e3a7e25a3b39';

Keybase proof

I hereby claim:

  • I am ajsantander on github.
  • I am ajsantander ( on keybase.
  • I have a public key whose fingerprint is 1484 F900 8ACA EEF1 A9D6 8E7F 4416 88F3 6A75 7687

To claim this, I am signing this object:

# initialization file (not found)
View BasicToken.sol
pragma solidity ^0.4.24;
contract BasicToken {
uint256 totalSupply_;
mapping(address => uint256) balances;
constructor(uint256 _initialSupply) public {
totalSupply_ = _initialSupply;
balances[msg.sender] = _initialSupply;
View BasicToken.asm
000 PUSH1 80
002 PUSH1 40
006 DUP1
008 PUSH2 0010
012 PUSH1 00
014 DUP1
View BasicToken.evm
View BasicToken.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ModifierOverride.sol
pragma solidity ^0.4.24;
contract Ownable {
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);