This contract is not yet documented
Know something about this contract? Switch to the History tab and suggest an edit to help preserve Ethereum history.
Key Facts
Source Verified
Source code and compiler settings published by Alex Van de Sande (avsa). Converts Unicorn tokens into Unicorn Meat through a one-way grinder mechanism.
Homestead Era
The first planned hard fork. Removed the canary contract, adjusted gas costs.
Bytecode Overview
Verified Source Available
Source code published by the original contract author.
View Verification ProofShow source code (Solidity)
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
if (msg.sender != owner) throw;
_
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
contract MeatConversionCalculator is owned {
uint public amountOfMeatInUnicorn;
uint public reliabilityPercentage;
/* generates a number from 0 to 2^n based on the last n blocks */
function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) {
uint n = 0;
for (uint i = 0; i < size; i++){
if (uint(sha3(block.blockhash(block.number-i-1), seed ))%2==0)
n += 2**i;
}
return n;
}
function MeatConversionCalculator(
uint averageAmountOfMeatInAUnicorn,
uint percentOfThatMeatThatAlwaysDeliver
) {
changeMeatParameters(averageAmountOfMeatInAUnicorn, percentOfThatMeatThatAlwaysDeliver);
}
function changeMeatParameters(
uint averageAmountOfMeatInAUnicorn,
uint percentOfThatMeatThatAlwaysDeliver
) onlyOwner {
amountOfMeatInUnicorn = averageAmountOfMeatInAUnicorn * 1000;
reliabilityPercentage = percentOfThatMeatThatAlwaysDeliver;
}
function calculateMeat(uint amountOfUnicorns) constant returns (uint amountOfMeat) {
uint rnd = multiBlockRandomGen(uint(sha3(block.number, now, amountOfUnicorns)), 10);
amountOfMeat = (reliabilityPercentage*amountOfUnicorns*amountOfMeatInUnicorn)/100;
amountOfMeat += (1024*(100-reliabilityPercentage)*amountOfUnicorns*amountOfMeatInUnicorn)/(rnd*100);
}
}External Links
Related contracts
Association (Mist D.A.O.)
Same deployerA token-weighted governance contract deployed by Avsa on Dec 3, 2015, using MistCoin as voting shares. 0.1 ETH remains locked after 10 years.
0x8d554c...d9b8dcDecember 3, 2015Congress
Same deployerAlex Van de Sande's Congress DAO from Dec 28, 2015: on-chain voting with member registry (mapping) and configurable quorum.
0xb3d47f...7c6c0cDecember 28, 2015Congress
Same deployerAlex Van de Sande's Congress DAO from Dec 28, 2015: on-chain voting system for proposals with configurable quorum and majority threshold.
0x7f6b46...03f101December 28, 2015Congress
Same deployerAlex Van de Sande's Congress DAO from Dec 28, 2015: on-chain voting system for proposals with configurable quorum and majority threshold.
0x1e5cbb...b7ff63December 28, 2015Doge-ETH Bounty DAO
Same deployerThe Doge-Ethereum Bounty DAO created by avsa on Dec 28, 2015. Funded over 5,400 ETH in bridge development, holds 50,000 MistCoin. Active 2015-2021.
0xdbf03b...c8c6fbDecember 28, 2015Unicorns
Same deployerUnicorns (๐ฆ) token by avsa โ 1830B variant A. Source recovered by bytecode analysis, verified on Etherscan and Sourcify.
0x1a3970...dd1076February 11, 2016