Skip to content

Instantly share code, notes, and snippets.

View alexvandesande's full-sized avatar
🤖
Preventing human machine conflicts

Alex Van de Sande alexvandesande

🤖
Preventing human machine conflicts
View GitHub Profile
// Name registrar using deposits
contract Deed {
// The Deed is a contract intended simply to hold ether
// It can be controlled only by the registrar and can only send ether back to the owner
address public owner;
address public bidder;
Registrar public registrar;
bytes32 public sealedBid;
bytes32 public hashedName;

.eth Registrar using only Deposits.md

This is an attempt of setting up a name registrar that use deposits instead of burning or token contributions and tries to optimize name utility and reduce domain squatting. Previous initiatives of charging a "rent" based on the market price with an yearly auction proved impopular with many developers as they believed the registrar wasn't delivering any value for the "tax" as well as worries that a sudden big auction could force someone unexpectedly to be forced to sell the name.

In order to start doing that let's define the problem:

Name squatting is defined as buying a name and not adding any value to it, just holding it expecting that domains names will become more valuable in the future. Let's assume that all name buyers have the intention of acquiring a name and make it more valuable over time, either by working on it as a business and adding value to the "brand", or by working to increase the chances of finding a

contract ethExchange {
address public public ethClassicWithdrawer;
address public public ethForkWithdrawer;
bool public accepted;
address public refundContract = '0xbf4ed7b27f1d666546e30d74d50d173d20bca754';
function ethExchange(uint amountToExchange) {
ethClassicWithdrawer = msg.sender;
}
contract VoteRegistration {
// stores the information about the current node.
// This variable can only be changed via a hard fork
bytes32 public forkHash = sha3('');
// stores the array of all registered voters
mapping (address => address) public voteContracts;
// checks if the lock is active
bool public active = false;
@alexvandesande
alexvandesande / forkvote.js
Last active June 24, 2016 20:49
Hard Fork Stake Vote
contract HardForkVote {
/*
There is a very important debate on the Ethereum Community on either
contracts should be truly immutable, or if there should be a social
consensus that allows some to be changed on extreme circunstances.
This contract allows the network to signal support for the decision
by having those in favor of a change commit not to move any funds
for a year, to prove their long term commitment to the project.
*/
[ { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "proposals", "outputs": [ { "name": "recipient", "type": "address", "value": "0x0000000000000000000000000000000000000000" }, { "name": "amount", "type": "uint256", "value": "0" }, { "name": "description", "type": "string", "value": "" }, { "name": "votingDeadline", "type": "uint256", "value": "0" }, { "name": "open", "type": "bool", "value": false }, { "name": "proposalPassed", "type": "bool", "value": false }, { "name": "proposalHash", "type": "bytes32", "value": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { "name": "proposalDeposit", "type": "uint256", "value": "0" }, { "name": "newCurator", "type": "bool", "value": false }, { "name": "yea", "type": "uint256", "value": "0" }, { "name": "nay", "type": "uint256", "value": "0" }, { "name": "creator", "type": "address", "value": "0x0000000000000000000000000000000000000000" } ], "type": "function" }, { "constant": false, "inputs": [ { "name": "_spender", "t
/*
GENERIC TOKEN CONTRACT
THIS IS NOT THE REFUND CODE
*/
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract owned {
@alexvandesande
alexvandesande / Refund.js
Last active June 21, 2016 19:33
A refund contract for the DAO, to be voted on by a updateContract (no hard fork required)
/*
CODE TO MAKE THE DAO INTO AN AUTOMATIC REFUND
*/
// A generic token contract
contract token {
mapping (address => uint256) public balanceOf;
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function mintToken(address target, uint256 mintedAmount);
@alexvandesande
alexvandesande / Proposal.js
Last active April 5, 2022 08:05
Proposal Framework for The DAO
/*
The contract is free software: you can redistribute it and/or modify
it under the terms of the GNU lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The contract is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@alexvandesande
alexvandesande / proposal.sol
Created June 4, 2016 21:02
Proposal Framework
/*
This file is part of the DAO.
The DAO is free software: you can redistribute it and/or modify
it under the terms of the GNU lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The DAO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of