Show Posts
|
Pages: [1]
|
Note that there are significant bugs that favor the author here: the function to withdraw the 'fees' doesn't reset the fees, so they can call it repeatedly to withdraw an unlimited amount from the contract. They can also suicide it at any time and take home the whole contents.
|
|
|
We need to create the same, but with any amounts.
Indeed this is interesting - lets see how it will work with diversified deposits
Alternative suggestion: If you required each payout to be the same, so each deposit is the payout multiplied by the number of existing users, each player would get their initial deposit back once the total number of players had doubled.
|
|
|
The current auction, for 0.34 ether, ends in about an hour, so far with no bids. It's not a lot, granted, but it's cheap - 1 finney or even less would take it home at this point.
|
|
|
Neat idea, but trivial to game: Anyone could write a contract that calls this one iff it would be the last player, and win every time.
That means you did not understand how it works (nor how contracts work). Not the last player wins! Read again ;-) I think you're misunderstanding what I'm suggesting. Pseudocode for the contract would look something like this: - Read playersPerRound and players.length from the target contract (these variables are public). - If we wouldn't be the last player, return. - Otherwise, look at the first byte of the current block hash, and base our 'guess' on that. Submit that to the contract. However, I think I'm mistaken - transactions can't access the hash of the block they're in, since it's only computed after the transactions run. It'd still be trivial for a miner to game this, though, by only including the transaction if it causes them to win.
|
|
|
Neat idea, but trivial to game: Anyone could write a contract that calls this one iff it would be the last player, and win every time.
|
|
|
Edit: The code seems to act as described, albeit it's rather hairy, inefficient, and poorly written.
Well I'm still learning here [/quote] If you want a quick codereview: - There's no need for the struct, since it's only got one element in it. - You don't actually need to store anything other than the most recent address. There's no need for an array here. - CurrentTime and current_Balance don't need to be storage variables. - 'now' doesn't change during the execution of the transaction, so there's no need to store it in a variable at all. - You never read from 'current_Balance', and it's always equal to this.balance, so there's no need to have that variable, either. - If you declare the relevant variables public, you don't need the accessor functions CT()/PT()/bal(). All that said, it seems conceptually sound, which is a step up over a lot of contracts in this forum.
|
|
|
Interesting, I was pondering something similar just now. Oy vey, though, 5 ether a play is pretty pricey! A much more interesting game, at least to me, would be more like 0.1 ether to play and a one hour timeout.
10% of every contribution seems a little steep as a fee, too.
Edit: The code seems to act as described, albeit it's rather hairy, inefficient, and poorly written.
|
|
|
Gj to you for winning the first auction Why would I need to do that, when I got a sweet 26 finney reward for putting up the initial stake? I admit, the bidding wasn't nearly as enthusiastic as anticipated.
|
|
|
First auction finished - the top bidder got 5 ether for a mere 0.15 ether!
A second auction has automatically started with 90% of the proceeds, for a rather less dramatic 0.34 ether, ending this time tomorrow.
|
|
|
30 minutes to go, and the top bid is only 0.05 ether - 50 finney!
|
|
|
Under 3 hours to go, and the top bid is just 20 finney! Someone's got to win the 5 ether, and at this rate it'll be a bargain. Now with a basic DApp website, too: etherauction.github.ioYup - I'm not trying to obscure what it is, though note that I put up a substantial stake myself, and 90% of the bids get rolled into a new auction. There's nothing to prevent people from acting rationally, and the 5 ether selling cheaply.
|
|
|
Top bid so far on this auction for 5 ether is just 1 finney!
|
|
|
This is an Ethereum implementation of the 'Dollar auction'. Players bid for a prize in Ether, with the top bidder taking home the full amount. The catch: both the top and second bidders have to pay. Don't be the second bidder! The first auction is for 5 ether. Auctions run for 24 hours, after which the winner gets paid out, and the top two bids are rolled over to start a new auction, less a 10% fee paid out to the seller who put up the initial stake. Payout is triggered by the first bid in a new auction, or by anyone calling endAuction. To play, send your bid to 0x6fd93c524553e05b3a1ac9291bde505d37252dfd. The full source of the contract, and the current state including top bidders and bid amounts can be seen here. Or, you can add the contract to your wallet by importing the interface: [{ "constant": true, "inputs": [], "name": "seller", "outputs": [{ "name": "", "type": "address" }], "type": "function" }, { "constant": true, "inputs": [], "name": "auctionValue", "outputs": [{ "name": "", "type": "uint256" }], "type": "function" }, { "constant": false, "inputs": [], "name": "bid", "outputs": [], "type": "function" }, { "constant": true, "inputs": [], "name": "highBidder", "outputs": [{ "name": "", "type": "address" }], "type": "function" }, { "constant": false, "inputs": [], "name": "acceptTransfer", "outputs": [], "type": "function" }, { "constant": true, "inputs": [], "name": "secondBidder", "outputs": [{ "name": "", "type": "address" }], "type": "function" }, { "constant": true, "inputs": [], "name": "expiresAt", "outputs": [{ "name": "", "type": "uint256" }], "type": "function" }, { "constant": true, "inputs": [], "name": "secondBid", "outputs": [{ "name": "", "type": "uint256" }], "type": "function" }, { "constant": true, "inputs": [], "name": "highBid", "outputs": [{ "name": "", "type": "uint256" }], "type": "function" }, { "constant": false, "inputs": [], "name": "lastAuction", "outputs": [], "type": "function" }, { "constant": false, "inputs": [{ "name": "recipient", "type": "address" }], "name": "transferOwnership", "outputs": [], "type": "function" }, { "constant": false, "inputs": [], "name": "endAuction", "outputs": [], "type": "function" }, { "inputs": [{ "name": "_duration", "type": "uint256" }], "type": "constructor" }] As of posting, there are no bids, meaning you can take home a cool 5 ether for a bid of just a few finney.
|
|
|
|