Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabian Vogelsteller frozeman

View GitHub Profile
@frozeman
frozeman / isValidSignature.sol
Created Jun 25, 2020
Signature verification in solidity, taken from 0x
View isValidSignature.sol
/// @dev Verifies that a hash has been signed by the given signer.
/// @param hash Any 32 byte hash.
/// @param signerAddress Address that should have signed the given hash.
/// @param signature Proof that the hash has been signed by signer.
/// @return True if the address recovered from the provided signature matches the input signer address.
function isValidSignature(
bytes32 hash,
address signerAddress,
bytes memory signature
)
@frozeman
frozeman / ricoABI.json
Created Apr 29, 2020
rICO ABI - april 2020
View ricoABI.json
[
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
@frozeman
frozeman / web3changes.md
Last active Apr 15, 2020
web3.js API changes
View web3changes.md

TODO: update web3.js examples ?

  • uses BN instead of BigNumber
  • added websockets and new events for these providers (web3.currentProvider.on 'connect', 'end', 'error', 'timeout')
  • changed web3.eth.sendRawTransaction -> web3.eth.sendSignedTransaction
  • added web3.eth.subscription
    • web3.eth.subscription('logs', {address: '0x12', topics: [], fromBlock: ''}) allows only fromBlock, use web3.eth.getPastLogs for a specifc range of past blocks.
    • subscriptions return events like:
      • for "logs": "error", "log", "deleted/reverted"
      • for syncing: "error", "started", "processing", "ended"
@frozeman
frozeman / chat.js
Created Jun 19, 2017 — forked from bas-vk/chat.js
whisper chat demo
View chat.js
var chat = {
username: "<not set>",
topic: "0xfeedbabe",
key: "",
identity: "",
pollInterval: null,
filter: null,
setUsername: function(name) {
this.username = name;
View test.js
Refundable ICO
Test 1
allocation phase
--------
blockNumber: 0
Current Flow: 0.1
investorETH: 100
projectETH: 0
available for project: 0
ETH in RICO: 100
@frozeman
frozeman / token.md
Last active Apr 24, 2019
Token proposal
View token.md
@frozeman
frozeman / rico.md
Last active Jan 3, 2019
Reversible ICO - RICO
View rico.md

Reversible ICO

To increase fairness and responsibility in the ICO space, we propose a new model for an ICO, which we call a ”Reversible ICO” (RICO). This type of ICO improves the power balance between coin buyer and project by flowing funds slowly to the project and allowing coin buyers to withdraw their funds at any point in time.

The ERC 20 Token Standard [Fab] spurred a new era of projects that run ICOs on th Ethereum Blockchain. This is mainly due to the flexibility of a smart contract interface standard, meaning it only defines how to interact with it, but not how it should internally work. This flexibility allows ERC 20 tokens to be used in all kind of smart contract based protocol, and be issued by other smart contracts, like an ICO smart contract.

Current ICOs deploy a smart contract that receives ETH and return tokens (cryptocurrencies, assets, utility tokens, protocol tokens, access tokens, etc.) based on a set ratio. This ratio is sometimes changing over time while the ICO is running, and ma

@frozeman
frozeman / mistweb3.js
Last active Dec 9, 2018
Mist web3 loading proposal
View mistweb3.js
/*
Basically "web3" comes from Mist,
but "Web3" CAN come from the dapp.
A Dapp has 3 ways to use web3.
2. and 3. would work when in Mist and outside.
*/
// 1. simply use, web3 comes already defined
@frozeman
frozeman / ENSresolving.md
Created Mar 6, 2017
ENS resolving in Mist
View ENSresolving.md
  • eth://inigomontoya.eth -> calls resolver.addr() -> shows account page with balance or something
  • http://inigomontoya.eth -> calls resolver.a() -> will resolve a normal DNS ip
  • bzz://inigomontoya.eth -> calls resolver.multiHash() -> will resoslve using swarm
  • ipfs://inigomontoya.eth -> calls resolver.multiHash() -> will resoslve using ipfs
  • inigomontoya.eth -> will default to swarm and calls resolver.multiHash() -> will resoslve using swarm
@frozeman
frozeman / createContract.js
Last active Sep 5, 2018
Deploy contracts on Ethereum and reliable get the contract address
View createContract.js
// -> Soldity
// **********
// Your Soldity contract
event Created(bytes32 indexed identifier);
contract MyContract {
function MyContract(bytes32 identifier) {
Created(identifier);
}
You can’t perform that action at this time.