scientaster | 8 years ago | on: Square announces pilot program to accept Bitcoin
scientaster's comments
scientaster | 9 years ago | on: Show HN: /r/place backed by the Bitcoin blockchain
If it were fleshed out more it should probably return the ether to the last depositor instead of the purchaser.
Thanks for the feedback!; I'm tempted to turn this into an example Dapp later today.
scientaster | 9 years ago | on: Show HN: /r/place backed by the Bitcoin blockchain
The penny auction one is even easier:
bytes3[10000][10000] board;
function colorPixel(uint x, uint y, bytes3 color) onBoard(x, y) {
board[x][y] = color;
}
Users would only have to pay the gas cost of using the ethereum network, the contract wouldn't hold any funds itself. Again, it's pretty much whatever you make out of it. You're not really constrained when it comes to building in logic into these contracts, anything (logically) you can do with any other languages is possible here.scientaster | 9 years ago | on: Show HN: /r/place backed by the Bitcoin blockchain
contract Place {
struct Pixel {
bytes3 color;
uint lastPayment;
}
Pixel[10000][10000] board;
modifier onBoard(uint x, uint y) {
if (x > 10000 || y > 10000) {
throw;
}
_;
}
// Accepts funds, if the funds sent are greater than funds for that pixel last, change the color.
function colorPixel(uint x, uint y, bytes3 color) payable onBoard(x, y) {
Pixel p = board[x][y];
if (msg.value > p.lastPayment) {
msg.sender.send(p.lastPayment); // refund previous price of pixel
p.color = color; // set the color
p.lastPayment = msg.value; // set new cost to whatever the person sent in
} else {
throw;
}
}
}
May contain an error or two, but that's the general gist of it.scientaster | 9 years ago | on: Earn ETH by committing to open source projects
It's very powerful; but when the smart-contract world interfaces with the unpredictable outside sometimes the logic doesn't line up.
scientaster | 9 years ago | on: Earn ETH by committing to open source projects
When a pull request comes in that says it fixes that issue, the bot sees that. Through the smart contract it authorizes the package maintainer to disburse the funds to the fixer at the maintainer's discretion.