Post
Topic
Board Announcements (Altcoins)
Re: [ANN] Ellaism: Ethereum network with no premine and no contentious hard forks
by
Juudai
on 03/11/2017, 16:03:18 UTC
@ellaismer

Alright.

Here's a very simple DApp running on the ella blockchain, this is a proof of concept and everyone can participate and interact with it. I haven't had time to code the html so it can be hosted anywhere (true decentralization), but in the meantime it's an up and running smart contract.

Meet Ella Doubler @ 0x680e0eda8ab8cefd66c7a7ce5269520e223d5fcb

It essentially returns 12% of the amount you send whenever someone after you deposits. I know a project like this isn't the most appealing but I just wanted to get a proof of concept running on the ella blockchain, please don't bash me. However, the contract is completely decentralized and I have absolutely no access to the ella deposited into the contract's address.

Fee is 1% paid to the operator's address. If you want to interact with the contract simply send any amount of ella between 0.001 and 1. Any amount above 1 ella and below 0.001 ella will be counted as donation. I will repeat again, this is a proof of concept I don't even have a website coded yet, but I might code one if demand is in place.

Please only use amounts you can afford to spend, if anything goes wrong or a bug ensues somewhere direct it to me here, same applies for questions.

Code:
pragma solidity ^0.4.18;

contract ellaDoubler {
    
    address public owner; // the operator
    address[] private depositor; // depositors list
    uint[] private depositAmount;
    uint[] private toReceive;
    uint private depositToFee;
    uint public Fee; // value is a percentage (1%)
    uint public Payout; // value is a percentage (12%)
    uint public maximumDeposit; // maximum deposit to participate, surplus is counted as donation
    uint public minimumDeposit; // minimum deposit to participate, anything below is counted as donation
    uint public lineNumber;
    uint public usersWaitingInLine;

    
    function ellaDoubler() public { // constructor
        owner = msg.sender;
        Fee = 1;
        Payout = 12;
        maximumDeposit = 1000000000000000000;
        minimumDeposit = 10000000000000000;
        lineNumber = 0;
        usersWaitingInLine = 0;
    }
    
    function () private payable {
        if (msg.value > maximumDeposit || msg.value < minimumDeposit) {
            // user is donating
            if (msg.value > 0) {
                owner.transfer(msg.value);
            } else {
                return;
            }
        } else {
            depositToFee = msg.value;
            usersWaitingInLine++;
            depositor.push(msg.sender);
            depositAmount.push(msg.value);
            toReceive.push(msg.value + (msg.value / 100 * Payout));
            payOperatorFee(); // pay the fee to the Operator
            if (this.balance >= toReceive[lineNumber]) {
                depositor[lineNumber].transfer(toReceive[lineNumber]);
                lineNumber++;
                usersWaitingInLine--;
            }
        }
    }
    
    function nextInLine() public view returns (address, uint, uint) {
        return (depositor[lineNumber], toReceive[lineNumber], lineNumber);
    }
    
    function payOperatorFee() private returns (bool) {
        if (this.balance > 0) {
            owner.transfer(depositToFee / 100 * Fee);
            return true;
        } else {
            return false;
        }
    }
}