Skip to content

Instantly share code, notes, and snippets.

View DanteAlabastro's full-sized avatar

Dante Alabastro DanteAlabastro

View GitHub Profile
@DanteAlabastro
DanteAlabastro / cipher.py
Created November 1, 2018 20:22
A Python creation of the de Vigenére cipher
letter = 'a'
n = 1
# input - strip white space and punctuation. all lowercase.
# key
key = 'test'
# key as list
keyL = list(key)
@DanteAlabastro
DanteAlabastro / mapping.sol
Last active October 8, 2018 21:25
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.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.25;
contract Mapping{
mapping (string => address) _Address;
mapping (string => uint256) _Balance;
mapping (string => bool) _Lock;
event broadcast( string );
@DanteAlabastro
DanteAlabastro / Distribution(Collected).sol
Last active October 17, 2018 22:10
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.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.25;
/* Welcome to my submission for EthSF!
This is a Payroll System built for ether miners.
I hope you enjoy. */
// # Now collected in one contract! # //
// # And hopefully less overflows! # //
//github: https://github.com/DanteAlabastro
@DanteAlabastro
DanteAlabastro / test.sol
Last active October 5, 2018 20:47
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.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.25;
/*Test Solidity Upload*/
contract test{
uint number = 8;
function WhatNumber()public view returns(uint){
return number;
}
}
@DanteAlabastro
DanteAlabastro / OnOff.sol
Last active October 5, 2018 05:48
An owner lockable contract.
pragma solidity ^0.4.21;
contract OnOff{
bool public kill_switch = false;
address Owner = msg.sender;
modifier IsOwner(){
require(msg.sender == Owner);
_;
@DanteAlabastro
DanteAlabastro / Visitors Log.sol
Last active October 9, 2018 05:31
I want to create a publicly view able and write able Visitors Log saved onto the blockchain. It will store a message, the time written, and the senders address. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.25;
contract VisitorsLog{
uint logCount = 0;
/* Create Struct */
struct Guest{
string _note;
@DanteAlabastro
DanteAlabastro / Sha3BruteForce.py
Created September 13, 2018 05:05
A brute force of Sha3 uint8 hashes. This was created to solve the Capture the Ether problem, "Guess the secret number". It compares the hashed value of all uint8 values against the Sha3/Keccak256 hash of the "secret number".
from web3 import *
from hexbytes import *
# ^ HexBytes allows for the type identifier.
# Loop through all uint8 values, 0-255.
for i in range(0,256):
# It is important to hash the value the same way Solidity would.
# You must declare the value as a uint8 as it will change the resulting hash.
a = Web3.soliditySha3(['uint8'],[i])
# Unneccary but provides nice feedback. Does not print value as hexbyte!