Bitcoin Forum
July 04, 2024, 10:42:46 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Trustless Ethereum Triangular Number Pyramid Contracts - Check it out!  (Read 968 times)
houzihuobi (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
August 08, 2015, 01:44:27 AM
Last edit: August 11, 2015, 02:07:23 AM by houzihuobi
 #1

Trustless Ethereum Triangular Number Pyramid Contracts
https://i.imgur.com/0KP7LVC.jpg

These are the first ever verifiable pyramid schemes with provably known rules!

How it works: Each level has one more member than the previous one. Once a level fills up, each member in the preceding two layers gets half of their investment back. The remaining funds are distributed between all members in all of the preceding layers so that the members in the upper layers get a slightly larger amount.

In a geth console, type one of the four following commands

1 ether:
eth.sendTransaction({from:eth.accounts[0], to:"0x109c4f2ccc82c4d77bde15f306707320294aea3f", value:web3.toWei(1,"ether"),gas:500000})

10 ether:
eth.sendTransaction({from:eth.accounts[0], to:"0xa327075af2a223a1c83a36ada1126afe7430f955", value:web3.toWei(10,"ether"),gas:500000})

0.10 ether:
eth.sendTransaction({from:eth.accounts[0], to:"0xbaa54d6e90c3f4d7ebec11bd180134c7ed8ebb52", value:web3.toWei(0.1,"ether"),gas:500000})

100 ether:
eth.sendTransaction({from:eth.accounts[0], to:"0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64", value:web3.toWei(100,"ether"),gas:400000});

That's it! Make sure the amounts are precisely as written. Simply wait for other people to do the same, and watch your investment grow.

In order to see the current number of investors, type the following commands in the geth console:
 
Code:
var myschemeContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getNumInvestors","outputs":[{"name":"a","type":"uint256"}],"type":"function"},{"inputs":[],"type":"constructor"}]);
      
var c = myschemeContract.at("0x109c4f2ccc82c4d77bde15f306707320294aea3f")
      
c.getNumInvestors()

At the time of this posting, there are over 100 investors!

Anyone can verify that the code provided below is identical to the one in the Ethereum blockchain, by compiling it (with optimizations enabled), for example at: https://chriseth.github.io/browser-solidity/ and comparing the data with the output of:
eth.getCode("0x109c4f2ccc82c4d77bde15f306707320294aea3f")
 
SOLIDITY CODE:
Code:
contract MyScheme {
 
    uint treeBalance;
    uint numInvestorsMinusOne;
    uint treeDepth;
    address[] myTree;
 
    function MyScheme() {
        treeBalance = 0;
        myTree.length = 6;
        myTree[0] = msg.sender;
        numInvestorsMinusOne = 0;
    }
  
        function getNumInvestors() constant returns (uint a){
                a = numInvestorsMinusOne+1;
        }
  
        function() {
        uint amount = msg.value;
        if (amount>=1000000000000000000){
            numInvestorsMinusOne+=1;
            myTree[numInvestorsMinusOne]=msg.sender;
            amount-=1000000000000000000;
            treeBalance+=1000000000000000000;
            if (numInvestorsMinusOne<=2){
                myTree[0].send(treeBalance);
                treeBalance=0;
                treeDepth=1;
            }
            else if (numInvestorsMinusOne+1==myTree.length){
                    for(uint i=myTree.length-3*(treeDepth+1);i<myTree.length-treeDepth-2;i++){
                        myTree[i].send(500000000000000000);
                        treeBalance-=500000000000000000;
                    }
                    uint eachLevelGets = treeBalance/(treeDepth+1)-1;
                    uint numInLevel = 1;
                    for(i=0;i<myTree.length-treeDepth-2;i++){
                        myTree[i].send(eachLevelGets/numInLevel-1);
                        treeBalance -= eachLevelGets/numInLevel-1;
                        if (numInLevel*(numInLevel+1)/2 -1== i){
                            numInLevel+=1;
                        }
                    }
                    myTree.length+=treeDepth+3;
                    treeDepth+=1;
            }
        }
                treeBalance+=amount;
    }
}

houzihuobi (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
August 10, 2015, 01:34:35 AM
 #2

There is now a 100 ether pyramid:

contract at 0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64

eth.sendTransaction({from:eth.accounts[0], to:"0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64",value:web3.toWei(100,"ether"),gas:400000});


to join.

Currently there are 11 investors:
var myschemeContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getNumInvestors","outputs":[{"name":"a","type":"uint256"}],"type":"function"},{"inputs":[],"type":"constructor"}]);
var c = myschemeContract.at("0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64")
> c.getNumInvestors()
'11'

This one has already paid out the first people, Join today!
houzihuobi (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
August 10, 2015, 03:40:21 AM
 #3

There is now a 100 ether pyramid:

contract at 0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64

eth.sendTransaction({from:eth.accounts[0], to:"0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64",value:web3.toWei(100,"ether"),gas:400000});


to join.

Currently there are 11 investors:
var myschemeContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getNumInvestors","outputs":[{"name":"a","type":"uint256"}],"type":"function"},{"inputs":[],"type":"constructor"}]);
var c = myschemeContract.at("0x020522bf9b8ed6ff41e2fa6765a17e20e2767d64")
> c.getNumInvestors()
'11'

This contract now has 15 investors, get in early!
HCLivess
Legendary
*
Offline Offline

Activity: 2114
Merit: 1090


=== NODE IS OK! ==


View Profile WWW
August 10, 2015, 08:42:56 AM
 #4

good job, keep it up Cheesy

fartbags
Legendary
*
Offline Offline

Activity: 1190
Merit: 1004


View Profile
August 10, 2015, 09:26:52 PM
 #5



This is so dumb. Why would you ever join an existing Pyramid Contract?

Clearly you would want to make a new Pyramid Contract and be the 1st person in on it.... or even better yet, be the owner of the first 100 different funds sent into it!



houzihuobi (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
August 11, 2015, 02:09:15 AM
 #6



This is so dumb. Why would you ever join an existing Pyramid Contract?

Clearly you would want to make a new Pyramid Contract and be the 1st person in on it.... or even better yet, be the owner of the first 100 different funds sent into it!




Because there is no leader, there is no one to run, the code is run by the ethereum block chain. Its really awesome when you think about it.
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!