Bitcoin Forum
November 14, 2024, 07:55:35 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ETH] NICE GUY TAX - "rounds based" ponzi with guaranteed pay-out in same round  (Read 431 times)
Sileniced (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile WWW
April 09, 2016, 12:23:02 AM
Last edit: April 09, 2016, 02:34:45 PM by Sileniced
 #1

https://i.imgur.com/eC8lDms.jpg

Nice Guy Tax is a new "rounds based" ponzi where investors in the same round gets guaranteed pay outs.

   Rules:
1   This ponzi consists of rounds of 10 investors all investing 9 ETH and receives 10 ETH back from the contract.
2   Every round has a "Nice Guy". 1 ETH per investor goes to the Nice Guy as "Nice Guy Tax".
3   Investor 1 to 8, of every round, gets paid out garantueed in the same round.
4   Investor 9 & 10, of the round, becomes "Nice Guys" In the upcoming rounds and will receive 10 ETH in "Nice Guy Tax" paid by investors.

Invest 9 ether to 0x56467e038871dc7f2a6180cdebe1702cef77285f in order to receive pay-out of 10 ether

First Nice guy: Me, much nice! I won't invest in my own contract any further, unless it goes like a train.
Source code: http://etherscan.io/address/0x56467e038871dc7f2a6180cdebe1702cef77285f#code
Beta contract to prove it works: http://etherscan.io/address/0x258d778e4771893758dfd3e7dd1678229320eeb5#internaltx
Ethereum Forum: https://forum.ethereum.org/discussion/6191/nice-guy-tax-rounds-based-ponzi-with-guaranteed-pay-out-in-same-round

JSON interface:
Code:
[ { "constant": true, "inputs": [ { "name": "", "type": "uint256", "index": 0, "typeShort": "uint", "bits": "256", "displayName": "", "template": "elements_input_uint" } ], "name": "niceGuys", "outputs": [ { "name": "addr", "type": "address", "value": "0x", "displayName": "addr" } ], "type": "function", "displayName": "nice Guys" }, { "constant": true, "inputs": [], "name": "payoutIndex", "outputs": [ { "name": "", "type": "uint256", "value": "0", "displayName": "" } ], "type": "function", "displayName": "payout Index" }, { "constant": true, "inputs": [], "name": "currentNiceGuyIndex", "outputs": [ { "name": "", "type": "uint256", "value": "0", "displayName": "" } ], "type": "function", "displayName": "current Nice Guy Index" }, { "constant": true, "inputs": [ { "name": "", "type": "uint256", "index": 0, "typeShort": "uint", "bits": "256", "displayName": "", "template": "elements_input_uint" } ], "name": "investors", "outputs": [ { "name": "addr", "type": "address", "value": "0x", "displayName": "addr" } ], "type": "function", "displayName": "investors" }, { "constant": true, "inputs": [], "name": "currentNiceGuy", "outputs": [ { "name": "", "type": "address", "value": "0x56f0bf1ff1c7526687fdf61b0e6889a105dfcfc5", "displayName": "" } ], "type": "function", "displayName": "current Nice Guy" }, { "constant": true, "inputs": [], "name": "investorIndex", "outputs": [ { "name": "", "type": "uint256", "value": "0", "displayName": "" } ], "type": "function", "displayName": "investor Index" }, { "inputs": [], "type": "constructor" } ]
Katatsuki
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile WWW
April 09, 2016, 12:24:43 AM
Last edit: April 09, 2016, 12:40:53 AM by Katatsuki
 #2

Haven't reviewed the code, but I like the concept. Good job Smiley

Edit: You might wanna re-release it. I think you're not sending the money back when it's not 9 (not sure if throw actually sends the money back since I've never used throw in this case; return is better to save gas).

Quote
//If your investment is NOT 9 ether, the smartcontract rejects it and you get it back.
        if (msg.value != 9 ether) {
            throw;
        }

It should be:

Quote
//If your investment is NOT 9 ether, the smartcontract rejects it and you get it back.
        if (msg.value != 9 ether) {
            msg.sender.send(msg.value);
            return;
        }

This could cause potential problems:

Quote
while (this.balance > 9 ether) {
            investors[payoutIndex].addr.send(10 ether);
            payoutIndex += 1;
        }

It should check if the balance is >= 10, because maybe the balance is between 9 and 10 (because of gas spent or possible errors, better to play it safe) and thus the contract won't have enough balance to make that transaction.

Sileniced (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile WWW
April 09, 2016, 12:36:16 AM
 #3

FIXED NEW CONTRACT: 0x56467e038871dc7f2a6180cdebe1702cef77285f
Quote
//If your investment is NOT 9 ether, the smartcontract rejects it and you get it back.
        if (msg.value != 9 ether) {
            msg.sender.send(msg.value);
            return;
        }
Quote
while (this.balance >= 10 ether) {
            investors[payoutIndex].addr.send(10 ether);
            payoutIndex += 1;
        }

Thank you so much for your kind words and feedback, it truly means a lot to me. I've fixed the contract as fast as I could, and fortunately I was fast enough.
Katatsuki
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile WWW
April 09, 2016, 12:41:41 AM
 #4

Thank you so much for your kind words and feedback, it truly means a lot to me. I've fixed the contract as fast as I could, and fortunately I was fast enough.
You're welcome, I also added an extra thing on my previous comment (still not done reviewing the code, I'm updating as I go).

Sileniced (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile WWW
April 09, 2016, 02:18:18 AM
 #5

Quote
(still not done reviewing the code, I'm updating as I go)
So do you think the code is bug free?
Katatsuki
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile WWW
April 09, 2016, 02:39:15 AM
 #6

Quote
(still not done reviewing the code, I'm updating as I go)
So do you think the code is bug free?
I can't be sure, I'd have to test it to know, but it seems fine.

Sileniced (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile WWW
April 09, 2016, 09:52:51 AM
 #7

Quote
I can't be sure, I'd have to test it to know

I'm building a new smart contract without fixed amounts, so it's cheaper to test the water. But that adds a little bit more to the mathematical challenge.

ps. Although, no one has invested in my contract. It still feels very good to be able to build such things. I feel like a coder  Cheesy Tongue
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!