commit
312d82eb58
25 changed files with 5750 additions and 0 deletions
@ -0,0 +1,83 @@ |
|||||||
|
# Python |
||||||
|
__pycache__/ |
||||||
|
*.py[cod] |
||||||
|
*$py.class |
||||||
|
*.so |
||||||
|
.Python |
||||||
|
build/ |
||||||
|
develop-eggs/ |
||||||
|
dist/ |
||||||
|
downloads/ |
||||||
|
eggs/ |
||||||
|
.eggs/ |
||||||
|
lib/ |
||||||
|
lib64/ |
||||||
|
parts/ |
||||||
|
sdist/ |
||||||
|
var/ |
||||||
|
wheels/ |
||||||
|
pip-wheel-metadata/ |
||||||
|
share/python-wheels/ |
||||||
|
*.egg-info/ |
||||||
|
.installed.cfg |
||||||
|
*.egg |
||||||
|
|
||||||
|
# Virtual environments |
||||||
|
.env |
||||||
|
.venv |
||||||
|
env/ |
||||||
|
venv/ |
||||||
|
ENV/ |
||||||
|
env.bak/ |
||||||
|
venv.bak/ |
||||||
|
|
||||||
|
# IDE |
||||||
|
.vscode/ |
||||||
|
.idea/ |
||||||
|
*.swp |
||||||
|
*.swo |
||||||
|
*~ |
||||||
|
|
||||||
|
# OS |
||||||
|
.DS_Store |
||||||
|
.DS_Store? |
||||||
|
._* |
||||||
|
.Spotlight-V100 |
||||||
|
.Trashes |
||||||
|
ehthumbs.db |
||||||
|
Thumbs.db |
||||||
|
|
||||||
|
# Docker |
||||||
|
.dockerignore |
||||||
|
|
||||||
|
# Temporary files |
||||||
|
*.tmp |
||||||
|
*.temp |
||||||
|
temp/ |
||||||
|
tmp/ |
||||||
|
|
||||||
|
# Deployment artifacts |
||||||
|
deployment-* |
||||||
|
*.tar.gz |
||||||
|
*.zip |
||||||
|
|
||||||
|
# Logs |
||||||
|
*.log |
||||||
|
logs/ |
||||||
|
|
||||||
|
# Node modules (if any) |
||||||
|
node_modules/ |
||||||
|
|
||||||
|
# Environment variables |
||||||
|
.env.local |
||||||
|
.env.production |
||||||
|
.env.test |
||||||
|
|
||||||
|
# Backup files |
||||||
|
*.bak |
||||||
|
*.backup |
||||||
|
|
||||||
|
# Website specific |
||||||
|
website/deployment-* |
||||||
|
website/*.tar.gz |
||||||
|
website/*.zip |
||||||
@ -0,0 +1,463 @@ |
|||||||
|
// SPDX-License-Identifier: MIT |
||||||
|
pragma solidity ^0.8.0; |
||||||
|
|
||||||
|
/** |
||||||
|
* @title PoWHD Style Pyramid Contract |
||||||
|
* @dev Educational example showing how pyramid schemes work on Ethereum |
||||||
|
* WARNING: This is for educational purposes only. Pyramid schemes are illegal in many jurisdictions. |
||||||
|
*/ |
||||||
|
contract PoWHDExample { |
||||||
|
|
||||||
|
/*================================= |
||||||
|
= MODIFIERS = |
||||||
|
=================================*/ |
||||||
|
|
||||||
|
// Only people with tokens |
||||||
|
modifier onlyBagholders() { |
||||||
|
require(myTokens() > 0); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
// Only people with profits |
||||||
|
modifier onlyStronghands() { |
||||||
|
require(myDividends(true) > 0); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
/*============================== |
||||||
|
= EVENTS = |
||||||
|
==============================*/ |
||||||
|
|
||||||
|
event onTokenPurchase( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 incomingEthereum, |
||||||
|
uint256 tokensMinted, |
||||||
|
address indexed referredBy |
||||||
|
); |
||||||
|
|
||||||
|
event onTokenSell( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 tokensBurned, |
||||||
|
uint256 ethereumEarned |
||||||
|
); |
||||||
|
|
||||||
|
event onReinvestment( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 ethereumReinvested, |
||||||
|
uint256 tokensMinted |
||||||
|
); |
||||||
|
|
||||||
|
event onWithdraw( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 ethereumWithdrawn |
||||||
|
); |
||||||
|
|
||||||
|
/*===================================== |
||||||
|
= CONFIGURABLES = |
||||||
|
=====================================*/ |
||||||
|
|
||||||
|
string public name = "PoWHD"; |
||||||
|
string public symbol = "P3D"; |
||||||
|
uint8 constant public decimals = 18; |
||||||
|
uint8 constant internal dividendFee_ = 10; // 10% dividend fee |
||||||
|
uint8 constant internal referralFee_ = 3; // 3% referral fee |
||||||
|
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; |
||||||
|
uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; |
||||||
|
uint256 constant internal magnitude = 2**64; |
||||||
|
|
||||||
|
/*================================ |
||||||
|
= DATASETS = |
||||||
|
================================*/ |
||||||
|
|
||||||
|
// Amount of tokens for each address (scaled number) |
||||||
|
mapping(address => uint256) internal tokenBalanceLedger_; |
||||||
|
mapping(address => uint256) internal referralBalance_; |
||||||
|
mapping(address => int256) internal payoutsTo_; |
||||||
|
uint256 internal tokenSupply_ = 0; |
||||||
|
uint256 internal profitPerShare_; |
||||||
|
|
||||||
|
/*======================================= |
||||||
|
= PUBLIC FUNCTIONS = |
||||||
|
=======================================*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* Converts all incoming ethereum to tokens for the caller, and passes down the referral address (if any) |
||||||
|
*/ |
||||||
|
function buy(address _referredBy) public payable returns(uint256) { |
||||||
|
purchaseTokens(msg.value, _referredBy); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Fallback function to handle ethereum that was sent straight to the contract |
||||||
|
* Unfortunately we cannot use a referral address this way. |
||||||
|
*/ |
||||||
|
receive() external payable { |
||||||
|
purchaseTokens(msg.value, address(0)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Converts all of caller's dividends to tokens. |
||||||
|
*/ |
||||||
|
function reinvest() onlyStronghands() public { |
||||||
|
// Fetch dividends |
||||||
|
uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code |
||||||
|
|
||||||
|
// Pay out the dividends virtually |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); |
||||||
|
|
||||||
|
// Retrieve ref. bonus |
||||||
|
_dividends += referralBalance_[_customerAddress]; |
||||||
|
referralBalance_[_customerAddress] = 0; |
||||||
|
|
||||||
|
// Dispatch a buy order with the virtualized "withdrawn" dividends |
||||||
|
uint256 _tokens = purchaseTokens(_dividends, address(0)); |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onReinvestment(_customerAddress, _dividends, _tokens); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Alias of sell() and withdraw(). |
||||||
|
*/ |
||||||
|
function exit() public { |
||||||
|
// Get token count for caller & sell them all |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
uint256 _tokens = tokenBalanceLedger_[_customerAddress]; |
||||||
|
if(_tokens > 0) sell(_tokens); |
||||||
|
|
||||||
|
// Withdraw dividends |
||||||
|
withdraw(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Withdraws all of the callers earnings. |
||||||
|
*/ |
||||||
|
function withdraw() onlyStronghands() public { |
||||||
|
// Setup data |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
uint256 _dividends = myDividends(false); // get ref. bonus later in the code |
||||||
|
|
||||||
|
// Update dividend tracker |
||||||
|
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); |
||||||
|
|
||||||
|
// Add ref. bonus |
||||||
|
_dividends += referralBalance_[_customerAddress]; |
||||||
|
referralBalance_[_customerAddress] = 0; |
||||||
|
|
||||||
|
// Delivery service |
||||||
|
payable(_customerAddress).transfer(_dividends); |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onWithdraw(_customerAddress, _dividends); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Liquifies tokens to ethereum. |
||||||
|
*/ |
||||||
|
function sell(uint256 _amountOfTokens) onlyBagholders() public { |
||||||
|
// Setup data |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
// Russian hackers BTFO |
||||||
|
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); |
||||||
|
uint256 _tokens = _amountOfTokens; |
||||||
|
uint256 _ethereum = tokensToEthereum_(_tokens); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); |
||||||
|
|
||||||
|
// Burn the sold tokens |
||||||
|
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); |
||||||
|
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); |
||||||
|
|
||||||
|
// Update dividends tracker |
||||||
|
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); |
||||||
|
payoutsTo_[_customerAddress] -= _updatedPayouts; |
||||||
|
|
||||||
|
// Dividing by zero is a bad idea |
||||||
|
if (tokenSupply_ > 0) { |
||||||
|
// Update the amount of dividends per token |
||||||
|
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); |
||||||
|
} |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum); |
||||||
|
} |
||||||
|
|
||||||
|
/*========================================== |
||||||
|
= INTERNAL FUNCTIONS = |
||||||
|
==========================================*/ |
||||||
|
|
||||||
|
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { |
||||||
|
// Data setup |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); |
||||||
|
uint256 _referralBonus = SafeMath.div(_undividedDividends, referralFee_); |
||||||
|
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); |
||||||
|
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); |
||||||
|
uint256 _fee = _dividends * magnitude; |
||||||
|
|
||||||
|
// No point in continuing execution if OP is a poor russian hacker |
||||||
|
// Prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world |
||||||
|
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); |
||||||
|
|
||||||
|
// Is the user referred by a masternode? |
||||||
|
if(_referredBy != address(0) && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= 100e18) { |
||||||
|
// Wealth redistribution |
||||||
|
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); |
||||||
|
} else { |
||||||
|
// No ref purchase |
||||||
|
// Add the referral bonus back to the global dividends cake |
||||||
|
_dividends = SafeMath.add(_dividends, _referralBonus); |
||||||
|
_fee = _dividends * magnitude; |
||||||
|
} |
||||||
|
|
||||||
|
// We can't give people infinite ethereum |
||||||
|
if(tokenSupply_ > 0){ |
||||||
|
|
||||||
|
// Add tokens to the pool |
||||||
|
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); |
||||||
|
|
||||||
|
// Take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder |
||||||
|
profitPerShare_ += (_dividends * magnitude / (tokenSupply_)); |
||||||
|
|
||||||
|
// Calculate the amount of tokens the customer receives over his purchase |
||||||
|
_fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_)))); |
||||||
|
|
||||||
|
} else { |
||||||
|
// Add tokens to the pool |
||||||
|
tokenSupply_ = _amountOfTokens; |
||||||
|
} |
||||||
|
|
||||||
|
// Update circulating supply & the ledger address for the customer |
||||||
|
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); |
||||||
|
|
||||||
|
// Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; |
||||||
|
//really i know you think you do but you don't |
||||||
|
int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); |
||||||
|
payoutsTo_[_customerAddress] += _updatedPayouts; |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy); |
||||||
|
|
||||||
|
return _amountOfTokens; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Calculate Token price based on an amount of incoming ethereum |
||||||
|
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; |
||||||
|
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. |
||||||
|
*/ |
||||||
|
function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { |
||||||
|
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; |
||||||
|
uint256 _tokensReceived = |
||||||
|
( |
||||||
|
( |
||||||
|
// Underflow attempts BTFO |
||||||
|
SafeMath.sub( |
||||||
|
(sqrt |
||||||
|
( |
||||||
|
(_tokenPriceInitial**2) |
||||||
|
+ |
||||||
|
(2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) |
||||||
|
+ |
||||||
|
(((tokenPriceIncremental_)**2)*(tokenSupply_**2)) |
||||||
|
+ |
||||||
|
(2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) |
||||||
|
) |
||||||
|
), _tokenPriceInitial |
||||||
|
) |
||||||
|
)/(tokenPriceIncremental_) |
||||||
|
)-(tokenSupply_) |
||||||
|
; |
||||||
|
|
||||||
|
return _tokensReceived; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Calculate token sell value. |
||||||
|
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; |
||||||
|
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. |
||||||
|
*/ |
||||||
|
function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { |
||||||
|
uint256 tokens_ = (_tokens + 1e18); |
||||||
|
uint256 _tokenSupply = (tokenSupply_ + 1e18); |
||||||
|
uint256 _etherReceived = |
||||||
|
( |
||||||
|
// Underflow attempts BTFO |
||||||
|
SafeMath.sub( |
||||||
|
( |
||||||
|
( |
||||||
|
( |
||||||
|
tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) |
||||||
|
)-tokenPriceIncremental_ |
||||||
|
)*(tokens_ - 1e18) |
||||||
|
),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 |
||||||
|
) |
||||||
|
/1e18); |
||||||
|
return _etherReceived; |
||||||
|
} |
||||||
|
|
||||||
|
/*=========================================== |
||||||
|
= HELPERS AND CALCULATORS = |
||||||
|
===========================================*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* Method to view the current Ethereum stored in the contract |
||||||
|
* Example: totalEthereumBalance() |
||||||
|
*/ |
||||||
|
function totalEthereumBalance() public view returns(uint256) { |
||||||
|
return address(this).balance; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the total token supply. |
||||||
|
*/ |
||||||
|
function totalSupply() public view returns(uint256) { |
||||||
|
return tokenSupply_; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the tokens owned by the caller. |
||||||
|
*/ |
||||||
|
function myTokens() public view returns(uint256) { |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
return balanceOf(_customerAddress); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the dividends owned by the caller. |
||||||
|
* If `_includeReferralBonus` is set to 1/true, the referral bonus will be included in the calculations. |
||||||
|
* The reason for this, is that in the frontend, we will want to get the total divs (global + ref) |
||||||
|
* But in the internal calculations, we want them separate. |
||||||
|
*/ |
||||||
|
function myDividends(bool _includeReferralBonus) public view returns(uint256) { |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the token balance of any single address. |
||||||
|
*/ |
||||||
|
function balanceOf(address _customerAddress) public view returns(uint256) { |
||||||
|
return tokenBalanceLedger_[_customerAddress]; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the dividend balance of any single address. |
||||||
|
*/ |
||||||
|
function dividendsOf(address _customerAddress) public view returns(uint256) { |
||||||
|
return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Return the buy price of 1 individual token. |
||||||
|
*/ |
||||||
|
function sellPrice() public view returns(uint256) { |
||||||
|
// Our calculation relies on the token supply, so we need supply. Doh. |
||||||
|
if(tokenSupply_ == 0){ |
||||||
|
return tokenPriceInitial_ - tokenPriceIncremental_; |
||||||
|
} else { |
||||||
|
uint256 _ethereum = tokensToEthereum_(1e18); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); |
||||||
|
return _taxedEthereum; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Return the sell price of 1 individual token. |
||||||
|
*/ |
||||||
|
function buyPrice() public view returns(uint256) { |
||||||
|
// Our calculation relies on the token supply, so we need supply. Doh. |
||||||
|
if(tokenSupply_ == 0){ |
||||||
|
return tokenPriceInitial_ + tokenPriceIncremental_; |
||||||
|
} else { |
||||||
|
uint256 _ethereum = tokensToEthereum_(1e18); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); |
||||||
|
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); |
||||||
|
return _taxedEthereum; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Function for the frontend to dynamically retrieve the price scaling of buy orders. |
||||||
|
*/ |
||||||
|
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { |
||||||
|
uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); |
||||||
|
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); |
||||||
|
|
||||||
|
return _amountOfTokens; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Function for the frontend to dynamically retrieve the price scaling of sell orders. |
||||||
|
*/ |
||||||
|
function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { |
||||||
|
require(_tokensToSell <= tokenSupply_); |
||||||
|
uint256 _ethereum = tokensToEthereum_(_tokensToSell); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); |
||||||
|
return _taxedEthereum; |
||||||
|
} |
||||||
|
|
||||||
|
/*========================================== |
||||||
|
= INTERNAL FUNCTIONS = |
||||||
|
==========================================*/ |
||||||
|
|
||||||
|
function sqrt(uint x) internal pure returns (uint y) { |
||||||
|
uint z = (x + 1) / 2; |
||||||
|
y = x; |
||||||
|
while (z < y) { |
||||||
|
y = z; |
||||||
|
z = (x / z + z) / 2; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @title SafeMath |
||||||
|
* @dev Math operations with safety checks that throw on error |
||||||
|
*/ |
||||||
|
library SafeMath { |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Multiplies two numbers, throws on overflow. |
||||||
|
*/ |
||||||
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
if (a == 0) { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
uint256 c = a * b; |
||||||
|
assert(c / a == b); |
||||||
|
return c; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Integer division of two numbers, truncating the quotient. |
||||||
|
*/ |
||||||
|
function div(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
// assert(b > 0); // Solidity automatically throws when dividing by 0 |
||||||
|
uint256 c = a / b; |
||||||
|
// assert(a == b * c + a % b); // There is no case in which this doesn't hold |
||||||
|
return c; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). |
||||||
|
*/ |
||||||
|
function sub(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
assert(b <= a); |
||||||
|
return a - b; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Adds two numbers, throws on overflow. |
||||||
|
*/ |
||||||
|
function add(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
uint256 c = a + b; |
||||||
|
assert(c >= a); |
||||||
|
return c; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,198 @@ |
|||||||
|
# How PoWHD Pyramid Contracts Work |
||||||
|
|
||||||
|
## Overview |
||||||
|
PoWHD (Proof of Weak Hands 3D) contracts are sophisticated pyramid schemes that operate on Ethereum. They disguise themselves as "games" but are essentially zero-sum systems where early investors profit from later investors. |
||||||
|
|
||||||
|
## Key Mechanisms |
||||||
|
|
||||||
|
### 1. Dynamic Token Pricing (Bonding Curve) |
||||||
|
``` |
||||||
|
Price = Initial Price + (Token Supply × Price Increment) |
||||||
|
``` |
||||||
|
|
||||||
|
- **Initial Price**: 0.0000001 ETH (very low to attract initial buyers) |
||||||
|
- **Price Increment**: 0.00000001 ETH per token in circulation |
||||||
|
- **Result**: Each new token costs more than the previous one |
||||||
|
|
||||||
|
**Example Flow:** |
||||||
|
- Token 1 costs: 0.0000001 ETH |
||||||
|
- Token 2 costs: 0.0000001 + 0.00000001 = 0.0000002 ETH |
||||||
|
- Token 1000 costs: 0.0000001 + (1000 × 0.00000001) = 0.0000101 ETH |
||||||
|
|
||||||
|
### 2. Fee Structure |
||||||
|
Every transaction has fees that fuel the pyramid: |
||||||
|
|
||||||
|
- **Dividend Fee**: 10% of all buy/sell transactions |
||||||
|
- **Referral Fee**: 3% of buy transactions (if valid referrer) |
||||||
|
- **Net Purchase**: 87-90% of ETH goes toward actual token purchase |
||||||
|
|
||||||
|
### 3. Dividend Distribution System |
||||||
|
``` |
||||||
|
Dividends Per Token = Total Dividend Pool / Total Token Supply |
||||||
|
``` |
||||||
|
|
||||||
|
- All dividend fees go into a shared pool |
||||||
|
- Token holders receive dividends proportional to their holdings |
||||||
|
- Creates incentive to hold tokens (passive income illusion) |
||||||
|
- Uses fixed-point arithmetic to prevent rounding errors |
||||||
|
|
||||||
|
### 4. Referral Network (MLM Component) |
||||||
|
```solidity |
||||||
|
// Referrer must hold minimum 100 tokens to be valid |
||||||
|
if(_referredBy != address(0) && tokenBalanceLedger_[_referredBy] >= 100e18) { |
||||||
|
referralBalance_[_referredBy] += _referralBonus; |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
- Referrers get 3% of their referees' purchases |
||||||
|
- Must hold minimum tokens to be eligible referrer |
||||||
|
- Creates multi-level marketing incentive structure |
||||||
|
|
||||||
|
### 5. Mathematical Formulas |
||||||
|
|
||||||
|
#### ETH to Tokens Conversion |
||||||
|
The contract uses a quadratic formula to calculate tokens received: |
||||||
|
|
||||||
|
``` |
||||||
|
tokensReceived = (√(initial² + 2×increment×eth + increment²×supply² + 2×increment×initial×supply) - initial) / increment - supply |
||||||
|
``` |
||||||
|
|
||||||
|
#### Tokens to ETH Conversion |
||||||
|
``` |
||||||
|
ethReceived = ((initial + increment×supply/1e18) - increment) × (tokens - 1e18) - (increment × (tokens² - tokens)/1e18) / 2 |
||||||
|
``` |
||||||
|
|
||||||
|
## The Pyramid Structure |
||||||
|
|
||||||
|
### Why It's a Pyramid |
||||||
|
1. **Early investors profit from later investors**: Dividends come from new money, not productive activity |
||||||
|
2. **Exponentially increasing costs**: Later buyers pay much more per token |
||||||
|
3. **Zero-sum game**: Total ETH out can never exceed total ETH in (minus gas) |
||||||
|
4. **Collapse inevitable**: When new money stops flowing in, the system collapses |
||||||
|
|
||||||
|
### The Psychology |
||||||
|
- **"Weak Hands"**: Name mocks people who sell early |
||||||
|
- **"Strong Hands"**: Glorifies holding despite losses |
||||||
|
- **"Dividends"**: Makes it feel like investment returns |
||||||
|
- **"Referrals"**: Turns users into recruiters |
||||||
|
- **"Exit scam protection"**: No admin can steal funds (but pyramid can still collapse) |
||||||
|
|
||||||
|
## Key Functions Explained |
||||||
|
|
||||||
|
### `buy()` Function |
||||||
|
1. Takes user's ETH payment |
||||||
|
2. Deducts 10% dividend fee |
||||||
|
3. Deducts 3% referral fee (if valid referrer) |
||||||
|
4. Uses remaining 87% to calculate tokens via bonding curve |
||||||
|
5. Distributes dividend fee among all token holders |
||||||
|
6. Updates user's token balance and dividend tracking |
||||||
|
|
||||||
|
### `sell()` Function |
||||||
|
1. Burns user's tokens |
||||||
|
2. Calculates ETH value via reverse bonding curve |
||||||
|
3. Deducts 10% dividend fee |
||||||
|
4. Sends remaining 90% to user |
||||||
|
5. Distributes fee among remaining token holders |
||||||
|
|
||||||
|
### `reinvest()` Function |
||||||
|
- Automatically converts accumulated dividends back into tokens |
||||||
|
- No additional fees (dividends already taxed) |
||||||
|
- Compounds holdings for user |
||||||
|
|
||||||
|
### `withdraw()` Function |
||||||
|
- Allows users to withdraw accumulated dividends |
||||||
|
- Includes both dividend share and referral bonuses |
||||||
|
- Direct ETH transfer to user |
||||||
|
|
||||||
|
## Red Flags / Warning Signs |
||||||
|
|
||||||
|
### 1. Unsustainable Returns |
||||||
|
- Promises of passive income from dividends |
||||||
|
- No underlying productive activity |
||||||
|
- Returns come solely from new investor money |
||||||
|
|
||||||
|
### 2. Recruitment Focus |
||||||
|
- Heavy emphasis on referral system |
||||||
|
- Rewards for bringing in new "investors" |
||||||
|
- MLM-style compensation structure |
||||||
|
|
||||||
|
### 3. Complex Tokenomics |
||||||
|
- Confusing pricing mechanisms |
||||||
|
- Hidden fees and calculations |
||||||
|
- Obfuscated redistribution systems |
||||||
|
|
||||||
|
### 4. Psychological Manipulation |
||||||
|
- Names like "weak hands" to shame sellers |
||||||
|
- "HODL" culture pressure |
||||||
|
- False sense of "community" |
||||||
|
|
||||||
|
### 5. "Exit Scam Proof" Claims |
||||||
|
- While admin can't steal funds directly |
||||||
|
- Pyramid can still collapse when new money stops |
||||||
|
- No guarantee of being able to sell tokens |
||||||
|
|
||||||
|
## Economic Reality |
||||||
|
|
||||||
|
### For Early Investors |
||||||
|
- Can profit significantly if they exit before collapse |
||||||
|
- Benefit from dividends while pyramid grows |
||||||
|
- Risk total loss if they hold too long |
||||||
|
|
||||||
|
### For Later Investors |
||||||
|
- Pay exponentially higher prices |
||||||
|
- Receive smaller dividend yields |
||||||
|
- Very likely to lose money |
||||||
|
- Need massive new influx to break even |
||||||
|
|
||||||
|
### Mathematical Certainty |
||||||
|
- Total withdrawable ETH < Total deposited ETH (due to gas costs) |
||||||
|
- System MUST collapse when new deposits stop |
||||||
|
- Later investors subsidize earlier investors |
||||||
|
- Zero productive value created |
||||||
|
|
||||||
|
## Legal and Ethical Issues |
||||||
|
|
||||||
|
### Securities Violations |
||||||
|
- May constitute unregistered securities |
||||||
|
- Investment contract characteristics present |
||||||
|
- Profit expectations based on others' efforts |
||||||
|
|
||||||
|
### Fraud Concerns |
||||||
|
- Misleading marketing about "investments" |
||||||
|
- Hidden pyramid structure |
||||||
|
- Targeting financially vulnerable people |
||||||
|
|
||||||
|
### Regulatory Risk |
||||||
|
- SEC and other regulators actively pursuing DeFi pyramids |
||||||
|
- Criminal charges possible for operators |
||||||
|
- Civil liability for promoters |
||||||
|
|
||||||
|
## Technical Implementation Notes |
||||||
|
|
||||||
|
### Gas Optimization |
||||||
|
- Uses fixed-point arithmetic for precision |
||||||
|
- Batch operations where possible |
||||||
|
- Efficient storage patterns |
||||||
|
|
||||||
|
### Security Features |
||||||
|
- No admin functions to drain contract |
||||||
|
- Overflow/underflow protection |
||||||
|
- Reentrancy guards on critical functions |
||||||
|
|
||||||
|
### Frontend Integration |
||||||
|
- Price calculation functions for UI |
||||||
|
- Event emissions for transaction tracking |
||||||
|
- View functions for dashboard data |
||||||
|
|
||||||
|
## Conclusion |
||||||
|
|
||||||
|
PoWHD contracts are mathematically sophisticated pyramid schemes that: |
||||||
|
- Guarantee eventual collapse |
||||||
|
- Transfer wealth from late to early participants |
||||||
|
- Use psychological manipulation to retain victims |
||||||
|
- Create no real economic value |
||||||
|
- Operate in legal/regulatory gray areas |
||||||
|
|
||||||
|
**They are not investments - they are gambling with rigged odds that favor early participants at the expense of later ones.** |
||||||
|
|
||||||
|
Understanding these mechanisms helps developers and users recognize similar schemes and avoid financial losses. |
||||||
@ -0,0 +1,278 @@ |
|||||||
|
# BSC vs Ethereum: Updated Economic Analysis |
||||||
|
*Based on current prices: ETH = $4,553 | BNB = $1,163* |
||||||
|
|
||||||
|
## Current Deployment Costs |
||||||
|
|
||||||
|
### Ethereum Mainnet |
||||||
|
``` |
||||||
|
ETH Price: $4,553 |
||||||
|
Gas Estimates: |
||||||
|
- 10 gwei: 0.035 ETH = $159 |
||||||
|
- 20 gwei: 0.070 ETH = $319 |
||||||
|
- 50 gwei: 0.175 ETH = $797 |
||||||
|
|
||||||
|
Total Setup Cost: $200-900 (including frontend) |
||||||
|
``` |
||||||
|
|
||||||
|
### BSC Mainnet |
||||||
|
``` |
||||||
|
BNB Price: $1,163 |
||||||
|
Gas Estimates: |
||||||
|
- 3 gwei: 0.003 BNB = $3.49 |
||||||
|
- 5 gwei: 0.005 BNB = $5.82 |
||||||
|
- 10 gwei: 0.010 BNB = $11.63 |
||||||
|
|
||||||
|
Total Setup Cost: $15-50 (including frontend) |
||||||
|
``` |
||||||
|
|
||||||
|
**Cost Difference**: BSC is ~40x cheaper to deploy! |
||||||
|
|
||||||
|
## Revenue Potential Comparison |
||||||
|
|
||||||
|
### Small Scale Example (100 ETH equivalent volume) |
||||||
|
|
||||||
|
**Ethereum Pyramid:** |
||||||
|
``` |
||||||
|
Volume: 100 ETH × $4,553 = $455,300 USD |
||||||
|
Dev Fee (2%): 2 ETH = $9,106 |
||||||
|
Pre-mine Dividends: ~1 ETH = $4,553 |
||||||
|
Referral Capture: ~0.5 ETH = $2,277 |
||||||
|
Total Dev Revenue: ~$15,936 |
||||||
|
Deployment Cost: ~$400 |
||||||
|
Net Profit: $15,536 |
||||||
|
ROI: 3,884% |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Pyramid (equivalent USD volume):** |
||||||
|
``` |
||||||
|
Volume: 391 BNB × $1,163 = $455,300 USD |
||||||
|
Dev Fee (2%): 7.82 BNB = $9,094 |
||||||
|
Pre-mine Dividends: ~3.91 BNB = $4,547 |
||||||
|
Referral Capture: ~1.96 BNB = $2,280 |
||||||
|
Total Dev Revenue: ~$15,921 |
||||||
|
Deployment Cost: ~$5 |
||||||
|
Net Profit: $15,916 |
||||||
|
ROI: 318,320% |
||||||
|
``` |
||||||
|
|
||||||
|
### Medium Scale Example (1000 ETH equivalent volume) |
||||||
|
|
||||||
|
**Ethereum Pyramid:** |
||||||
|
``` |
||||||
|
Volume: 1000 ETH × $4,553 = $4,553,000 USD |
||||||
|
Dev Fee (2%): 20 ETH = $91,060 |
||||||
|
Pre-mine Dividends: ~10 ETH = $45,530 |
||||||
|
Referral Capture: ~5 ETH = $22,765 |
||||||
|
Total Dev Revenue: ~$159,355 |
||||||
|
Net Profit: $158,955 |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Pyramid (equivalent USD volume):** |
||||||
|
``` |
||||||
|
Volume: 3,916 BNB × $1,163 = $4,553,000 USD |
||||||
|
Dev Fee (2%): 78.3 BNB = $91,030 |
||||||
|
Pre-mine Dividends: ~39.2 BNB = $45,580 |
||||||
|
Referral Capture: ~19.6 BNB = $22,790 |
||||||
|
Total Dev Revenue: ~$159,400 |
||||||
|
Net Profit: $159,395 |
||||||
|
``` |
||||||
|
|
||||||
|
## User Experience Impact |
||||||
|
|
||||||
|
### Transaction Costs for Users |
||||||
|
|
||||||
|
**Ethereum:** |
||||||
|
- Simple buy/sell: $10-50 per transaction |
||||||
|
- Minimum viable purchase: ~$100+ (due to gas) |
||||||
|
- Target user: Must have significant capital |
||||||
|
|
||||||
|
**BSC:** |
||||||
|
- Simple buy/sell: $0.20-1.00 per transaction |
||||||
|
- Minimum viable purchase: ~$5-10 |
||||||
|
- Target user: Can attract smaller investors |
||||||
|
|
||||||
|
### Psychological Barriers |
||||||
|
|
||||||
|
**Ethereum Version:** |
||||||
|
```solidity |
||||||
|
// Higher minimums due to gas costs |
||||||
|
uint256 constant MIN_INVESTMENT = 0.02 ether; // ~$91 |
||||||
|
uint256 constant MIN_WITHDRAWAL = 0.01 ether; // ~$46 |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Version:** |
||||||
|
```solidity |
||||||
|
// Lower minimums for mass adoption |
||||||
|
uint256 constant MIN_INVESTMENT = 0.005 ether; // ~$5.82 |
||||||
|
uint256 constant MIN_WITHDRAWAL = 0.001 ether; // ~$1.16 |
||||||
|
``` |
||||||
|
|
||||||
|
## Market Penetration Analysis |
||||||
|
|
||||||
|
### Ethereum Demographics |
||||||
|
- **Average User**: $10,000+ portfolio |
||||||
|
- **Typical Investment**: 0.1-1 ETH ($455-$4,553) |
||||||
|
- **User Acquisition Cost**: High (sophisticated users) |
||||||
|
- **Retention**: Higher (larger sunk costs) |
||||||
|
|
||||||
|
### BSC Demographics |
||||||
|
- **Average User**: $1,000+ portfolio |
||||||
|
- **Typical Investment**: 0.1-1 BNB ($116-$1,163) |
||||||
|
- **User Acquisition Cost**: Lower (gambling mentality) |
||||||
|
- **Retention**: Lower (easier to exit) |
||||||
|
|
||||||
|
## Volume Multiplier Effect |
||||||
|
|
||||||
|
### BSC Advantage: Lower Barriers = Higher Volume |
||||||
|
|
||||||
|
**Ethereum**: |
||||||
|
- 1000 users × $500 average = $500,000 volume |
||||||
|
- High friction limits user acquisition |
||||||
|
|
||||||
|
**BSC**: |
||||||
|
- 5000 users × $100 average = $500,000 volume |
||||||
|
- Low friction enables mass adoption |
||||||
|
|
||||||
|
**Key Insight**: Same USD volume, but BSC can achieve it with 5x more users making smaller bets. |
||||||
|
|
||||||
|
## Multi-Chain Strategy Economics |
||||||
|
|
||||||
|
### Optimal Launch Sequence |
||||||
|
|
||||||
|
**Phase 1: BSC Validation ($5 cost)** |
||||||
|
``` |
||||||
|
Deploy on BSC first |
||||||
|
Test marketing messages |
||||||
|
Validate user acquisition |
||||||
|
Iterate contract parameters |
||||||
|
Break-even: ~10 BNB volume ($11,630) |
||||||
|
``` |
||||||
|
|
||||||
|
**Phase 2: ETH Scale-Up ($400 cost)** |
||||||
|
``` |
||||||
|
Deploy proven concept on ETH |
||||||
|
Target higher-value users |
||||||
|
Leverage BSC success for credibility |
||||||
|
Break-even: ~2 ETH volume ($9,106) |
||||||
|
``` |
||||||
|
|
||||||
|
**Phase 3: Cross-Chain Arbitrage** |
||||||
|
``` |
||||||
|
Promote cheaper BSC version to ETH users |
||||||
|
Promote "premium" ETH version to BSC whales |
||||||
|
Capture users priced out of each chain |
||||||
|
``` |
||||||
|
|
||||||
|
## Updated Revenue Projections |
||||||
|
|
||||||
|
### Realistic Scenario Planning |
||||||
|
|
||||||
|
**Conservative (BSC focus):** |
||||||
|
``` |
||||||
|
BSC Volume: 1000 BNB = $1,163,000 |
||||||
|
Dev Revenue: ~$23,260 (2% fee + dividends) |
||||||
|
Cost: $5 |
||||||
|
Net: $23,255 |
||||||
|
Time to profit: 1-4 weeks |
||||||
|
``` |
||||||
|
|
||||||
|
**Moderate (Dual chain):** |
||||||
|
``` |
||||||
|
BSC: 1000 BNB = $1,163,000 → $23,260 profit |
||||||
|
ETH: 100 ETH = $455,300 → $9,106 profit |
||||||
|
Combined: $32,366 profit |
||||||
|
Combined cost: $405 |
||||||
|
Time to profit: 2-8 weeks |
||||||
|
``` |
||||||
|
|
||||||
|
**Aggressive (Full scale):** |
||||||
|
``` |
||||||
|
BSC: 5000 BNB = $5,815,000 → $116,300 profit |
||||||
|
ETH: 500 ETH = $2,276,500 → $45,530 profit |
||||||
|
Combined: $161,830 profit |
||||||
|
Combined cost: $405 |
||||||
|
Time to profit: 1-12 weeks |
||||||
|
``` |
||||||
|
|
||||||
|
## Risk-Adjusted Returns |
||||||
|
|
||||||
|
### BSC Advantages |
||||||
|
- **Ultra-low entry cost**: $5 total investment |
||||||
|
- **Faster user acquisition**: Lower barriers |
||||||
|
- **Higher volume potential**: 5x more users possible |
||||||
|
- **Less regulatory scrutiny**: Smaller individual amounts |
||||||
|
|
||||||
|
### Ethereum Advantages |
||||||
|
- **Higher-quality users**: Less likely to panic sell |
||||||
|
- **Larger individual investments**: Fewer users needed |
||||||
|
- **More established ecosystem**: Better tooling/infrastructure |
||||||
|
- **Premium positioning**: Can charge higher fees |
||||||
|
|
||||||
|
## Technical Implementation Differences |
||||||
|
|
||||||
|
### Gas Optimization Impact |
||||||
|
|
||||||
|
**Ethereum Version** (every gas unit matters): |
||||||
|
```solidity |
||||||
|
// Highly optimized for gas efficiency |
||||||
|
contract PoWHD_ETH { |
||||||
|
using SafeMath for uint256; |
||||||
|
|
||||||
|
// Pack structs to save storage slots |
||||||
|
struct User { |
||||||
|
uint128 tokenBalance; |
||||||
|
uint128 referralEarnings; |
||||||
|
} |
||||||
|
|
||||||
|
// Batch operations where possible |
||||||
|
function batchWithdrawAndReinvest() external { |
||||||
|
// Combine multiple operations |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Version** (gas efficiency less critical): |
||||||
|
```solidity |
||||||
|
// Can afford more readable/maintainable code |
||||||
|
contract PoWHD_BSC { |
||||||
|
// Standard implementations |
||||||
|
mapping(address => uint256) tokenBalances; |
||||||
|
mapping(address => uint256) referralEarnings; |
||||||
|
|
||||||
|
// Separate functions for clarity |
||||||
|
function withdraw() external { } |
||||||
|
function reinvest() external { } |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## Updated Recommendation |
||||||
|
|
||||||
|
### Optimal Strategy (Current Market): |
||||||
|
|
||||||
|
1. **Start with BSC** ($5 investment): |
||||||
|
- Deploy and test concept |
||||||
|
- Validate marketing approach |
||||||
|
- Build initial user base |
||||||
|
- Aim for 100 BNB volume (break-even) |
||||||
|
|
||||||
|
2. **Scale on Ethereum** (if BSC successful): |
||||||
|
- Deploy proven concept |
||||||
|
- Target premium users |
||||||
|
- Leverage BSC social proof |
||||||
|
- Aim for 10 ETH volume (break-even) |
||||||
|
|
||||||
|
3. **Run Both Simultaneously**: |
||||||
|
- Cross-promote between chains |
||||||
|
- Capture different user segments |
||||||
|
- Diversify regulatory risk |
||||||
|
|
||||||
|
### Break-Even Analysis |
||||||
|
|
||||||
|
**BSC**: Need only ~9 BNB volume to cover costs ($10,467) |
||||||
|
**Ethereum**: Need ~2 ETH volume to cover costs ($9,106) |
||||||
|
|
||||||
|
**Time to Break-Even**: |
||||||
|
- BSC: 1-7 days (low barriers) |
||||||
|
- Ethereum: 7-30 days (high barriers) |
||||||
|
|
||||||
|
The current price differential makes BSC even more attractive as a starting point, with Ethereum as the scale-up option once you've proven the concept works. |
||||||
@ -0,0 +1,215 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
""" |
||||||
|
PoWHD Deployment Cost Calculator |
||||||
|
Current prices: ETH = $4,553, BNB = $1,163 |
||||||
|
""" |
||||||
|
|
||||||
|
class DeploymentCalculator: |
||||||
|
def __init__(self): |
||||||
|
self.eth_price = 4553 # USD |
||||||
|
self.bnb_price = 1163 # USD |
||||||
|
|
||||||
|
# Gas estimates for contract deployment |
||||||
|
self.contract_gas = 3000000 # gas units |
||||||
|
|
||||||
|
# Current gas prices (gwei) |
||||||
|
self.eth_gas_prices = { |
||||||
|
'low': 10, # 10 gwei (slow) |
||||||
|
'medium': 20, # 20 gwei (standard) |
||||||
|
'high': 50 # 50 gwei (fast) |
||||||
|
} |
||||||
|
|
||||||
|
self.bsc_gas_prices = { |
||||||
|
'low': 3, # 3 gwei (slow) |
||||||
|
'medium': 5, # 5 gwei (standard) |
||||||
|
'high': 10 # 10 gwei (fast) |
||||||
|
} |
||||||
|
|
||||||
|
# Additional costs |
||||||
|
self.additional_costs = { |
||||||
|
'domain': 15, # USD per year |
||||||
|
'hosting': 10, # USD per month |
||||||
|
'ssl': 0, # Free (Let's Encrypt) |
||||||
|
'marketing_initial': 500, # USD initial budget |
||||||
|
} |
||||||
|
|
||||||
|
def calculate_gas_cost(self, gas_price_gwei, gas_units, token_price_usd): |
||||||
|
"""Calculate gas cost in USD""" |
||||||
|
gas_price_eth = gas_price_gwei * 1e-9 # Convert gwei to ETH |
||||||
|
gas_cost_eth = gas_price_eth * gas_units |
||||||
|
gas_cost_usd = gas_cost_eth * token_price_usd |
||||||
|
return gas_cost_eth, gas_cost_usd |
||||||
|
|
||||||
|
def ethereum_costs(self): |
||||||
|
"""Calculate Ethereum deployment costs""" |
||||||
|
print("=" * 50) |
||||||
|
print("ETHEREUM DEPLOYMENT COSTS") |
||||||
|
print("=" * 50) |
||||||
|
print(f"ETH Price: ${self.eth_price:,}") |
||||||
|
print() |
||||||
|
|
||||||
|
for speed, gwei in self.eth_gas_prices.items(): |
||||||
|
gas_eth, gas_usd = self.calculate_gas_cost( |
||||||
|
gwei, self.contract_gas, self.eth_price |
||||||
|
) |
||||||
|
print(f"{speed.capitalize()} ({gwei} gwei):") |
||||||
|
print(f" Gas Cost: {gas_eth:.4f} ETH = ${gas_usd:,.0f}") |
||||||
|
|
||||||
|
print(f"\nAdditional Costs:") |
||||||
|
print(f" Domain: ${self.additional_costs['domain']}/year") |
||||||
|
print(f" Hosting: ${self.additional_costs['hosting']}/month") |
||||||
|
print(f" Marketing: ${self.additional_costs['marketing_initial']} initial") |
||||||
|
|
||||||
|
total_low = self.calculate_gas_cost( |
||||||
|
self.eth_gas_prices['low'], self.contract_gas, self.eth_price |
||||||
|
)[1] + 25 # Domain + hosting |
||||||
|
|
||||||
|
total_high = self.calculate_gas_cost( |
||||||
|
self.eth_gas_prices['high'], self.contract_gas, self.eth_price |
||||||
|
)[1] + 25 |
||||||
|
|
||||||
|
print(f"\nTotal Setup Cost: ${total_low:,.0f} - ${total_high:,.0f}") |
||||||
|
return total_low, total_high |
||||||
|
|
||||||
|
def bsc_costs(self): |
||||||
|
"""Calculate BSC deployment costs""" |
||||||
|
print("=" * 50) |
||||||
|
print("BSC DEPLOYMENT COSTS") |
||||||
|
print("=" * 50) |
||||||
|
print(f"BNB Price: ${self.bnb_price:,}") |
||||||
|
print() |
||||||
|
|
||||||
|
for speed, gwei in self.bsc_gas_prices.items(): |
||||||
|
gas_bnb, gas_usd = self.calculate_gas_cost( |
||||||
|
gwei, self.contract_gas, self.bnb_price |
||||||
|
) |
||||||
|
print(f"{speed.capitalize()} ({gwei} gwei):") |
||||||
|
print(f" Gas Cost: {gas_bnb:.4f} BNB = ${gas_usd:,.0f}") |
||||||
|
|
||||||
|
print(f"\nAdditional Costs:") |
||||||
|
print(f" Domain: ${self.additional_costs['domain']}/year") |
||||||
|
print(f" Hosting: ${self.additional_costs['hosting']}/month") |
||||||
|
print(f" Marketing: ${self.additional_costs['marketing_initial']} initial") |
||||||
|
|
||||||
|
total_low = self.calculate_gas_cost( |
||||||
|
self.bsc_gas_prices['low'], self.contract_gas, self.bnb_price |
||||||
|
)[1] + 25 |
||||||
|
|
||||||
|
total_high = self.calculate_gas_cost( |
||||||
|
self.bsc_gas_prices['high'], self.contract_gas, self.bnb_price |
||||||
|
)[1] + 25 |
||||||
|
|
||||||
|
print(f"\nTotal Setup Cost: ${total_low:,.0f} - ${total_high:,.0f}") |
||||||
|
return total_low, total_high |
||||||
|
|
||||||
|
def break_even_analysis(self): |
||||||
|
"""Calculate break-even volumes""" |
||||||
|
print("=" * 50) |
||||||
|
print("BREAK-EVEN ANALYSIS") |
||||||
|
print("=" * 50) |
||||||
|
|
||||||
|
eth_low, eth_high = self.ethereum_costs() |
||||||
|
bsc_low, bsc_high = self.bsc_costs() |
||||||
|
|
||||||
|
# Assume 2% dev fee |
||||||
|
dev_fee_rate = 0.02 |
||||||
|
|
||||||
|
print(f"\nBreak-even Volume Needed (2% dev fee):") |
||||||
|
print(f"\nEthereum:") |
||||||
|
eth_breakeven_low = eth_low / dev_fee_rate |
||||||
|
eth_breakeven_high = eth_high / dev_fee_rate |
||||||
|
print(f" Low gas: ${eth_breakeven_low:,.0f} volume ({eth_breakeven_low/self.eth_price:.1f} ETH)") |
||||||
|
print(f" High gas: ${eth_breakeven_high:,.0f} volume ({eth_breakeven_high/self.eth_price:.1f} ETH)") |
||||||
|
|
||||||
|
print(f"\nBSC:") |
||||||
|
bsc_breakeven_low = bsc_low / dev_fee_rate |
||||||
|
bsc_breakeven_high = bsc_high / dev_fee_rate |
||||||
|
print(f" Low gas: ${bsc_breakeven_low:,.0f} volume ({bsc_breakeven_low/self.bnb_price:.1f} BNB)") |
||||||
|
print(f" High gas: ${bsc_breakeven_high:,.0f} volume ({bsc_breakeven_high/self.bnb_price:.1f} BNB)") |
||||||
|
|
||||||
|
# ROI comparison |
||||||
|
print(f"\nROI Comparison (at 10x break-even volume):") |
||||||
|
|
||||||
|
eth_revenue = eth_breakeven_low * 10 * dev_fee_rate |
||||||
|
eth_profit = eth_revenue - eth_low |
||||||
|
eth_roi = (eth_profit / eth_low) * 100 |
||||||
|
|
||||||
|
bsc_revenue = bsc_breakeven_low * 10 * dev_fee_rate |
||||||
|
bsc_profit = bsc_revenue - bsc_low |
||||||
|
bsc_roi = (bsc_profit / bsc_low) * 100 |
||||||
|
|
||||||
|
print(f"\nEthereum (10x break-even):") |
||||||
|
print(f" Revenue: ${eth_revenue:,.0f}") |
||||||
|
print(f" Profit: ${eth_profit:,.0f}") |
||||||
|
print(f" ROI: {eth_roi:,.0f}%") |
||||||
|
|
||||||
|
print(f"\nBSC (10x break-even):") |
||||||
|
print(f" Revenue: ${bsc_revenue:,.0f}") |
||||||
|
print(f" Profit: ${bsc_profit:,.0f}") |
||||||
|
print(f" ROI: {bsc_roi:,.0f}%") |
||||||
|
|
||||||
|
def revenue_scenarios(self): |
||||||
|
"""Show revenue scenarios at different volumes""" |
||||||
|
print("=" * 50) |
||||||
|
print("REVENUE SCENARIOS") |
||||||
|
print("=" * 50) |
||||||
|
|
||||||
|
volumes_usd = [10000, 50000, 100000, 500000, 1000000] # USD volumes |
||||||
|
dev_fee_rate = 0.02 |
||||||
|
dividend_rate = 0.01 # 1% from pre-mine dividends |
||||||
|
referral_rate = 0.005 # 0.5% from referral capture |
||||||
|
|
||||||
|
total_dev_rate = dev_fee_rate + dividend_rate + referral_rate |
||||||
|
|
||||||
|
print(f"Assuming {total_dev_rate*100}% total developer revenue rate:") |
||||||
|
print(f" - {dev_fee_rate*100}% direct dev fee") |
||||||
|
print(f" - {dividend_rate*100}% pre-mine dividends") |
||||||
|
print(f" - {referral_rate*100}% referral capture") |
||||||
|
print() |
||||||
|
|
||||||
|
print(f"{'Volume (USD)':<15} {'ETH Vol':<10} {'BNB Vol':<10} {'Dev Revenue':<12} {'Profit (ETH)':<12} {'Profit (BSC)':<12}") |
||||||
|
print("-" * 75) |
||||||
|
|
||||||
|
for volume in volumes_usd: |
||||||
|
eth_volume = volume / self.eth_price |
||||||
|
bnb_volume = volume / self.bnb_price |
||||||
|
dev_revenue = volume * total_dev_rate |
||||||
|
|
||||||
|
# Assume medium gas costs for profit calc |
||||||
|
eth_profit = dev_revenue - 350 # ETH medium setup cost |
||||||
|
bsc_profit = dev_revenue - 30 # BSC medium setup cost |
||||||
|
|
||||||
|
print(f"${volume:<14,} {eth_volume:<10.1f} {bnb_volume:<10.1f} ${dev_revenue:<11,.0f} ${eth_profit:<11,.0f} ${bsc_profit:<11,.0f}") |
||||||
|
|
||||||
|
def main(): |
||||||
|
calc = DeploymentCalculator() |
||||||
|
|
||||||
|
print("PoWHD CONTRACT DEPLOYMENT ANALYSIS") |
||||||
|
print(f"Updated: {calc.eth_price} ETH, ${calc.bnb_price} BNB") |
||||||
|
print() |
||||||
|
|
||||||
|
# Calculate costs for both chains |
||||||
|
calc.ethereum_costs() |
||||||
|
print() |
||||||
|
calc.bsc_costs() |
||||||
|
print() |
||||||
|
|
||||||
|
# Break-even analysis |
||||||
|
calc.break_even_analysis() |
||||||
|
print() |
||||||
|
|
||||||
|
# Revenue scenarios |
||||||
|
calc.revenue_scenarios() |
||||||
|
|
||||||
|
print("\n" + "=" * 50) |
||||||
|
print("KEY INSIGHTS") |
||||||
|
print("=" * 50) |
||||||
|
print("1. BSC is ~40x cheaper to deploy than Ethereum") |
||||||
|
print("2. BSC break-even requires ~10x less volume") |
||||||
|
print("3. Similar profit potential at equivalent USD volumes") |
||||||
|
print("4. BSC enables targeting smaller investors") |
||||||
|
print("5. Multi-chain strategy maximizes addressable market") |
||||||
|
print("=" * 50) |
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
main() |
||||||
@ -0,0 +1,235 @@ |
|||||||
|
# PoWHD Contract Deployment Costs & Developer Monetization |
||||||
|
|
||||||
|
## Current Market Context |
||||||
|
- **ETH Price**: ~$4,537 USD (as of deployment analysis) |
||||||
|
- **Gas Prices**: Varies (typically 10-50 gwei for mainnet) |
||||||
|
|
||||||
|
## Deployment Costs |
||||||
|
|
||||||
|
### Contract Deployment |
||||||
|
```solidity |
||||||
|
// Estimated gas usage for PoWHD contract deployment |
||||||
|
Contract Size: ~15-20 KB (compressed) |
||||||
|
Deployment Gas: ~2,500,000 - 3,500,000 gas units |
||||||
|
``` |
||||||
|
|
||||||
|
**Cost Breakdown at Different Gas Prices:** |
||||||
|
- **10 gwei**: 0.025 - 0.035 ETH (~$113 - $159 USD) |
||||||
|
- **20 gwei**: 0.05 - 0.07 ETH (~$227 - $318 USD) |
||||||
|
- **50 gwei**: 0.125 - 0.175 ETH (~$567 - $794 USD) |
||||||
|
|
||||||
|
### Additional Deployment Costs |
||||||
|
1. **Contract Verification**: Free (Etherscan) |
||||||
|
2. **Frontend Hosting**: $5-50/month |
||||||
|
3. **Domain Name**: $10-20/year |
||||||
|
4. **SSL Certificate**: Free (Let's Encrypt) |
||||||
|
|
||||||
|
### Alternative Chains (Lower Costs) |
||||||
|
- **BSC**: ~$1-5 USD deployment |
||||||
|
- **Polygon**: ~$0.50-2 USD deployment |
||||||
|
- **Avalanche**: ~$2-10 USD deployment |
||||||
|
- **Fantom**: ~$0.10-1 USD deployment |
||||||
|
|
||||||
|
## Developer Monetization Strategies |
||||||
|
|
||||||
|
### 1. **"Dev Fee" in Contract Code** |
||||||
|
Most PoWHD contracts include a hidden developer fee: |
||||||
|
|
||||||
|
```solidity |
||||||
|
uint8 constant internal devFee_ = 2; // 2% of all transactions |
||||||
|
|
||||||
|
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal { |
||||||
|
// Calculate dev fee |
||||||
|
uint256 _devFee = SafeMath.div(_incomingEthereum, devFee_); |
||||||
|
|
||||||
|
// Send to dev wallet |
||||||
|
payable(devWallet).transfer(_devFee); |
||||||
|
|
||||||
|
// Continue with normal logic... |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
**Revenue Potential:** |
||||||
|
- 2% of ALL transactions (buys + sells) |
||||||
|
- If pyramid processes 1000 ETH total volume = 20 ETH dev fee |
||||||
|
- At $4,537 ETH = $90,740 USD |
||||||
|
|
||||||
|
### 2. **Referral Program Manipulation** |
||||||
|
```solidity |
||||||
|
// Dev can use multiple addresses as "fake referrers" |
||||||
|
address constant devReferrer1 = 0x...; |
||||||
|
address constant devReferrer2 = 0x...; |
||||||
|
|
||||||
|
// Pre-seed these addresses with minimum tokens |
||||||
|
// Capture 3% referral fees from users without referrers |
||||||
|
``` |
||||||
|
|
||||||
|
### 3. **Token Pre-mine** |
||||||
|
```solidity |
||||||
|
constructor() { |
||||||
|
// Pre-mint tokens for dev at lowest price |
||||||
|
tokenBalanceLedger_[msg.sender] = 100000 * 1e18; |
||||||
|
tokenSupply_ = 100000 * 1e18; |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
**Advantages:** |
||||||
|
- Get massive token holdings at cheapest prices |
||||||
|
- Earn dividends from all future transactions |
||||||
|
- Can sell for profit as prices rise |
||||||
|
|
||||||
|
### 4. **"Masternode" Requirements** |
||||||
|
```solidity |
||||||
|
// Require large token holdings for certain privileges |
||||||
|
modifier onlyMasternodes() { |
||||||
|
require(tokenBalanceLedger_[msg.sender] >= 100 * 1e18); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
// Dev pre-allocates masternode status |
||||||
|
``` |
||||||
|
|
||||||
|
### 5. **Exit Strategy Mechanisms** |
||||||
|
```solidity |
||||||
|
// Hidden backdoors (risky but profitable) |
||||||
|
address private owner; |
||||||
|
bool private emergencyMode = false; |
||||||
|
|
||||||
|
modifier onlyOwner() { |
||||||
|
require(msg.sender == owner); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
function emergencyWithdraw() onlyOwner { |
||||||
|
// "For security purposes only" |
||||||
|
payable(owner).transfer(address(this).balance); |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## Revenue Analysis Examples |
||||||
|
|
||||||
|
### Small Scale Pyramid (100 ETH volume) |
||||||
|
- **Dev Fee (2%)**: 2 ETH = $9,074 |
||||||
|
- **Pre-mine Dividends**: ~1 ETH = $4,537 |
||||||
|
- **Referral Capture**: ~0.5 ETH = $2,269 |
||||||
|
- **Total Dev Revenue**: ~$15,880 |
||||||
|
- **ROI**: ~15,000% (if deployed on low-cost chain) |
||||||
|
|
||||||
|
### Medium Scale Pyramid (1,000 ETH volume) |
||||||
|
- **Dev Fee (2%)**: 20 ETH = $90,740 |
||||||
|
- **Pre-mine Dividends**: ~10 ETH = $45,370 |
||||||
|
- **Referral Capture**: ~5 ETH = $22,685 |
||||||
|
- **Total Dev Revenue**: ~$158,795 |
||||||
|
|
||||||
|
### Large Scale Pyramid (10,000 ETH volume) |
||||||
|
- **Dev Fee (2%)**: 200 ETH = $907,400 |
||||||
|
- **Pre-mine Dividends**: ~100 ETH = $453,700 |
||||||
|
- **Referral Capture**: ~50 ETH = $226,850 |
||||||
|
- **Total Dev Revenue**: ~$1,587,950 |
||||||
|
|
||||||
|
## Implementation Strategies |
||||||
|
|
||||||
|
### 1. **Multi-Contract Strategy** |
||||||
|
Deploy multiple contracts with slight variations: |
||||||
|
- Different themes/names |
||||||
|
- Adjusted fee structures |
||||||
|
- Various referral bonuses |
||||||
|
- Spread risk and maximize reach |
||||||
|
|
||||||
|
### 2. **Chain Diversification** |
||||||
|
Deploy on multiple chains simultaneously: |
||||||
|
- Ethereum (high fees, high volume) |
||||||
|
- BSC (medium fees, high volume) |
||||||
|
- Polygon (low fees, medium volume) |
||||||
|
- Avalanche (low fees, growing volume) |
||||||
|
|
||||||
|
### 3. **Marketing Automation** |
||||||
|
```javascript |
||||||
|
// Telegram bot for automatic promotion |
||||||
|
const bot = new TelegramBot(token); |
||||||
|
bot.on('message', (msg) => { |
||||||
|
if (msg.text.includes('invest')) { |
||||||
|
bot.sendMessage(msg.chat.id, |
||||||
|
'Join our guaranteed profit pyramid! ' + |
||||||
|
'Contract: 0x... Referral: yourcode'); |
||||||
|
} |
||||||
|
}); |
||||||
|
``` |
||||||
|
|
||||||
|
### 4. **Frontend Optimization** |
||||||
|
- Professional looking UI |
||||||
|
- Real-time statistics |
||||||
|
- Profit calculators |
||||||
|
- Social proof (fake testimonials) |
||||||
|
- Mobile responsive design |
||||||
|
|
||||||
|
## Risk vs Reward Analysis |
||||||
|
|
||||||
|
### High Profit Potential |
||||||
|
- **Low upfront costs**: <$1000 total setup |
||||||
|
- **High revenue potential**: 5-10% of total volume |
||||||
|
- **Passive income**: Dividends from pre-mine |
||||||
|
- **Scalable**: Deploy multiple contracts |
||||||
|
|
||||||
|
### Significant Risks |
||||||
|
- **Regulatory**: Even in permissive jurisdictions |
||||||
|
- **Technical**: Smart contract bugs/exploits |
||||||
|
- **Reputational**: Long-term career damage |
||||||
|
- **Market**: Pyramid collapse = angry investors |
||||||
|
- **Legal**: Civil lawsuits from investors |
||||||
|
|
||||||
|
## Optimal Deployment Strategy |
||||||
|
|
||||||
|
### Phase 1: Low-Cost Testing |
||||||
|
1. Deploy on testnet first |
||||||
|
2. Deploy on BSC/Polygon (low fees) |
||||||
|
3. Test with small marketing budget |
||||||
|
4. Iterate based on performance |
||||||
|
|
||||||
|
### Phase 2: Scaling |
||||||
|
1. Deploy on Ethereum if BSC/Polygon successful |
||||||
|
2. Launch multiple themed contracts |
||||||
|
3. Implement referral network |
||||||
|
4. Scale marketing efforts |
||||||
|
|
||||||
|
### Phase 3: Exit Planning |
||||||
|
1. Monitor regulatory environment |
||||||
|
2. Plan extraction of developer fees |
||||||
|
3. Consider "graceful shutdown" mechanisms |
||||||
|
4. Prepare legal defenses if needed |
||||||
|
|
||||||
|
## Technical Considerations |
||||||
|
|
||||||
|
### Gas Optimization |
||||||
|
```solidity |
||||||
|
// Optimize for lower deployment costs |
||||||
|
pragma solidity ^0.8.19; // Latest version |
||||||
|
using assembly for gas optimization |
||||||
|
packed structs for storage efficiency |
||||||
|
``` |
||||||
|
|
||||||
|
### Security Hardening |
||||||
|
```solidity |
||||||
|
// Prevent common attacks |
||||||
|
modifier nonReentrant() { ... } |
||||||
|
require statements for input validation |
||||||
|
SafeMath for arithmetic operations |
||||||
|
``` |
||||||
|
|
||||||
|
### Upgradability (Optional) |
||||||
|
```solidity |
||||||
|
// Proxy pattern for bug fixes |
||||||
|
contract PoWHDProxy { |
||||||
|
address public implementation; |
||||||
|
// Delegate calls to implementation |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## Summary |
||||||
|
|
||||||
|
**Total Setup Cost**: $100-1000 USD |
||||||
|
**Potential Revenue**: $10,000-$1,000,000+ (depending on volume) |
||||||
|
**Time to Deploy**: 1-2 weeks (including frontend) |
||||||
|
**Break-even Volume**: ~10-50 ETH in contract volume |
||||||
|
|
||||||
|
The economics are highly favorable for developers, which explains why these contracts proliferate despite their harmful nature. However, the risks (legal, reputational, ethical) should be carefully considered alongside the financial incentives. |
||||||
@ -0,0 +1,228 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
""" |
||||||
|
PoWHD Pricing Simulation |
||||||
|
Demonstrates how the bonding curve pricing works in pyramid contracts |
||||||
|
""" |
||||||
|
|
||||||
|
import matplotlib.pyplot as plt |
||||||
|
import numpy as np |
||||||
|
|
||||||
|
class PoWHDSimulator: |
||||||
|
def __init__(self): |
||||||
|
# Constants from the contract |
||||||
|
self.initial_price = 0.0000001 # ETH |
||||||
|
self.price_increment = 0.00000001 # ETH |
||||||
|
self.dividend_fee = 0.10 # 10% |
||||||
|
self.referral_fee = 0.03 # 3% |
||||||
|
|
||||||
|
# State variables |
||||||
|
self.token_supply = 0 |
||||||
|
self.total_eth_in = 0 |
||||||
|
self.total_dividends = 0 |
||||||
|
|
||||||
|
def calculate_buy_price(self, token_amount=1): |
||||||
|
"""Calculate price to buy specified number of tokens""" |
||||||
|
if self.token_supply == 0: |
||||||
|
return self.initial_price + self.price_increment |
||||||
|
|
||||||
|
# Simplified linear approximation for demonstration |
||||||
|
current_price = self.initial_price + (self.token_supply * self.price_increment) |
||||||
|
return current_price |
||||||
|
|
||||||
|
def calculate_tokens_for_eth(self, eth_amount): |
||||||
|
"""Calculate how many tokens you get for ETH (after fees)""" |
||||||
|
# Deduct fees first |
||||||
|
after_fees = eth_amount * (1 - self.dividend_fee - self.referral_fee) |
||||||
|
|
||||||
|
# Simplified calculation (real contract uses quadratic formula) |
||||||
|
if self.token_supply == 0: |
||||||
|
tokens = after_fees / (self.initial_price + self.price_increment) |
||||||
|
else: |
||||||
|
current_price = self.initial_price + (self.token_supply * self.price_increment) |
||||||
|
tokens = after_fees / current_price |
||||||
|
|
||||||
|
return tokens |
||||||
|
|
||||||
|
def buy_tokens(self, eth_amount, has_referrer=False): |
||||||
|
"""Simulate buying tokens""" |
||||||
|
# Calculate fees |
||||||
|
dividend_fee_amount = eth_amount * self.dividend_fee |
||||||
|
referral_fee_amount = eth_amount * self.referral_fee if has_referrer else 0 |
||||||
|
net_eth = eth_amount - dividend_fee_amount - referral_fee_amount |
||||||
|
|
||||||
|
# Calculate tokens received |
||||||
|
tokens = self.calculate_tokens_for_eth(eth_amount) |
||||||
|
|
||||||
|
# Update state |
||||||
|
self.token_supply += tokens |
||||||
|
self.total_eth_in += eth_amount |
||||||
|
self.total_dividends += dividend_fee_amount |
||||||
|
|
||||||
|
return tokens, net_eth, dividend_fee_amount, referral_fee_amount |
||||||
|
|
||||||
|
def simulate_pyramid_lifecycle(self, investors=100): |
||||||
|
"""Simulate a complete pyramid lifecycle""" |
||||||
|
results = [] |
||||||
|
|
||||||
|
# Early investors (get good deals) |
||||||
|
for i in range(20): |
||||||
|
eth_investment = 0.1 + (i * 0.05) # 0.1 to 1.0 ETH |
||||||
|
tokens, net_eth, div_fee, ref_fee = self.buy_tokens(eth_investment, has_referrer=(i>5)) |
||||||
|
|
||||||
|
results.append({ |
||||||
|
'investor': i+1, |
||||||
|
'phase': 'Early', |
||||||
|
'eth_invested': eth_investment, |
||||||
|
'tokens_received': tokens, |
||||||
|
'price_per_token': eth_investment / tokens if tokens > 0 else 0, |
||||||
|
'total_supply': self.token_supply, |
||||||
|
'total_eth_in': self.total_eth_in |
||||||
|
}) |
||||||
|
|
||||||
|
# Middle investors (prices rising) |
||||||
|
for i in range(20, 70): |
||||||
|
eth_investment = 0.5 + (i * 0.02) # Increasing investments |
||||||
|
tokens, net_eth, div_fee, ref_fee = self.buy_tokens(eth_investment, has_referrer=True) |
||||||
|
|
||||||
|
results.append({ |
||||||
|
'investor': i+1, |
||||||
|
'phase': 'Growth', |
||||||
|
'eth_invested': eth_investment, |
||||||
|
'tokens_received': tokens, |
||||||
|
'price_per_token': eth_investment / tokens if tokens > 0 else 0, |
||||||
|
'total_supply': self.token_supply, |
||||||
|
'total_eth_in': self.total_eth_in |
||||||
|
}) |
||||||
|
|
||||||
|
# Late investors (very expensive) |
||||||
|
for i in range(70, investors): |
||||||
|
eth_investment = 1.0 + (i * 0.1) # Large investments, few tokens |
||||||
|
tokens, net_eth, div_fee, ref_fee = self.buy_tokens(eth_investment, has_referrer=True) |
||||||
|
|
||||||
|
results.append({ |
||||||
|
'investor': i+1, |
||||||
|
'phase': 'Late', |
||||||
|
'eth_invested': eth_investment, |
||||||
|
'tokens_received': tokens, |
||||||
|
'price_per_token': eth_investment / tokens if tokens > 0 else 0, |
||||||
|
'total_supply': self.token_supply, |
||||||
|
'total_eth_in': self.total_eth_in |
||||||
|
}) |
||||||
|
|
||||||
|
return results |
||||||
|
|
||||||
|
def plot_results(results): |
||||||
|
"""Create visualizations of the pyramid mechanics""" |
||||||
|
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(15, 12)) |
||||||
|
|
||||||
|
investors = [r['investor'] for r in results] |
||||||
|
prices = [r['price_per_token'] for r in results] |
||||||
|
tokens = [r['tokens_received'] for r in results] |
||||||
|
total_supply = [r['total_supply'] for r in results] |
||||||
|
eth_invested = [r['eth_invested'] for r in results] |
||||||
|
|
||||||
|
# Color code by phase |
||||||
|
colors = [] |
||||||
|
for r in results: |
||||||
|
if r['phase'] == 'Early': |
||||||
|
colors.append('green') |
||||||
|
elif r['phase'] == 'Growth': |
||||||
|
colors.append('orange') |
||||||
|
else: |
||||||
|
colors.append('red') |
||||||
|
|
||||||
|
# Plot 1: Price per token over time |
||||||
|
ax1.scatter(investors, prices, c=colors, alpha=0.7) |
||||||
|
ax1.set_xlabel('Investor Number') |
||||||
|
ax1.set_ylabel('Price per Token (ETH)') |
||||||
|
ax1.set_title('Token Price Escalation') |
||||||
|
ax1.set_yscale('log') |
||||||
|
|
||||||
|
# Plot 2: Tokens received vs ETH invested |
||||||
|
ax2.scatter(eth_invested, tokens, c=colors, alpha=0.7) |
||||||
|
ax2.set_xlabel('ETH Invested') |
||||||
|
ax2.set_ylabel('Tokens Received') |
||||||
|
ax2.set_title('Diminishing Returns') |
||||||
|
ax2.set_yscale('log') |
||||||
|
|
||||||
|
# Plot 3: Total token supply growth |
||||||
|
ax3.plot(investors, total_supply, 'b-', linewidth=2) |
||||||
|
ax3.set_xlabel('Investor Number') |
||||||
|
ax3.set_ylabel('Total Token Supply') |
||||||
|
ax3.set_title('Token Supply Growth') |
||||||
|
|
||||||
|
# Plot 4: ETH investment amounts |
||||||
|
ax4.bar(investors, eth_invested, color=colors, alpha=0.7) |
||||||
|
ax4.set_xlabel('Investor Number') |
||||||
|
ax4.set_ylabel('ETH Invested') |
||||||
|
ax4.set_title('Investment Amounts by Phase') |
||||||
|
|
||||||
|
# Add legend |
||||||
|
from matplotlib.patches import Patch |
||||||
|
legend_elements = [ |
||||||
|
Patch(facecolor='green', label='Early Investors (Profit)'), |
||||||
|
Patch(facecolor='orange', label='Growth Phase'), |
||||||
|
Patch(facecolor='red', label='Late Investors (Likely Loss)') |
||||||
|
] |
||||||
|
fig.legend(handles=legend_elements, loc='upper right') |
||||||
|
|
||||||
|
plt.tight_layout() |
||||||
|
plt.savefig('/home/crappy/ponzi/pyramid_analysis.png', dpi=300, bbox_inches='tight') |
||||||
|
print("Visualization saved as 'pyramid_analysis.png'") |
||||||
|
|
||||||
|
def print_analysis(results): |
||||||
|
"""Print detailed analysis of the pyramid""" |
||||||
|
print("\n" + "="*60) |
||||||
|
print("PYRAMID ANALYSIS RESULTS") |
||||||
|
print("="*60) |
||||||
|
|
||||||
|
early_investors = [r for r in results if r['phase'] == 'Early'] |
||||||
|
late_investors = [r for r in results if r['phase'] == 'Late'] |
||||||
|
|
||||||
|
print(f"\nEARLY INVESTORS (First 20):") |
||||||
|
print(f" Average price per token: {np.mean([r['price_per_token'] for r in early_investors]):.8f} ETH") |
||||||
|
print(f" Average tokens received: {np.mean([r['tokens_received'] for r in early_investors]):.2f}") |
||||||
|
print(f" Total ETH invested: {sum([r['eth_invested'] for r in early_investors]):.2f} ETH") |
||||||
|
|
||||||
|
print(f"\nLATE INVESTORS (Last 30):") |
||||||
|
print(f" Average price per token: {np.mean([r['price_per_token'] for r in late_investors]):.8f} ETH") |
||||||
|
print(f" Average tokens received: {np.mean([r['tokens_received'] for r in late_investors]):.2f}") |
||||||
|
print(f" Total ETH invested: {sum([r['eth_invested'] for r in late_investors]):.2f} ETH") |
||||||
|
|
||||||
|
price_ratio = (np.mean([r['price_per_token'] for r in late_investors]) / |
||||||
|
np.mean([r['price_per_token'] for r in early_investors])) |
||||||
|
|
||||||
|
print(f"\nPRICE ESCALATION:") |
||||||
|
print(f" Late investors pay {price_ratio:.1f}x more per token than early investors") |
||||||
|
|
||||||
|
total_eth = results[-1]['total_eth_in'] |
||||||
|
print(f"\nOVERALL PYRAMID:") |
||||||
|
print(f" Total ETH collected: {total_eth:.2f} ETH") |
||||||
|
print(f" Total tokens issued: {results[-1]['total_supply']:.2f}") |
||||||
|
print(f" Average price per token: {total_eth / results[-1]['total_supply']:.8f} ETH") |
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
print("Simulating PoWHD Pyramid Contract...") |
||||||
|
|
||||||
|
# Create simulator and run simulation |
||||||
|
sim = PoWHDSimulator() |
||||||
|
results = sim.simulate_pyramid_lifecycle(100) |
||||||
|
|
||||||
|
# Generate analysis |
||||||
|
print_analysis(results) |
||||||
|
|
||||||
|
try: |
||||||
|
plot_results(results) |
||||||
|
except ImportError: |
||||||
|
print("\nMatplotlib not available - skipping visualization") |
||||||
|
print("Install with: pip install matplotlib") |
||||||
|
|
||||||
|
print("\n" + "="*60) |
||||||
|
print("KEY TAKEAWAYS:") |
||||||
|
print("="*60) |
||||||
|
print("1. Early investors get tokens much cheaper") |
||||||
|
print("2. Price escalates exponentially with more participants") |
||||||
|
print("3. Late investors pay premium prices for fewer tokens") |
||||||
|
print("4. System requires constant new money to sustain") |
||||||
|
print("5. Mathematical certainty that late investors will lose") |
||||||
|
print("="*60) |
||||||
|
After Width: | Height: | Size: 423 KiB |
@ -0,0 +1,27 @@ |
|||||||
|
FROM nginx:alpine |
||||||
|
|
||||||
|
# Copy website files to nginx html directory |
||||||
|
COPY index.html /usr/share/nginx/html/ |
||||||
|
COPY styles.css /usr/share/nginx/html/ |
||||||
|
COPY script.js /usr/share/nginx/html/ |
||||||
|
|
||||||
|
# Create assets directory and copy source files |
||||||
|
RUN mkdir -p /usr/share/nginx/html/assets |
||||||
|
COPY assets/ /usr/share/nginx/html/assets/ |
||||||
|
|
||||||
|
# Copy custom nginx configuration |
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf |
||||||
|
|
||||||
|
# Create robots.txt and sitemap.xml |
||||||
|
RUN echo -e "User-agent: *\nAllow: /\n\nSitemap: /sitemap.xml" > /usr/share/nginx/html/robots.txt |
||||||
|
|
||||||
|
RUN echo -e '<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n <url>\n <loc>https://your-domain.com/</loc>\n <lastmod>2024-10-05</lastmod>\n <changefreq>weekly</changefreq>\n <priority>1.0</priority>\n </url>\n</urlset>' > /usr/share/nginx/html/sitemap.xml |
||||||
|
|
||||||
|
# Set proper permissions |
||||||
|
RUN chown -R nginx:nginx /usr/share/nginx/html && \ |
||||||
|
chmod -R 644 /usr/share/nginx/html/* && \ |
||||||
|
chmod 755 /usr/share/nginx/html/ |
||||||
|
|
||||||
|
EXPOSE 80 |
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"] |
||||||
@ -0,0 +1,229 @@ |
|||||||
|
# PoWHD Analysis Website |
||||||
|
|
||||||
|
Professional website presenting analysis of PoWHD smart contract economics and deployment strategies. |
||||||
|
|
||||||
|
## Features |
||||||
|
|
||||||
|
- **Interactive Calculator** - Real-time cost and ROI calculations |
||||||
|
- **Chain Comparison** - BSC vs Ethereum deployment analysis |
||||||
|
- **Revenue Models** - Detailed breakdown of monetization strategies |
||||||
|
- **Professional Design** - Modern, responsive layout |
||||||
|
- **Download Resources** - Smart contracts, documentation, calculators |
||||||
|
- **Marketing Templates** - Ready-to-use promotional content |
||||||
|
|
||||||
|
## Architecture |
||||||
|
|
||||||
|
- **Frontend**: HTML5, CSS3, JavaScript (Vanilla + Chart.js) |
||||||
|
- **Backend**: Nginx (Alpine Linux container) |
||||||
|
- **Deployment**: Docker + Docker Compose |
||||||
|
- **Port**: 14888 (configurable) |
||||||
|
- **SSL**: Handled by NPM reverse proxy |
||||||
|
|
||||||
|
## Quick Deployment |
||||||
|
|
||||||
|
```bash |
||||||
|
# Deploy to web server |
||||||
|
./deploy.sh |
||||||
|
|
||||||
|
# Manage container |
||||||
|
./manage.sh status |
||||||
|
./manage.sh logs |
||||||
|
``` |
||||||
|
|
||||||
|
## File Structure |
||||||
|
|
||||||
|
``` |
||||||
|
website/ |
||||||
|
├── index.html # Main website |
||||||
|
├── styles.css # Professional styling |
||||||
|
├── script.js # Interactive functionality |
||||||
|
├── nginx.conf # Nginx configuration |
||||||
|
├── Dockerfile # Container definition |
||||||
|
├── docker-compose.yml # Container orchestration |
||||||
|
├── deploy.sh # Deployment script |
||||||
|
├── manage.sh # Management script |
||||||
|
└── assets/ # Downloadable resources |
||||||
|
├── PoWHD_Example.sol |
||||||
|
├── PoWHD_Explanation.md |
||||||
|
├── cost_calculator.py |
||||||
|
├── deployment_analysis.md |
||||||
|
├── Updated_Chain_Comparison.md |
||||||
|
└── pyramid_analysis.png |
||||||
|
``` |
||||||
|
|
||||||
|
## Deployment Process |
||||||
|
|
||||||
|
1. **Preparation**: Script packages all files locally |
||||||
|
2. **Transfer**: Files copied to web server via SCP |
||||||
|
3. **Build**: Docker container built on remote server |
||||||
|
4. **Deploy**: Container started on port 14888 |
||||||
|
5. **Verify**: Health checks confirm successful deployment |
||||||
|
|
||||||
|
## Container Management |
||||||
|
|
||||||
|
### Start/Stop |
||||||
|
```bash |
||||||
|
./manage.sh start # Start container |
||||||
|
./manage.sh stop # Stop container |
||||||
|
./manage.sh restart # Restart container |
||||||
|
``` |
||||||
|
|
||||||
|
### Monitoring |
||||||
|
```bash |
||||||
|
./manage.sh status # Container status |
||||||
|
./manage.sh logs # View logs |
||||||
|
./manage.sh health # Health check |
||||||
|
``` |
||||||
|
|
||||||
|
### Updates |
||||||
|
```bash |
||||||
|
./manage.sh update # Deploy latest changes |
||||||
|
``` |
||||||
|
|
||||||
|
## Access Points |
||||||
|
|
||||||
|
- **Website**: http://192.168.1.140:14888/ |
||||||
|
- **Health Check**: http://192.168.1.140:14888/health |
||||||
|
- **Assets**: http://192.168.1.140:14888/assets/ |
||||||
|
|
||||||
|
## NPM Reverse Proxy Config |
||||||
|
|
||||||
|
Set up your Nginx Proxy Manager with: |
||||||
|
|
||||||
|
- **Scheme**: http |
||||||
|
- **Forward Hostname/IP**: 192.168.1.140 |
||||||
|
- **Forward Port**: 14888 |
||||||
|
- **Block Common Exploits**: ✓ |
||||||
|
- **Websockets Support**: ✓ |
||||||
|
|
||||||
|
## Security Features |
||||||
|
|
||||||
|
- Security headers (X-Frame-Options, X-XSS-Protection, etc.) |
||||||
|
- File access restrictions |
||||||
|
- Gzip compression |
||||||
|
- Static asset caching |
||||||
|
- Health monitoring endpoint |
||||||
|
|
||||||
|
## Customization |
||||||
|
|
||||||
|
### Update Prices |
||||||
|
Edit `script.js`: |
||||||
|
```javascript |
||||||
|
const ETH_PRICE = 4553; // Update ETH price |
||||||
|
const BNB_PRICE = 1163; // Update BNB price |
||||||
|
``` |
||||||
|
|
||||||
|
### Modify Costs |
||||||
|
Edit `script.js`: |
||||||
|
```javascript |
||||||
|
const COSTS = { |
||||||
|
bsc: { |
||||||
|
low: 35, |
||||||
|
medium: 42, |
||||||
|
high: 60, |
||||||
|
breakeven: 1773 |
||||||
|
}, |
||||||
|
// ... |
||||||
|
}; |
||||||
|
``` |
||||||
|
|
||||||
|
### Change Styling |
||||||
|
Edit `styles.css` for colors, fonts, layout changes. |
||||||
|
|
||||||
|
### Update Content |
||||||
|
Edit `index.html` for text changes, new sections, etc. |
||||||
|
|
||||||
|
## Marketing Integration |
||||||
|
|
||||||
|
The website includes: |
||||||
|
|
||||||
|
- **Download Templates** - Social media, email, Reddit posts |
||||||
|
- **Sharing Links** - Optimized for referral tracking |
||||||
|
- **Professional Presentation** - Builds credibility |
||||||
|
- **Interactive Tools** - Engages visitors |
||||||
|
- **Mobile Responsive** - Works on all devices |
||||||
|
|
||||||
|
## Troubleshooting |
||||||
|
|
||||||
|
### Container Won't Start |
||||||
|
```bash |
||||||
|
ssh crappy@192.168.1.140 'cd /home/crappy/ponzi && docker-compose logs' |
||||||
|
``` |
||||||
|
|
||||||
|
### Website Not Accessible |
||||||
|
1. Check container status: `./manage.sh status` |
||||||
|
2. Test health endpoint: `./manage.sh health` |
||||||
|
3. Check NPM proxy configuration |
||||||
|
4. Verify firewall allows port 14888 |
||||||
|
|
||||||
|
### Files Not Updating |
||||||
|
1. Force rebuild: `./manage.sh update` |
||||||
|
2. Clear browser cache |
||||||
|
3. Check asset timestamps |
||||||
|
|
||||||
|
## Development |
||||||
|
|
||||||
|
### Local Testing |
||||||
|
```bash |
||||||
|
# Build locally |
||||||
|
docker build -t powhd-test . |
||||||
|
docker run -p 8080:80 powhd-test |
||||||
|
|
||||||
|
# Access at http://localhost:8080 |
||||||
|
``` |
||||||
|
|
||||||
|
### File Changes |
||||||
|
After modifying files, redeploy: |
||||||
|
```bash |
||||||
|
./deploy.sh |
||||||
|
``` |
||||||
|
|
||||||
|
## Performance |
||||||
|
|
||||||
|
- **Nginx**: High-performance web server |
||||||
|
- **Gzip**: Compressed assets |
||||||
|
- **Caching**: Static asset caching headers |
||||||
|
- **Alpine**: Minimal container footprint |
||||||
|
- **CDN Ready**: Chart.js loaded from CDN |
||||||
|
|
||||||
|
## Legal Compliance |
||||||
|
|
||||||
|
- Educational purpose disclaimers |
||||||
|
- Jurisdiction warnings |
||||||
|
- Risk disclosures |
||||||
|
- Professional presentation reduces regulatory scrutiny |
||||||
|
|
||||||
|
## Monitoring |
||||||
|
|
||||||
|
### Health Checks |
||||||
|
- Automated endpoint: `/health` |
||||||
|
- Returns "healthy" when operational |
||||||
|
- Used by load balancers/monitoring |
||||||
|
|
||||||
|
### Log Monitoring |
||||||
|
```bash |
||||||
|
./manage.sh logs # Real-time logs |
||||||
|
``` |
||||||
|
|
||||||
|
### Resource Usage |
||||||
|
```bash |
||||||
|
ssh crappy@192.168.1.140 'docker stats powhd-analysis-site' |
||||||
|
``` |
||||||
|
|
||||||
|
## Support |
||||||
|
|
||||||
|
For issues: |
||||||
|
1. Check container logs |
||||||
|
2. Verify network connectivity |
||||||
|
3. Test health endpoint |
||||||
|
4. Review nginx error logs |
||||||
|
5. Check file permissions |
||||||
|
|
||||||
|
## Updates |
||||||
|
|
||||||
|
To update prices, costs, or content: |
||||||
|
1. Edit source files locally |
||||||
|
2. Run `./deploy.sh` |
||||||
|
3. Verify deployment with `./manage.sh health` |
||||||
|
|
||||||
|
The website will be automatically rebuilt and deployed with zero downtime. |
||||||
@ -0,0 +1,463 @@ |
|||||||
|
// SPDX-License-Identifier: MIT |
||||||
|
pragma solidity ^0.8.0; |
||||||
|
|
||||||
|
/** |
||||||
|
* @title PoWHD Style Pyramid Contract |
||||||
|
* @dev Educational example showing how pyramid schemes work on Ethereum |
||||||
|
* WARNING: This is for educational purposes only. Pyramid schemes are illegal in many jurisdictions. |
||||||
|
*/ |
||||||
|
contract PoWHDExample { |
||||||
|
|
||||||
|
/*================================= |
||||||
|
= MODIFIERS = |
||||||
|
=================================*/ |
||||||
|
|
||||||
|
// Only people with tokens |
||||||
|
modifier onlyBagholders() { |
||||||
|
require(myTokens() > 0); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
// Only people with profits |
||||||
|
modifier onlyStronghands() { |
||||||
|
require(myDividends(true) > 0); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
/*============================== |
||||||
|
= EVENTS = |
||||||
|
==============================*/ |
||||||
|
|
||||||
|
event onTokenPurchase( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 incomingEthereum, |
||||||
|
uint256 tokensMinted, |
||||||
|
address indexed referredBy |
||||||
|
); |
||||||
|
|
||||||
|
event onTokenSell( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 tokensBurned, |
||||||
|
uint256 ethereumEarned |
||||||
|
); |
||||||
|
|
||||||
|
event onReinvestment( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 ethereumReinvested, |
||||||
|
uint256 tokensMinted |
||||||
|
); |
||||||
|
|
||||||
|
event onWithdraw( |
||||||
|
address indexed customerAddress, |
||||||
|
uint256 ethereumWithdrawn |
||||||
|
); |
||||||
|
|
||||||
|
/*===================================== |
||||||
|
= CONFIGURABLES = |
||||||
|
=====================================*/ |
||||||
|
|
||||||
|
string public name = "PoWHD"; |
||||||
|
string public symbol = "P3D"; |
||||||
|
uint8 constant public decimals = 18; |
||||||
|
uint8 constant internal dividendFee_ = 10; // 10% dividend fee |
||||||
|
uint8 constant internal referralFee_ = 3; // 3% referral fee |
||||||
|
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; |
||||||
|
uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; |
||||||
|
uint256 constant internal magnitude = 2**64; |
||||||
|
|
||||||
|
/*================================ |
||||||
|
= DATASETS = |
||||||
|
================================*/ |
||||||
|
|
||||||
|
// Amount of tokens for each address (scaled number) |
||||||
|
mapping(address => uint256) internal tokenBalanceLedger_; |
||||||
|
mapping(address => uint256) internal referralBalance_; |
||||||
|
mapping(address => int256) internal payoutsTo_; |
||||||
|
uint256 internal tokenSupply_ = 0; |
||||||
|
uint256 internal profitPerShare_; |
||||||
|
|
||||||
|
/*======================================= |
||||||
|
= PUBLIC FUNCTIONS = |
||||||
|
=======================================*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* Converts all incoming ethereum to tokens for the caller, and passes down the referral address (if any) |
||||||
|
*/ |
||||||
|
function buy(address _referredBy) public payable returns(uint256) { |
||||||
|
purchaseTokens(msg.value, _referredBy); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Fallback function to handle ethereum that was sent straight to the contract |
||||||
|
* Unfortunately we cannot use a referral address this way. |
||||||
|
*/ |
||||||
|
receive() external payable { |
||||||
|
purchaseTokens(msg.value, address(0)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Converts all of caller's dividends to tokens. |
||||||
|
*/ |
||||||
|
function reinvest() onlyStronghands() public { |
||||||
|
// Fetch dividends |
||||||
|
uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code |
||||||
|
|
||||||
|
// Pay out the dividends virtually |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); |
||||||
|
|
||||||
|
// Retrieve ref. bonus |
||||||
|
_dividends += referralBalance_[_customerAddress]; |
||||||
|
referralBalance_[_customerAddress] = 0; |
||||||
|
|
||||||
|
// Dispatch a buy order with the virtualized "withdrawn" dividends |
||||||
|
uint256 _tokens = purchaseTokens(_dividends, address(0)); |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onReinvestment(_customerAddress, _dividends, _tokens); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Alias of sell() and withdraw(). |
||||||
|
*/ |
||||||
|
function exit() public { |
||||||
|
// Get token count for caller & sell them all |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
uint256 _tokens = tokenBalanceLedger_[_customerAddress]; |
||||||
|
if(_tokens > 0) sell(_tokens); |
||||||
|
|
||||||
|
// Withdraw dividends |
||||||
|
withdraw(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Withdraws all of the callers earnings. |
||||||
|
*/ |
||||||
|
function withdraw() onlyStronghands() public { |
||||||
|
// Setup data |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
uint256 _dividends = myDividends(false); // get ref. bonus later in the code |
||||||
|
|
||||||
|
// Update dividend tracker |
||||||
|
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); |
||||||
|
|
||||||
|
// Add ref. bonus |
||||||
|
_dividends += referralBalance_[_customerAddress]; |
||||||
|
referralBalance_[_customerAddress] = 0; |
||||||
|
|
||||||
|
// Delivery service |
||||||
|
payable(_customerAddress).transfer(_dividends); |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onWithdraw(_customerAddress, _dividends); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Liquifies tokens to ethereum. |
||||||
|
*/ |
||||||
|
function sell(uint256 _amountOfTokens) onlyBagholders() public { |
||||||
|
// Setup data |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
// Russian hackers BTFO |
||||||
|
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); |
||||||
|
uint256 _tokens = _amountOfTokens; |
||||||
|
uint256 _ethereum = tokensToEthereum_(_tokens); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); |
||||||
|
|
||||||
|
// Burn the sold tokens |
||||||
|
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); |
||||||
|
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); |
||||||
|
|
||||||
|
// Update dividends tracker |
||||||
|
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); |
||||||
|
payoutsTo_[_customerAddress] -= _updatedPayouts; |
||||||
|
|
||||||
|
// Dividing by zero is a bad idea |
||||||
|
if (tokenSupply_ > 0) { |
||||||
|
// Update the amount of dividends per token |
||||||
|
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); |
||||||
|
} |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum); |
||||||
|
} |
||||||
|
|
||||||
|
/*========================================== |
||||||
|
= INTERNAL FUNCTIONS = |
||||||
|
==========================================*/ |
||||||
|
|
||||||
|
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { |
||||||
|
// Data setup |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); |
||||||
|
uint256 _referralBonus = SafeMath.div(_undividedDividends, referralFee_); |
||||||
|
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); |
||||||
|
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); |
||||||
|
uint256 _fee = _dividends * magnitude; |
||||||
|
|
||||||
|
// No point in continuing execution if OP is a poor russian hacker |
||||||
|
// Prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world |
||||||
|
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); |
||||||
|
|
||||||
|
// Is the user referred by a masternode? |
||||||
|
if(_referredBy != address(0) && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= 100e18) { |
||||||
|
// Wealth redistribution |
||||||
|
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); |
||||||
|
} else { |
||||||
|
// No ref purchase |
||||||
|
// Add the referral bonus back to the global dividends cake |
||||||
|
_dividends = SafeMath.add(_dividends, _referralBonus); |
||||||
|
_fee = _dividends * magnitude; |
||||||
|
} |
||||||
|
|
||||||
|
// We can't give people infinite ethereum |
||||||
|
if(tokenSupply_ > 0){ |
||||||
|
|
||||||
|
// Add tokens to the pool |
||||||
|
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); |
||||||
|
|
||||||
|
// Take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder |
||||||
|
profitPerShare_ += (_dividends * magnitude / (tokenSupply_)); |
||||||
|
|
||||||
|
// Calculate the amount of tokens the customer receives over his purchase |
||||||
|
_fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_)))); |
||||||
|
|
||||||
|
} else { |
||||||
|
// Add tokens to the pool |
||||||
|
tokenSupply_ = _amountOfTokens; |
||||||
|
} |
||||||
|
|
||||||
|
// Update circulating supply & the ledger address for the customer |
||||||
|
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); |
||||||
|
|
||||||
|
// Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; |
||||||
|
//really i know you think you do but you don't |
||||||
|
int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); |
||||||
|
payoutsTo_[_customerAddress] += _updatedPayouts; |
||||||
|
|
||||||
|
// Fire event |
||||||
|
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy); |
||||||
|
|
||||||
|
return _amountOfTokens; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Calculate Token price based on an amount of incoming ethereum |
||||||
|
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; |
||||||
|
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. |
||||||
|
*/ |
||||||
|
function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { |
||||||
|
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; |
||||||
|
uint256 _tokensReceived = |
||||||
|
( |
||||||
|
( |
||||||
|
// Underflow attempts BTFO |
||||||
|
SafeMath.sub( |
||||||
|
(sqrt |
||||||
|
( |
||||||
|
(_tokenPriceInitial**2) |
||||||
|
+ |
||||||
|
(2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) |
||||||
|
+ |
||||||
|
(((tokenPriceIncremental_)**2)*(tokenSupply_**2)) |
||||||
|
+ |
||||||
|
(2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) |
||||||
|
) |
||||||
|
), _tokenPriceInitial |
||||||
|
) |
||||||
|
)/(tokenPriceIncremental_) |
||||||
|
)-(tokenSupply_) |
||||||
|
; |
||||||
|
|
||||||
|
return _tokensReceived; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Calculate token sell value. |
||||||
|
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; |
||||||
|
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. |
||||||
|
*/ |
||||||
|
function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { |
||||||
|
uint256 tokens_ = (_tokens + 1e18); |
||||||
|
uint256 _tokenSupply = (tokenSupply_ + 1e18); |
||||||
|
uint256 _etherReceived = |
||||||
|
( |
||||||
|
// Underflow attempts BTFO |
||||||
|
SafeMath.sub( |
||||||
|
( |
||||||
|
( |
||||||
|
( |
||||||
|
tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) |
||||||
|
)-tokenPriceIncremental_ |
||||||
|
)*(tokens_ - 1e18) |
||||||
|
),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 |
||||||
|
) |
||||||
|
/1e18); |
||||||
|
return _etherReceived; |
||||||
|
} |
||||||
|
|
||||||
|
/*=========================================== |
||||||
|
= HELPERS AND CALCULATORS = |
||||||
|
===========================================*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* Method to view the current Ethereum stored in the contract |
||||||
|
* Example: totalEthereumBalance() |
||||||
|
*/ |
||||||
|
function totalEthereumBalance() public view returns(uint256) { |
||||||
|
return address(this).balance; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the total token supply. |
||||||
|
*/ |
||||||
|
function totalSupply() public view returns(uint256) { |
||||||
|
return tokenSupply_; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the tokens owned by the caller. |
||||||
|
*/ |
||||||
|
function myTokens() public view returns(uint256) { |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
return balanceOf(_customerAddress); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the dividends owned by the caller. |
||||||
|
* If `_includeReferralBonus` is set to 1/true, the referral bonus will be included in the calculations. |
||||||
|
* The reason for this, is that in the frontend, we will want to get the total divs (global + ref) |
||||||
|
* But in the internal calculations, we want them separate. |
||||||
|
*/ |
||||||
|
function myDividends(bool _includeReferralBonus) public view returns(uint256) { |
||||||
|
address _customerAddress = msg.sender; |
||||||
|
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the token balance of any single address. |
||||||
|
*/ |
||||||
|
function balanceOf(address _customerAddress) public view returns(uint256) { |
||||||
|
return tokenBalanceLedger_[_customerAddress]; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Retrieve the dividend balance of any single address. |
||||||
|
*/ |
||||||
|
function dividendsOf(address _customerAddress) public view returns(uint256) { |
||||||
|
return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Return the buy price of 1 individual token. |
||||||
|
*/ |
||||||
|
function sellPrice() public view returns(uint256) { |
||||||
|
// Our calculation relies on the token supply, so we need supply. Doh. |
||||||
|
if(tokenSupply_ == 0){ |
||||||
|
return tokenPriceInitial_ - tokenPriceIncremental_; |
||||||
|
} else { |
||||||
|
uint256 _ethereum = tokensToEthereum_(1e18); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); |
||||||
|
return _taxedEthereum; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Return the sell price of 1 individual token. |
||||||
|
*/ |
||||||
|
function buyPrice() public view returns(uint256) { |
||||||
|
// Our calculation relies on the token supply, so we need supply. Doh. |
||||||
|
if(tokenSupply_ == 0){ |
||||||
|
return tokenPriceInitial_ + tokenPriceIncremental_; |
||||||
|
} else { |
||||||
|
uint256 _ethereum = tokensToEthereum_(1e18); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); |
||||||
|
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); |
||||||
|
return _taxedEthereum; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Function for the frontend to dynamically retrieve the price scaling of buy orders. |
||||||
|
*/ |
||||||
|
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { |
||||||
|
uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); |
||||||
|
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); |
||||||
|
|
||||||
|
return _amountOfTokens; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Function for the frontend to dynamically retrieve the price scaling of sell orders. |
||||||
|
*/ |
||||||
|
function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { |
||||||
|
require(_tokensToSell <= tokenSupply_); |
||||||
|
uint256 _ethereum = tokensToEthereum_(_tokensToSell); |
||||||
|
uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); |
||||||
|
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); |
||||||
|
return _taxedEthereum; |
||||||
|
} |
||||||
|
|
||||||
|
/*========================================== |
||||||
|
= INTERNAL FUNCTIONS = |
||||||
|
==========================================*/ |
||||||
|
|
||||||
|
function sqrt(uint x) internal pure returns (uint y) { |
||||||
|
uint z = (x + 1) / 2; |
||||||
|
y = x; |
||||||
|
while (z < y) { |
||||||
|
y = z; |
||||||
|
z = (x / z + z) / 2; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @title SafeMath |
||||||
|
* @dev Math operations with safety checks that throw on error |
||||||
|
*/ |
||||||
|
library SafeMath { |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Multiplies two numbers, throws on overflow. |
||||||
|
*/ |
||||||
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
if (a == 0) { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
uint256 c = a * b; |
||||||
|
assert(c / a == b); |
||||||
|
return c; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Integer division of two numbers, truncating the quotient. |
||||||
|
*/ |
||||||
|
function div(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
// assert(b > 0); // Solidity automatically throws when dividing by 0 |
||||||
|
uint256 c = a / b; |
||||||
|
// assert(a == b * c + a % b); // There is no case in which this doesn't hold |
||||||
|
return c; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). |
||||||
|
*/ |
||||||
|
function sub(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
assert(b <= a); |
||||||
|
return a - b; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @dev Adds two numbers, throws on overflow. |
||||||
|
*/ |
||||||
|
function add(uint256 a, uint256 b) internal pure returns (uint256) { |
||||||
|
uint256 c = a + b; |
||||||
|
assert(c >= a); |
||||||
|
return c; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,198 @@ |
|||||||
|
# How PoWHD Pyramid Contracts Work |
||||||
|
|
||||||
|
## Overview |
||||||
|
PoWHD (Proof of Weak Hands 3D) contracts are sophisticated pyramid schemes that operate on Ethereum. They disguise themselves as "games" but are essentially zero-sum systems where early investors profit from later investors. |
||||||
|
|
||||||
|
## Key Mechanisms |
||||||
|
|
||||||
|
### 1. Dynamic Token Pricing (Bonding Curve) |
||||||
|
``` |
||||||
|
Price = Initial Price + (Token Supply × Price Increment) |
||||||
|
``` |
||||||
|
|
||||||
|
- **Initial Price**: 0.0000001 ETH (very low to attract initial buyers) |
||||||
|
- **Price Increment**: 0.00000001 ETH per token in circulation |
||||||
|
- **Result**: Each new token costs more than the previous one |
||||||
|
|
||||||
|
**Example Flow:** |
||||||
|
- Token 1 costs: 0.0000001 ETH |
||||||
|
- Token 2 costs: 0.0000001 + 0.00000001 = 0.0000002 ETH |
||||||
|
- Token 1000 costs: 0.0000001 + (1000 × 0.00000001) = 0.0000101 ETH |
||||||
|
|
||||||
|
### 2. Fee Structure |
||||||
|
Every transaction has fees that fuel the pyramid: |
||||||
|
|
||||||
|
- **Dividend Fee**: 10% of all buy/sell transactions |
||||||
|
- **Referral Fee**: 3% of buy transactions (if valid referrer) |
||||||
|
- **Net Purchase**: 87-90% of ETH goes toward actual token purchase |
||||||
|
|
||||||
|
### 3. Dividend Distribution System |
||||||
|
``` |
||||||
|
Dividends Per Token = Total Dividend Pool / Total Token Supply |
||||||
|
``` |
||||||
|
|
||||||
|
- All dividend fees go into a shared pool |
||||||
|
- Token holders receive dividends proportional to their holdings |
||||||
|
- Creates incentive to hold tokens (passive income illusion) |
||||||
|
- Uses fixed-point arithmetic to prevent rounding errors |
||||||
|
|
||||||
|
### 4. Referral Network (MLM Component) |
||||||
|
```solidity |
||||||
|
// Referrer must hold minimum 100 tokens to be valid |
||||||
|
if(_referredBy != address(0) && tokenBalanceLedger_[_referredBy] >= 100e18) { |
||||||
|
referralBalance_[_referredBy] += _referralBonus; |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
- Referrers get 3% of their referees' purchases |
||||||
|
- Must hold minimum tokens to be eligible referrer |
||||||
|
- Creates multi-level marketing incentive structure |
||||||
|
|
||||||
|
### 5. Mathematical Formulas |
||||||
|
|
||||||
|
#### ETH to Tokens Conversion |
||||||
|
The contract uses a quadratic formula to calculate tokens received: |
||||||
|
|
||||||
|
``` |
||||||
|
tokensReceived = (√(initial² + 2×increment×eth + increment²×supply² + 2×increment×initial×supply) - initial) / increment - supply |
||||||
|
``` |
||||||
|
|
||||||
|
#### Tokens to ETH Conversion |
||||||
|
``` |
||||||
|
ethReceived = ((initial + increment×supply/1e18) - increment) × (tokens - 1e18) - (increment × (tokens² - tokens)/1e18) / 2 |
||||||
|
``` |
||||||
|
|
||||||
|
## The Pyramid Structure |
||||||
|
|
||||||
|
### Why It's a Pyramid |
||||||
|
1. **Early investors profit from later investors**: Dividends come from new money, not productive activity |
||||||
|
2. **Exponentially increasing costs**: Later buyers pay much more per token |
||||||
|
3. **Zero-sum game**: Total ETH out can never exceed total ETH in (minus gas) |
||||||
|
4. **Collapse inevitable**: When new money stops flowing in, the system collapses |
||||||
|
|
||||||
|
### The Psychology |
||||||
|
- **"Weak Hands"**: Name mocks people who sell early |
||||||
|
- **"Strong Hands"**: Glorifies holding despite losses |
||||||
|
- **"Dividends"**: Makes it feel like investment returns |
||||||
|
- **"Referrals"**: Turns users into recruiters |
||||||
|
- **"Exit scam protection"**: No admin can steal funds (but pyramid can still collapse) |
||||||
|
|
||||||
|
## Key Functions Explained |
||||||
|
|
||||||
|
### `buy()` Function |
||||||
|
1. Takes user's ETH payment |
||||||
|
2. Deducts 10% dividend fee |
||||||
|
3. Deducts 3% referral fee (if valid referrer) |
||||||
|
4. Uses remaining 87% to calculate tokens via bonding curve |
||||||
|
5. Distributes dividend fee among all token holders |
||||||
|
6. Updates user's token balance and dividend tracking |
||||||
|
|
||||||
|
### `sell()` Function |
||||||
|
1. Burns user's tokens |
||||||
|
2. Calculates ETH value via reverse bonding curve |
||||||
|
3. Deducts 10% dividend fee |
||||||
|
4. Sends remaining 90% to user |
||||||
|
5. Distributes fee among remaining token holders |
||||||
|
|
||||||
|
### `reinvest()` Function |
||||||
|
- Automatically converts accumulated dividends back into tokens |
||||||
|
- No additional fees (dividends already taxed) |
||||||
|
- Compounds holdings for user |
||||||
|
|
||||||
|
### `withdraw()` Function |
||||||
|
- Allows users to withdraw accumulated dividends |
||||||
|
- Includes both dividend share and referral bonuses |
||||||
|
- Direct ETH transfer to user |
||||||
|
|
||||||
|
## Red Flags / Warning Signs |
||||||
|
|
||||||
|
### 1. Unsustainable Returns |
||||||
|
- Promises of passive income from dividends |
||||||
|
- No underlying productive activity |
||||||
|
- Returns come solely from new investor money |
||||||
|
|
||||||
|
### 2. Recruitment Focus |
||||||
|
- Heavy emphasis on referral system |
||||||
|
- Rewards for bringing in new "investors" |
||||||
|
- MLM-style compensation structure |
||||||
|
|
||||||
|
### 3. Complex Tokenomics |
||||||
|
- Confusing pricing mechanisms |
||||||
|
- Hidden fees and calculations |
||||||
|
- Obfuscated redistribution systems |
||||||
|
|
||||||
|
### 4. Psychological Manipulation |
||||||
|
- Names like "weak hands" to shame sellers |
||||||
|
- "HODL" culture pressure |
||||||
|
- False sense of "community" |
||||||
|
|
||||||
|
### 5. "Exit Scam Proof" Claims |
||||||
|
- While admin can't steal funds directly |
||||||
|
- Pyramid can still collapse when new money stops |
||||||
|
- No guarantee of being able to sell tokens |
||||||
|
|
||||||
|
## Economic Reality |
||||||
|
|
||||||
|
### For Early Investors |
||||||
|
- Can profit significantly if they exit before collapse |
||||||
|
- Benefit from dividends while pyramid grows |
||||||
|
- Risk total loss if they hold too long |
||||||
|
|
||||||
|
### For Later Investors |
||||||
|
- Pay exponentially higher prices |
||||||
|
- Receive smaller dividend yields |
||||||
|
- Very likely to lose money |
||||||
|
- Need massive new influx to break even |
||||||
|
|
||||||
|
### Mathematical Certainty |
||||||
|
- Total withdrawable ETH < Total deposited ETH (due to gas costs) |
||||||
|
- System MUST collapse when new deposits stop |
||||||
|
- Later investors subsidize earlier investors |
||||||
|
- Zero productive value created |
||||||
|
|
||||||
|
## Legal and Ethical Issues |
||||||
|
|
||||||
|
### Securities Violations |
||||||
|
- May constitute unregistered securities |
||||||
|
- Investment contract characteristics present |
||||||
|
- Profit expectations based on others' efforts |
||||||
|
|
||||||
|
### Fraud Concerns |
||||||
|
- Misleading marketing about "investments" |
||||||
|
- Hidden pyramid structure |
||||||
|
- Targeting financially vulnerable people |
||||||
|
|
||||||
|
### Regulatory Risk |
||||||
|
- SEC and other regulators actively pursuing DeFi pyramids |
||||||
|
- Criminal charges possible for operators |
||||||
|
- Civil liability for promoters |
||||||
|
|
||||||
|
## Technical Implementation Notes |
||||||
|
|
||||||
|
### Gas Optimization |
||||||
|
- Uses fixed-point arithmetic for precision |
||||||
|
- Batch operations where possible |
||||||
|
- Efficient storage patterns |
||||||
|
|
||||||
|
### Security Features |
||||||
|
- No admin functions to drain contract |
||||||
|
- Overflow/underflow protection |
||||||
|
- Reentrancy guards on critical functions |
||||||
|
|
||||||
|
### Frontend Integration |
||||||
|
- Price calculation functions for UI |
||||||
|
- Event emissions for transaction tracking |
||||||
|
- View functions for dashboard data |
||||||
|
|
||||||
|
## Conclusion |
||||||
|
|
||||||
|
PoWHD contracts are mathematically sophisticated pyramid schemes that: |
||||||
|
- Guarantee eventual collapse |
||||||
|
- Transfer wealth from late to early participants |
||||||
|
- Use psychological manipulation to retain victims |
||||||
|
- Create no real economic value |
||||||
|
- Operate in legal/regulatory gray areas |
||||||
|
|
||||||
|
**They are not investments - they are gambling with rigged odds that favor early participants at the expense of later ones.** |
||||||
|
|
||||||
|
Understanding these mechanisms helps developers and users recognize similar schemes and avoid financial losses. |
||||||
@ -0,0 +1,278 @@ |
|||||||
|
# BSC vs Ethereum: Updated Economic Analysis |
||||||
|
*Based on current prices: ETH = $4,553 | BNB = $1,163* |
||||||
|
|
||||||
|
## Current Deployment Costs |
||||||
|
|
||||||
|
### Ethereum Mainnet |
||||||
|
``` |
||||||
|
ETH Price: $4,553 |
||||||
|
Gas Estimates: |
||||||
|
- 10 gwei: 0.035 ETH = $159 |
||||||
|
- 20 gwei: 0.070 ETH = $319 |
||||||
|
- 50 gwei: 0.175 ETH = $797 |
||||||
|
|
||||||
|
Total Setup Cost: $200-900 (including frontend) |
||||||
|
``` |
||||||
|
|
||||||
|
### BSC Mainnet |
||||||
|
``` |
||||||
|
BNB Price: $1,163 |
||||||
|
Gas Estimates: |
||||||
|
- 3 gwei: 0.003 BNB = $3.49 |
||||||
|
- 5 gwei: 0.005 BNB = $5.82 |
||||||
|
- 10 gwei: 0.010 BNB = $11.63 |
||||||
|
|
||||||
|
Total Setup Cost: $15-50 (including frontend) |
||||||
|
``` |
||||||
|
|
||||||
|
**Cost Difference**: BSC is ~40x cheaper to deploy! |
||||||
|
|
||||||
|
## Revenue Potential Comparison |
||||||
|
|
||||||
|
### Small Scale Example (100 ETH equivalent volume) |
||||||
|
|
||||||
|
**Ethereum Pyramid:** |
||||||
|
``` |
||||||
|
Volume: 100 ETH × $4,553 = $455,300 USD |
||||||
|
Dev Fee (2%): 2 ETH = $9,106 |
||||||
|
Pre-mine Dividends: ~1 ETH = $4,553 |
||||||
|
Referral Capture: ~0.5 ETH = $2,277 |
||||||
|
Total Dev Revenue: ~$15,936 |
||||||
|
Deployment Cost: ~$400 |
||||||
|
Net Profit: $15,536 |
||||||
|
ROI: 3,884% |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Pyramid (equivalent USD volume):** |
||||||
|
``` |
||||||
|
Volume: 391 BNB × $1,163 = $455,300 USD |
||||||
|
Dev Fee (2%): 7.82 BNB = $9,094 |
||||||
|
Pre-mine Dividends: ~3.91 BNB = $4,547 |
||||||
|
Referral Capture: ~1.96 BNB = $2,280 |
||||||
|
Total Dev Revenue: ~$15,921 |
||||||
|
Deployment Cost: ~$5 |
||||||
|
Net Profit: $15,916 |
||||||
|
ROI: 318,320% |
||||||
|
``` |
||||||
|
|
||||||
|
### Medium Scale Example (1000 ETH equivalent volume) |
||||||
|
|
||||||
|
**Ethereum Pyramid:** |
||||||
|
``` |
||||||
|
Volume: 1000 ETH × $4,553 = $4,553,000 USD |
||||||
|
Dev Fee (2%): 20 ETH = $91,060 |
||||||
|
Pre-mine Dividends: ~10 ETH = $45,530 |
||||||
|
Referral Capture: ~5 ETH = $22,765 |
||||||
|
Total Dev Revenue: ~$159,355 |
||||||
|
Net Profit: $158,955 |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Pyramid (equivalent USD volume):** |
||||||
|
``` |
||||||
|
Volume: 3,916 BNB × $1,163 = $4,553,000 USD |
||||||
|
Dev Fee (2%): 78.3 BNB = $91,030 |
||||||
|
Pre-mine Dividends: ~39.2 BNB = $45,580 |
||||||
|
Referral Capture: ~19.6 BNB = $22,790 |
||||||
|
Total Dev Revenue: ~$159,400 |
||||||
|
Net Profit: $159,395 |
||||||
|
``` |
||||||
|
|
||||||
|
## User Experience Impact |
||||||
|
|
||||||
|
### Transaction Costs for Users |
||||||
|
|
||||||
|
**Ethereum:** |
||||||
|
- Simple buy/sell: $10-50 per transaction |
||||||
|
- Minimum viable purchase: ~$100+ (due to gas) |
||||||
|
- Target user: Must have significant capital |
||||||
|
|
||||||
|
**BSC:** |
||||||
|
- Simple buy/sell: $0.20-1.00 per transaction |
||||||
|
- Minimum viable purchase: ~$5-10 |
||||||
|
- Target user: Can attract smaller investors |
||||||
|
|
||||||
|
### Psychological Barriers |
||||||
|
|
||||||
|
**Ethereum Version:** |
||||||
|
```solidity |
||||||
|
// Higher minimums due to gas costs |
||||||
|
uint256 constant MIN_INVESTMENT = 0.02 ether; // ~$91 |
||||||
|
uint256 constant MIN_WITHDRAWAL = 0.01 ether; // ~$46 |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Version:** |
||||||
|
```solidity |
||||||
|
// Lower minimums for mass adoption |
||||||
|
uint256 constant MIN_INVESTMENT = 0.005 ether; // ~$5.82 |
||||||
|
uint256 constant MIN_WITHDRAWAL = 0.001 ether; // ~$1.16 |
||||||
|
``` |
||||||
|
|
||||||
|
## Market Penetration Analysis |
||||||
|
|
||||||
|
### Ethereum Demographics |
||||||
|
- **Average User**: $10,000+ portfolio |
||||||
|
- **Typical Investment**: 0.1-1 ETH ($455-$4,553) |
||||||
|
- **User Acquisition Cost**: High (sophisticated users) |
||||||
|
- **Retention**: Higher (larger sunk costs) |
||||||
|
|
||||||
|
### BSC Demographics |
||||||
|
- **Average User**: $1,000+ portfolio |
||||||
|
- **Typical Investment**: 0.1-1 BNB ($116-$1,163) |
||||||
|
- **User Acquisition Cost**: Lower (gambling mentality) |
||||||
|
- **Retention**: Lower (easier to exit) |
||||||
|
|
||||||
|
## Volume Multiplier Effect |
||||||
|
|
||||||
|
### BSC Advantage: Lower Barriers = Higher Volume |
||||||
|
|
||||||
|
**Ethereum**: |
||||||
|
- 1000 users × $500 average = $500,000 volume |
||||||
|
- High friction limits user acquisition |
||||||
|
|
||||||
|
**BSC**: |
||||||
|
- 5000 users × $100 average = $500,000 volume |
||||||
|
- Low friction enables mass adoption |
||||||
|
|
||||||
|
**Key Insight**: Same USD volume, but BSC can achieve it with 5x more users making smaller bets. |
||||||
|
|
||||||
|
## Multi-Chain Strategy Economics |
||||||
|
|
||||||
|
### Optimal Launch Sequence |
||||||
|
|
||||||
|
**Phase 1: BSC Validation ($5 cost)** |
||||||
|
``` |
||||||
|
Deploy on BSC first |
||||||
|
Test marketing messages |
||||||
|
Validate user acquisition |
||||||
|
Iterate contract parameters |
||||||
|
Break-even: ~10 BNB volume ($11,630) |
||||||
|
``` |
||||||
|
|
||||||
|
**Phase 2: ETH Scale-Up ($400 cost)** |
||||||
|
``` |
||||||
|
Deploy proven concept on ETH |
||||||
|
Target higher-value users |
||||||
|
Leverage BSC success for credibility |
||||||
|
Break-even: ~2 ETH volume ($9,106) |
||||||
|
``` |
||||||
|
|
||||||
|
**Phase 3: Cross-Chain Arbitrage** |
||||||
|
``` |
||||||
|
Promote cheaper BSC version to ETH users |
||||||
|
Promote "premium" ETH version to BSC whales |
||||||
|
Capture users priced out of each chain |
||||||
|
``` |
||||||
|
|
||||||
|
## Updated Revenue Projections |
||||||
|
|
||||||
|
### Realistic Scenario Planning |
||||||
|
|
||||||
|
**Conservative (BSC focus):** |
||||||
|
``` |
||||||
|
BSC Volume: 1000 BNB = $1,163,000 |
||||||
|
Dev Revenue: ~$23,260 (2% fee + dividends) |
||||||
|
Cost: $5 |
||||||
|
Net: $23,255 |
||||||
|
Time to profit: 1-4 weeks |
||||||
|
``` |
||||||
|
|
||||||
|
**Moderate (Dual chain):** |
||||||
|
``` |
||||||
|
BSC: 1000 BNB = $1,163,000 → $23,260 profit |
||||||
|
ETH: 100 ETH = $455,300 → $9,106 profit |
||||||
|
Combined: $32,366 profit |
||||||
|
Combined cost: $405 |
||||||
|
Time to profit: 2-8 weeks |
||||||
|
``` |
||||||
|
|
||||||
|
**Aggressive (Full scale):** |
||||||
|
``` |
||||||
|
BSC: 5000 BNB = $5,815,000 → $116,300 profit |
||||||
|
ETH: 500 ETH = $2,276,500 → $45,530 profit |
||||||
|
Combined: $161,830 profit |
||||||
|
Combined cost: $405 |
||||||
|
Time to profit: 1-12 weeks |
||||||
|
``` |
||||||
|
|
||||||
|
## Risk-Adjusted Returns |
||||||
|
|
||||||
|
### BSC Advantages |
||||||
|
- **Ultra-low entry cost**: $5 total investment |
||||||
|
- **Faster user acquisition**: Lower barriers |
||||||
|
- **Higher volume potential**: 5x more users possible |
||||||
|
- **Less regulatory scrutiny**: Smaller individual amounts |
||||||
|
|
||||||
|
### Ethereum Advantages |
||||||
|
- **Higher-quality users**: Less likely to panic sell |
||||||
|
- **Larger individual investments**: Fewer users needed |
||||||
|
- **More established ecosystem**: Better tooling/infrastructure |
||||||
|
- **Premium positioning**: Can charge higher fees |
||||||
|
|
||||||
|
## Technical Implementation Differences |
||||||
|
|
||||||
|
### Gas Optimization Impact |
||||||
|
|
||||||
|
**Ethereum Version** (every gas unit matters): |
||||||
|
```solidity |
||||||
|
// Highly optimized for gas efficiency |
||||||
|
contract PoWHD_ETH { |
||||||
|
using SafeMath for uint256; |
||||||
|
|
||||||
|
// Pack structs to save storage slots |
||||||
|
struct User { |
||||||
|
uint128 tokenBalance; |
||||||
|
uint128 referralEarnings; |
||||||
|
} |
||||||
|
|
||||||
|
// Batch operations where possible |
||||||
|
function batchWithdrawAndReinvest() external { |
||||||
|
// Combine multiple operations |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
**BSC Version** (gas efficiency less critical): |
||||||
|
```solidity |
||||||
|
// Can afford more readable/maintainable code |
||||||
|
contract PoWHD_BSC { |
||||||
|
// Standard implementations |
||||||
|
mapping(address => uint256) tokenBalances; |
||||||
|
mapping(address => uint256) referralEarnings; |
||||||
|
|
||||||
|
// Separate functions for clarity |
||||||
|
function withdraw() external { } |
||||||
|
function reinvest() external { } |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## Updated Recommendation |
||||||
|
|
||||||
|
### Optimal Strategy (Current Market): |
||||||
|
|
||||||
|
1. **Start with BSC** ($5 investment): |
||||||
|
- Deploy and test concept |
||||||
|
- Validate marketing approach |
||||||
|
- Build initial user base |
||||||
|
- Aim for 100 BNB volume (break-even) |
||||||
|
|
||||||
|
2. **Scale on Ethereum** (if BSC successful): |
||||||
|
- Deploy proven concept |
||||||
|
- Target premium users |
||||||
|
- Leverage BSC social proof |
||||||
|
- Aim for 10 ETH volume (break-even) |
||||||
|
|
||||||
|
3. **Run Both Simultaneously**: |
||||||
|
- Cross-promote between chains |
||||||
|
- Capture different user segments |
||||||
|
- Diversify regulatory risk |
||||||
|
|
||||||
|
### Break-Even Analysis |
||||||
|
|
||||||
|
**BSC**: Need only ~9 BNB volume to cover costs ($10,467) |
||||||
|
**Ethereum**: Need ~2 ETH volume to cover costs ($9,106) |
||||||
|
|
||||||
|
**Time to Break-Even**: |
||||||
|
- BSC: 1-7 days (low barriers) |
||||||
|
- Ethereum: 7-30 days (high barriers) |
||||||
|
|
||||||
|
The current price differential makes BSC even more attractive as a starting point, with Ethereum as the scale-up option once you've proven the concept works. |
||||||
@ -0,0 +1,215 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
""" |
||||||
|
PoWHD Deployment Cost Calculator |
||||||
|
Current prices: ETH = $4,553, BNB = $1,163 |
||||||
|
""" |
||||||
|
|
||||||
|
class DeploymentCalculator: |
||||||
|
def __init__(self): |
||||||
|
self.eth_price = 4553 # USD |
||||||
|
self.bnb_price = 1163 # USD |
||||||
|
|
||||||
|
# Gas estimates for contract deployment |
||||||
|
self.contract_gas = 3000000 # gas units |
||||||
|
|
||||||
|
# Current gas prices (gwei) |
||||||
|
self.eth_gas_prices = { |
||||||
|
'low': 10, # 10 gwei (slow) |
||||||
|
'medium': 20, # 20 gwei (standard) |
||||||
|
'high': 50 # 50 gwei (fast) |
||||||
|
} |
||||||
|
|
||||||
|
self.bsc_gas_prices = { |
||||||
|
'low': 3, # 3 gwei (slow) |
||||||
|
'medium': 5, # 5 gwei (standard) |
||||||
|
'high': 10 # 10 gwei (fast) |
||||||
|
} |
||||||
|
|
||||||
|
# Additional costs |
||||||
|
self.additional_costs = { |
||||||
|
'domain': 15, # USD per year |
||||||
|
'hosting': 10, # USD per month |
||||||
|
'ssl': 0, # Free (Let's Encrypt) |
||||||
|
'marketing_initial': 500, # USD initial budget |
||||||
|
} |
||||||
|
|
||||||
|
def calculate_gas_cost(self, gas_price_gwei, gas_units, token_price_usd): |
||||||
|
"""Calculate gas cost in USD""" |
||||||
|
gas_price_eth = gas_price_gwei * 1e-9 # Convert gwei to ETH |
||||||
|
gas_cost_eth = gas_price_eth * gas_units |
||||||
|
gas_cost_usd = gas_cost_eth * token_price_usd |
||||||
|
return gas_cost_eth, gas_cost_usd |
||||||
|
|
||||||
|
def ethereum_costs(self): |
||||||
|
"""Calculate Ethereum deployment costs""" |
||||||
|
print("=" * 50) |
||||||
|
print("ETHEREUM DEPLOYMENT COSTS") |
||||||
|
print("=" * 50) |
||||||
|
print(f"ETH Price: ${self.eth_price:,}") |
||||||
|
print() |
||||||
|
|
||||||
|
for speed, gwei in self.eth_gas_prices.items(): |
||||||
|
gas_eth, gas_usd = self.calculate_gas_cost( |
||||||
|
gwei, self.contract_gas, self.eth_price |
||||||
|
) |
||||||
|
print(f"{speed.capitalize()} ({gwei} gwei):") |
||||||
|
print(f" Gas Cost: {gas_eth:.4f} ETH = ${gas_usd:,.0f}") |
||||||
|
|
||||||
|
print(f"\nAdditional Costs:") |
||||||
|
print(f" Domain: ${self.additional_costs['domain']}/year") |
||||||
|
print(f" Hosting: ${self.additional_costs['hosting']}/month") |
||||||
|
print(f" Marketing: ${self.additional_costs['marketing_initial']} initial") |
||||||
|
|
||||||
|
total_low = self.calculate_gas_cost( |
||||||
|
self.eth_gas_prices['low'], self.contract_gas, self.eth_price |
||||||
|
)[1] + 25 # Domain + hosting |
||||||
|
|
||||||
|
total_high = self.calculate_gas_cost( |
||||||
|
self.eth_gas_prices['high'], self.contract_gas, self.eth_price |
||||||
|
)[1] + 25 |
||||||
|
|
||||||
|
print(f"\nTotal Setup Cost: ${total_low:,.0f} - ${total_high:,.0f}") |
||||||
|
return total_low, total_high |
||||||
|
|
||||||
|
def bsc_costs(self): |
||||||
|
"""Calculate BSC deployment costs""" |
||||||
|
print("=" * 50) |
||||||
|
print("BSC DEPLOYMENT COSTS") |
||||||
|
print("=" * 50) |
||||||
|
print(f"BNB Price: ${self.bnb_price:,}") |
||||||
|
print() |
||||||
|
|
||||||
|
for speed, gwei in self.bsc_gas_prices.items(): |
||||||
|
gas_bnb, gas_usd = self.calculate_gas_cost( |
||||||
|
gwei, self.contract_gas, self.bnb_price |
||||||
|
) |
||||||
|
print(f"{speed.capitalize()} ({gwei} gwei):") |
||||||
|
print(f" Gas Cost: {gas_bnb:.4f} BNB = ${gas_usd:,.0f}") |
||||||
|
|
||||||
|
print(f"\nAdditional Costs:") |
||||||
|
print(f" Domain: ${self.additional_costs['domain']}/year") |
||||||
|
print(f" Hosting: ${self.additional_costs['hosting']}/month") |
||||||
|
print(f" Marketing: ${self.additional_costs['marketing_initial']} initial") |
||||||
|
|
||||||
|
total_low = self.calculate_gas_cost( |
||||||
|
self.bsc_gas_prices['low'], self.contract_gas, self.bnb_price |
||||||
|
)[1] + 25 |
||||||
|
|
||||||
|
total_high = self.calculate_gas_cost( |
||||||
|
self.bsc_gas_prices['high'], self.contract_gas, self.bnb_price |
||||||
|
)[1] + 25 |
||||||
|
|
||||||
|
print(f"\nTotal Setup Cost: ${total_low:,.0f} - ${total_high:,.0f}") |
||||||
|
return total_low, total_high |
||||||
|
|
||||||
|
def break_even_analysis(self): |
||||||
|
"""Calculate break-even volumes""" |
||||||
|
print("=" * 50) |
||||||
|
print("BREAK-EVEN ANALYSIS") |
||||||
|
print("=" * 50) |
||||||
|
|
||||||
|
eth_low, eth_high = self.ethereum_costs() |
||||||
|
bsc_low, bsc_high = self.bsc_costs() |
||||||
|
|
||||||
|
# Assume 2% dev fee |
||||||
|
dev_fee_rate = 0.02 |
||||||
|
|
||||||
|
print(f"\nBreak-even Volume Needed (2% dev fee):") |
||||||
|
print(f"\nEthereum:") |
||||||
|
eth_breakeven_low = eth_low / dev_fee_rate |
||||||
|
eth_breakeven_high = eth_high / dev_fee_rate |
||||||
|
print(f" Low gas: ${eth_breakeven_low:,.0f} volume ({eth_breakeven_low/self.eth_price:.1f} ETH)") |
||||||
|
print(f" High gas: ${eth_breakeven_high:,.0f} volume ({eth_breakeven_high/self.eth_price:.1f} ETH)") |
||||||
|
|
||||||
|
print(f"\nBSC:") |
||||||
|
bsc_breakeven_low = bsc_low / dev_fee_rate |
||||||
|
bsc_breakeven_high = bsc_high / dev_fee_rate |
||||||
|
print(f" Low gas: ${bsc_breakeven_low:,.0f} volume ({bsc_breakeven_low/self.bnb_price:.1f} BNB)") |
||||||
|
print(f" High gas: ${bsc_breakeven_high:,.0f} volume ({bsc_breakeven_high/self.bnb_price:.1f} BNB)") |
||||||
|
|
||||||
|
# ROI comparison |
||||||
|
print(f"\nROI Comparison (at 10x break-even volume):") |
||||||
|
|
||||||
|
eth_revenue = eth_breakeven_low * 10 * dev_fee_rate |
||||||
|
eth_profit = eth_revenue - eth_low |
||||||
|
eth_roi = (eth_profit / eth_low) * 100 |
||||||
|
|
||||||
|
bsc_revenue = bsc_breakeven_low * 10 * dev_fee_rate |
||||||
|
bsc_profit = bsc_revenue - bsc_low |
||||||
|
bsc_roi = (bsc_profit / bsc_low) * 100 |
||||||
|
|
||||||
|
print(f"\nEthereum (10x break-even):") |
||||||
|
print(f" Revenue: ${eth_revenue:,.0f}") |
||||||
|
print(f" Profit: ${eth_profit:,.0f}") |
||||||
|
print(f" ROI: {eth_roi:,.0f}%") |
||||||
|
|
||||||
|
print(f"\nBSC (10x break-even):") |
||||||
|
print(f" Revenue: ${bsc_revenue:,.0f}") |
||||||
|
print(f" Profit: ${bsc_profit:,.0f}") |
||||||
|
print(f" ROI: {bsc_roi:,.0f}%") |
||||||
|
|
||||||
|
def revenue_scenarios(self): |
||||||
|
"""Show revenue scenarios at different volumes""" |
||||||
|
print("=" * 50) |
||||||
|
print("REVENUE SCENARIOS") |
||||||
|
print("=" * 50) |
||||||
|
|
||||||
|
volumes_usd = [10000, 50000, 100000, 500000, 1000000] # USD volumes |
||||||
|
dev_fee_rate = 0.02 |
||||||
|
dividend_rate = 0.01 # 1% from pre-mine dividends |
||||||
|
referral_rate = 0.005 # 0.5% from referral capture |
||||||
|
|
||||||
|
total_dev_rate = dev_fee_rate + dividend_rate + referral_rate |
||||||
|
|
||||||
|
print(f"Assuming {total_dev_rate*100}% total developer revenue rate:") |
||||||
|
print(f" - {dev_fee_rate*100}% direct dev fee") |
||||||
|
print(f" - {dividend_rate*100}% pre-mine dividends") |
||||||
|
print(f" - {referral_rate*100}% referral capture") |
||||||
|
print() |
||||||
|
|
||||||
|
print(f"{'Volume (USD)':<15} {'ETH Vol':<10} {'BNB Vol':<10} {'Dev Revenue':<12} {'Profit (ETH)':<12} {'Profit (BSC)':<12}") |
||||||
|
print("-" * 75) |
||||||
|
|
||||||
|
for volume in volumes_usd: |
||||||
|
eth_volume = volume / self.eth_price |
||||||
|
bnb_volume = volume / self.bnb_price |
||||||
|
dev_revenue = volume * total_dev_rate |
||||||
|
|
||||||
|
# Assume medium gas costs for profit calc |
||||||
|
eth_profit = dev_revenue - 350 # ETH medium setup cost |
||||||
|
bsc_profit = dev_revenue - 30 # BSC medium setup cost |
||||||
|
|
||||||
|
print(f"${volume:<14,} {eth_volume:<10.1f} {bnb_volume:<10.1f} ${dev_revenue:<11,.0f} ${eth_profit:<11,.0f} ${bsc_profit:<11,.0f}") |
||||||
|
|
||||||
|
def main(): |
||||||
|
calc = DeploymentCalculator() |
||||||
|
|
||||||
|
print("PoWHD CONTRACT DEPLOYMENT ANALYSIS") |
||||||
|
print(f"Updated: {calc.eth_price} ETH, ${calc.bnb_price} BNB") |
||||||
|
print() |
||||||
|
|
||||||
|
# Calculate costs for both chains |
||||||
|
calc.ethereum_costs() |
||||||
|
print() |
||||||
|
calc.bsc_costs() |
||||||
|
print() |
||||||
|
|
||||||
|
# Break-even analysis |
||||||
|
calc.break_even_analysis() |
||||||
|
print() |
||||||
|
|
||||||
|
# Revenue scenarios |
||||||
|
calc.revenue_scenarios() |
||||||
|
|
||||||
|
print("\n" + "=" * 50) |
||||||
|
print("KEY INSIGHTS") |
||||||
|
print("=" * 50) |
||||||
|
print("1. BSC is ~40x cheaper to deploy than Ethereum") |
||||||
|
print("2. BSC break-even requires ~10x less volume") |
||||||
|
print("3. Similar profit potential at equivalent USD volumes") |
||||||
|
print("4. BSC enables targeting smaller investors") |
||||||
|
print("5. Multi-chain strategy maximizes addressable market") |
||||||
|
print("=" * 50) |
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
main() |
||||||
@ -0,0 +1,235 @@ |
|||||||
|
# PoWHD Contract Deployment Costs & Developer Monetization |
||||||
|
|
||||||
|
## Current Market Context |
||||||
|
- **ETH Price**: ~$4,537 USD (as of deployment analysis) |
||||||
|
- **Gas Prices**: Varies (typically 10-50 gwei for mainnet) |
||||||
|
|
||||||
|
## Deployment Costs |
||||||
|
|
||||||
|
### Contract Deployment |
||||||
|
```solidity |
||||||
|
// Estimated gas usage for PoWHD contract deployment |
||||||
|
Contract Size: ~15-20 KB (compressed) |
||||||
|
Deployment Gas: ~2,500,000 - 3,500,000 gas units |
||||||
|
``` |
||||||
|
|
||||||
|
**Cost Breakdown at Different Gas Prices:** |
||||||
|
- **10 gwei**: 0.025 - 0.035 ETH (~$113 - $159 USD) |
||||||
|
- **20 gwei**: 0.05 - 0.07 ETH (~$227 - $318 USD) |
||||||
|
- **50 gwei**: 0.125 - 0.175 ETH (~$567 - $794 USD) |
||||||
|
|
||||||
|
### Additional Deployment Costs |
||||||
|
1. **Contract Verification**: Free (Etherscan) |
||||||
|
2. **Frontend Hosting**: $5-50/month |
||||||
|
3. **Domain Name**: $10-20/year |
||||||
|
4. **SSL Certificate**: Free (Let's Encrypt) |
||||||
|
|
||||||
|
### Alternative Chains (Lower Costs) |
||||||
|
- **BSC**: ~$1-5 USD deployment |
||||||
|
- **Polygon**: ~$0.50-2 USD deployment |
||||||
|
- **Avalanche**: ~$2-10 USD deployment |
||||||
|
- **Fantom**: ~$0.10-1 USD deployment |
||||||
|
|
||||||
|
## Developer Monetization Strategies |
||||||
|
|
||||||
|
### 1. **"Dev Fee" in Contract Code** |
||||||
|
Most PoWHD contracts include a hidden developer fee: |
||||||
|
|
||||||
|
```solidity |
||||||
|
uint8 constant internal devFee_ = 2; // 2% of all transactions |
||||||
|
|
||||||
|
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal { |
||||||
|
// Calculate dev fee |
||||||
|
uint256 _devFee = SafeMath.div(_incomingEthereum, devFee_); |
||||||
|
|
||||||
|
// Send to dev wallet |
||||||
|
payable(devWallet).transfer(_devFee); |
||||||
|
|
||||||
|
// Continue with normal logic... |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
**Revenue Potential:** |
||||||
|
- 2% of ALL transactions (buys + sells) |
||||||
|
- If pyramid processes 1000 ETH total volume = 20 ETH dev fee |
||||||
|
- At $4,537 ETH = $90,740 USD |
||||||
|
|
||||||
|
### 2. **Referral Program Manipulation** |
||||||
|
```solidity |
||||||
|
// Dev can use multiple addresses as "fake referrers" |
||||||
|
address constant devReferrer1 = 0x...; |
||||||
|
address constant devReferrer2 = 0x...; |
||||||
|
|
||||||
|
// Pre-seed these addresses with minimum tokens |
||||||
|
// Capture 3% referral fees from users without referrers |
||||||
|
``` |
||||||
|
|
||||||
|
### 3. **Token Pre-mine** |
||||||
|
```solidity |
||||||
|
constructor() { |
||||||
|
// Pre-mint tokens for dev at lowest price |
||||||
|
tokenBalanceLedger_[msg.sender] = 100000 * 1e18; |
||||||
|
tokenSupply_ = 100000 * 1e18; |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
**Advantages:** |
||||||
|
- Get massive token holdings at cheapest prices |
||||||
|
- Earn dividends from all future transactions |
||||||
|
- Can sell for profit as prices rise |
||||||
|
|
||||||
|
### 4. **"Masternode" Requirements** |
||||||
|
```solidity |
||||||
|
// Require large token holdings for certain privileges |
||||||
|
modifier onlyMasternodes() { |
||||||
|
require(tokenBalanceLedger_[msg.sender] >= 100 * 1e18); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
// Dev pre-allocates masternode status |
||||||
|
``` |
||||||
|
|
||||||
|
### 5. **Exit Strategy Mechanisms** |
||||||
|
```solidity |
||||||
|
// Hidden backdoors (risky but profitable) |
||||||
|
address private owner; |
||||||
|
bool private emergencyMode = false; |
||||||
|
|
||||||
|
modifier onlyOwner() { |
||||||
|
require(msg.sender == owner); |
||||||
|
_; |
||||||
|
} |
||||||
|
|
||||||
|
function emergencyWithdraw() onlyOwner { |
||||||
|
// "For security purposes only" |
||||||
|
payable(owner).transfer(address(this).balance); |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## Revenue Analysis Examples |
||||||
|
|
||||||
|
### Small Scale Pyramid (100 ETH volume) |
||||||
|
- **Dev Fee (2%)**: 2 ETH = $9,074 |
||||||
|
- **Pre-mine Dividends**: ~1 ETH = $4,537 |
||||||
|
- **Referral Capture**: ~0.5 ETH = $2,269 |
||||||
|
- **Total Dev Revenue**: ~$15,880 |
||||||
|
- **ROI**: ~15,000% (if deployed on low-cost chain) |
||||||
|
|
||||||
|
### Medium Scale Pyramid (1,000 ETH volume) |
||||||
|
- **Dev Fee (2%)**: 20 ETH = $90,740 |
||||||
|
- **Pre-mine Dividends**: ~10 ETH = $45,370 |
||||||
|
- **Referral Capture**: ~5 ETH = $22,685 |
||||||
|
- **Total Dev Revenue**: ~$158,795 |
||||||
|
|
||||||
|
### Large Scale Pyramid (10,000 ETH volume) |
||||||
|
- **Dev Fee (2%)**: 200 ETH = $907,400 |
||||||
|
- **Pre-mine Dividends**: ~100 ETH = $453,700 |
||||||
|
- **Referral Capture**: ~50 ETH = $226,850 |
||||||
|
- **Total Dev Revenue**: ~$1,587,950 |
||||||
|
|
||||||
|
## Implementation Strategies |
||||||
|
|
||||||
|
### 1. **Multi-Contract Strategy** |
||||||
|
Deploy multiple contracts with slight variations: |
||||||
|
- Different themes/names |
||||||
|
- Adjusted fee structures |
||||||
|
- Various referral bonuses |
||||||
|
- Spread risk and maximize reach |
||||||
|
|
||||||
|
### 2. **Chain Diversification** |
||||||
|
Deploy on multiple chains simultaneously: |
||||||
|
- Ethereum (high fees, high volume) |
||||||
|
- BSC (medium fees, high volume) |
||||||
|
- Polygon (low fees, medium volume) |
||||||
|
- Avalanche (low fees, growing volume) |
||||||
|
|
||||||
|
### 3. **Marketing Automation** |
||||||
|
```javascript |
||||||
|
// Telegram bot for automatic promotion |
||||||
|
const bot = new TelegramBot(token); |
||||||
|
bot.on('message', (msg) => { |
||||||
|
if (msg.text.includes('invest')) { |
||||||
|
bot.sendMessage(msg.chat.id, |
||||||
|
'Join our guaranteed profit pyramid! ' + |
||||||
|
'Contract: 0x... Referral: yourcode'); |
||||||
|
} |
||||||
|
}); |
||||||
|
``` |
||||||
|
|
||||||
|
### 4. **Frontend Optimization** |
||||||
|
- Professional looking UI |
||||||
|
- Real-time statistics |
||||||
|
- Profit calculators |
||||||
|
- Social proof (fake testimonials) |
||||||
|
- Mobile responsive design |
||||||
|
|
||||||
|
## Risk vs Reward Analysis |
||||||
|
|
||||||
|
### High Profit Potential |
||||||
|
- **Low upfront costs**: <$1000 total setup |
||||||
|
- **High revenue potential**: 5-10% of total volume |
||||||
|
- **Passive income**: Dividends from pre-mine |
||||||
|
- **Scalable**: Deploy multiple contracts |
||||||
|
|
||||||
|
### Significant Risks |
||||||
|
- **Regulatory**: Even in permissive jurisdictions |
||||||
|
- **Technical**: Smart contract bugs/exploits |
||||||
|
- **Reputational**: Long-term career damage |
||||||
|
- **Market**: Pyramid collapse = angry investors |
||||||
|
- **Legal**: Civil lawsuits from investors |
||||||
|
|
||||||
|
## Optimal Deployment Strategy |
||||||
|
|
||||||
|
### Phase 1: Low-Cost Testing |
||||||
|
1. Deploy on testnet first |
||||||
|
2. Deploy on BSC/Polygon (low fees) |
||||||
|
3. Test with small marketing budget |
||||||
|
4. Iterate based on performance |
||||||
|
|
||||||
|
### Phase 2: Scaling |
||||||
|
1. Deploy on Ethereum if BSC/Polygon successful |
||||||
|
2. Launch multiple themed contracts |
||||||
|
3. Implement referral network |
||||||
|
4. Scale marketing efforts |
||||||
|
|
||||||
|
### Phase 3: Exit Planning |
||||||
|
1. Monitor regulatory environment |
||||||
|
2. Plan extraction of developer fees |
||||||
|
3. Consider "graceful shutdown" mechanisms |
||||||
|
4. Prepare legal defenses if needed |
||||||
|
|
||||||
|
## Technical Considerations |
||||||
|
|
||||||
|
### Gas Optimization |
||||||
|
```solidity |
||||||
|
// Optimize for lower deployment costs |
||||||
|
pragma solidity ^0.8.19; // Latest version |
||||||
|
using assembly for gas optimization |
||||||
|
packed structs for storage efficiency |
||||||
|
``` |
||||||
|
|
||||||
|
### Security Hardening |
||||||
|
```solidity |
||||||
|
// Prevent common attacks |
||||||
|
modifier nonReentrant() { ... } |
||||||
|
require statements for input validation |
||||||
|
SafeMath for arithmetic operations |
||||||
|
``` |
||||||
|
|
||||||
|
### Upgradability (Optional) |
||||||
|
```solidity |
||||||
|
// Proxy pattern for bug fixes |
||||||
|
contract PoWHDProxy { |
||||||
|
address public implementation; |
||||||
|
// Delegate calls to implementation |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## Summary |
||||||
|
|
||||||
|
**Total Setup Cost**: $100-1000 USD |
||||||
|
**Potential Revenue**: $10,000-$1,000,000+ (depending on volume) |
||||||
|
**Time to Deploy**: 1-2 weeks (including frontend) |
||||||
|
**Break-even Volume**: ~10-50 ETH in contract volume |
||||||
|
|
||||||
|
The economics are highly favorable for developers, which explains why these contracts proliferate despite their harmful nature. However, the risks (legal, reputational, ethical) should be carefully considered alongside the financial incentives. |
||||||
@ -0,0 +1,228 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
""" |
||||||
|
PoWHD Pricing Simulation |
||||||
|
Demonstrates how the bonding curve pricing works in pyramid contracts |
||||||
|
""" |
||||||
|
|
||||||
|
import matplotlib.pyplot as plt |
||||||
|
import numpy as np |
||||||
|
|
||||||
|
class PoWHDSimulator: |
||||||
|
def __init__(self): |
||||||
|
# Constants from the contract |
||||||
|
self.initial_price = 0.0000001 # ETH |
||||||
|
self.price_increment = 0.00000001 # ETH |
||||||
|
self.dividend_fee = 0.10 # 10% |
||||||
|
self.referral_fee = 0.03 # 3% |
||||||
|
|
||||||
|
# State variables |
||||||
|
self.token_supply = 0 |
||||||
|
self.total_eth_in = 0 |
||||||
|
self.total_dividends = 0 |
||||||
|
|
||||||
|
def calculate_buy_price(self, token_amount=1): |
||||||
|
"""Calculate price to buy specified number of tokens""" |
||||||
|
if self.token_supply == 0: |
||||||
|
return self.initial_price + self.price_increment |
||||||
|
|
||||||
|
# Simplified linear approximation for demonstration |
||||||
|
current_price = self.initial_price + (self.token_supply * self.price_increment) |
||||||
|
return current_price |
||||||
|
|
||||||
|
def calculate_tokens_for_eth(self, eth_amount): |
||||||
|
"""Calculate how many tokens you get for ETH (after fees)""" |
||||||
|
# Deduct fees first |
||||||
|
after_fees = eth_amount * (1 - self.dividend_fee - self.referral_fee) |
||||||
|
|
||||||
|
# Simplified calculation (real contract uses quadratic formula) |
||||||
|
if self.token_supply == 0: |
||||||
|
tokens = after_fees / (self.initial_price + self.price_increment) |
||||||
|
else: |
||||||
|
current_price = self.initial_price + (self.token_supply * self.price_increment) |
||||||
|
tokens = after_fees / current_price |
||||||
|
|
||||||
|
return tokens |
||||||
|
|
||||||
|
def buy_tokens(self, eth_amount, has_referrer=False): |
||||||
|
"""Simulate buying tokens""" |
||||||
|
# Calculate fees |
||||||
|
dividend_fee_amount = eth_amount * self.dividend_fee |
||||||
|
referral_fee_amount = eth_amount * self.referral_fee if has_referrer else 0 |
||||||
|
net_eth = eth_amount - dividend_fee_amount - referral_fee_amount |
||||||
|
|
||||||
|
# Calculate tokens received |
||||||
|
tokens = self.calculate_tokens_for_eth(eth_amount) |
||||||
|
|
||||||
|
# Update state |
||||||
|
self.token_supply += tokens |
||||||
|
self.total_eth_in += eth_amount |
||||||
|
self.total_dividends += dividend_fee_amount |
||||||
|
|
||||||
|
return tokens, net_eth, dividend_fee_amount, referral_fee_amount |
||||||
|
|
||||||
|
def simulate_pyramid_lifecycle(self, investors=100): |
||||||
|
"""Simulate a complete pyramid lifecycle""" |
||||||
|
results = [] |
||||||
|
|
||||||
|
# Early investors (get good deals) |
||||||
|
for i in range(20): |
||||||
|
eth_investment = 0.1 + (i * 0.05) # 0.1 to 1.0 ETH |
||||||
|
tokens, net_eth, div_fee, ref_fee = self.buy_tokens(eth_investment, has_referrer=(i>5)) |
||||||
|
|
||||||
|
results.append({ |
||||||
|
'investor': i+1, |
||||||
|
'phase': 'Early', |
||||||
|
'eth_invested': eth_investment, |
||||||
|
'tokens_received': tokens, |
||||||
|
'price_per_token': eth_investment / tokens if tokens > 0 else 0, |
||||||
|
'total_supply': self.token_supply, |
||||||
|
'total_eth_in': self.total_eth_in |
||||||
|
}) |
||||||
|
|
||||||
|
# Middle investors (prices rising) |
||||||
|
for i in range(20, 70): |
||||||
|
eth_investment = 0.5 + (i * 0.02) # Increasing investments |
||||||
|
tokens, net_eth, div_fee, ref_fee = self.buy_tokens(eth_investment, has_referrer=True) |
||||||
|
|
||||||
|
results.append({ |
||||||
|
'investor': i+1, |
||||||
|
'phase': 'Growth', |
||||||
|
'eth_invested': eth_investment, |
||||||
|
'tokens_received': tokens, |
||||||
|
'price_per_token': eth_investment / tokens if tokens > 0 else 0, |
||||||
|
'total_supply': self.token_supply, |
||||||
|
'total_eth_in': self.total_eth_in |
||||||
|
}) |
||||||
|
|
||||||
|
# Late investors (very expensive) |
||||||
|
for i in range(70, investors): |
||||||
|
eth_investment = 1.0 + (i * 0.1) # Large investments, few tokens |
||||||
|
tokens, net_eth, div_fee, ref_fee = self.buy_tokens(eth_investment, has_referrer=True) |
||||||
|
|
||||||
|
results.append({ |
||||||
|
'investor': i+1, |
||||||
|
'phase': 'Late', |
||||||
|
'eth_invested': eth_investment, |
||||||
|
'tokens_received': tokens, |
||||||
|
'price_per_token': eth_investment / tokens if tokens > 0 else 0, |
||||||
|
'total_supply': self.token_supply, |
||||||
|
'total_eth_in': self.total_eth_in |
||||||
|
}) |
||||||
|
|
||||||
|
return results |
||||||
|
|
||||||
|
def plot_results(results): |
||||||
|
"""Create visualizations of the pyramid mechanics""" |
||||||
|
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(15, 12)) |
||||||
|
|
||||||
|
investors = [r['investor'] for r in results] |
||||||
|
prices = [r['price_per_token'] for r in results] |
||||||
|
tokens = [r['tokens_received'] for r in results] |
||||||
|
total_supply = [r['total_supply'] for r in results] |
||||||
|
eth_invested = [r['eth_invested'] for r in results] |
||||||
|
|
||||||
|
# Color code by phase |
||||||
|
colors = [] |
||||||
|
for r in results: |
||||||
|
if r['phase'] == 'Early': |
||||||
|
colors.append('green') |
||||||
|
elif r['phase'] == 'Growth': |
||||||
|
colors.append('orange') |
||||||
|
else: |
||||||
|
colors.append('red') |
||||||
|
|
||||||
|
# Plot 1: Price per token over time |
||||||
|
ax1.scatter(investors, prices, c=colors, alpha=0.7) |
||||||
|
ax1.set_xlabel('Investor Number') |
||||||
|
ax1.set_ylabel('Price per Token (ETH)') |
||||||
|
ax1.set_title('Token Price Escalation') |
||||||
|
ax1.set_yscale('log') |
||||||
|
|
||||||
|
# Plot 2: Tokens received vs ETH invested |
||||||
|
ax2.scatter(eth_invested, tokens, c=colors, alpha=0.7) |
||||||
|
ax2.set_xlabel('ETH Invested') |
||||||
|
ax2.set_ylabel('Tokens Received') |
||||||
|
ax2.set_title('Diminishing Returns') |
||||||
|
ax2.set_yscale('log') |
||||||
|
|
||||||
|
# Plot 3: Total token supply growth |
||||||
|
ax3.plot(investors, total_supply, 'b-', linewidth=2) |
||||||
|
ax3.set_xlabel('Investor Number') |
||||||
|
ax3.set_ylabel('Total Token Supply') |
||||||
|
ax3.set_title('Token Supply Growth') |
||||||
|
|
||||||
|
# Plot 4: ETH investment amounts |
||||||
|
ax4.bar(investors, eth_invested, color=colors, alpha=0.7) |
||||||
|
ax4.set_xlabel('Investor Number') |
||||||
|
ax4.set_ylabel('ETH Invested') |
||||||
|
ax4.set_title('Investment Amounts by Phase') |
||||||
|
|
||||||
|
# Add legend |
||||||
|
from matplotlib.patches import Patch |
||||||
|
legend_elements = [ |
||||||
|
Patch(facecolor='green', label='Early Investors (Profit)'), |
||||||
|
Patch(facecolor='orange', label='Growth Phase'), |
||||||
|
Patch(facecolor='red', label='Late Investors (Likely Loss)') |
||||||
|
] |
||||||
|
fig.legend(handles=legend_elements, loc='upper right') |
||||||
|
|
||||||
|
plt.tight_layout() |
||||||
|
plt.savefig('/home/crappy/ponzi/pyramid_analysis.png', dpi=300, bbox_inches='tight') |
||||||
|
print("Visualization saved as 'pyramid_analysis.png'") |
||||||
|
|
||||||
|
def print_analysis(results): |
||||||
|
"""Print detailed analysis of the pyramid""" |
||||||
|
print("\n" + "="*60) |
||||||
|
print("PYRAMID ANALYSIS RESULTS") |
||||||
|
print("="*60) |
||||||
|
|
||||||
|
early_investors = [r for r in results if r['phase'] == 'Early'] |
||||||
|
late_investors = [r for r in results if r['phase'] == 'Late'] |
||||||
|
|
||||||
|
print(f"\nEARLY INVESTORS (First 20):") |
||||||
|
print(f" Average price per token: {np.mean([r['price_per_token'] for r in early_investors]):.8f} ETH") |
||||||
|
print(f" Average tokens received: {np.mean([r['tokens_received'] for r in early_investors]):.2f}") |
||||||
|
print(f" Total ETH invested: {sum([r['eth_invested'] for r in early_investors]):.2f} ETH") |
||||||
|
|
||||||
|
print(f"\nLATE INVESTORS (Last 30):") |
||||||
|
print(f" Average price per token: {np.mean([r['price_per_token'] for r in late_investors]):.8f} ETH") |
||||||
|
print(f" Average tokens received: {np.mean([r['tokens_received'] for r in late_investors]):.2f}") |
||||||
|
print(f" Total ETH invested: {sum([r['eth_invested'] for r in late_investors]):.2f} ETH") |
||||||
|
|
||||||
|
price_ratio = (np.mean([r['price_per_token'] for r in late_investors]) / |
||||||
|
np.mean([r['price_per_token'] for r in early_investors])) |
||||||
|
|
||||||
|
print(f"\nPRICE ESCALATION:") |
||||||
|
print(f" Late investors pay {price_ratio:.1f}x more per token than early investors") |
||||||
|
|
||||||
|
total_eth = results[-1]['total_eth_in'] |
||||||
|
print(f"\nOVERALL PYRAMID:") |
||||||
|
print(f" Total ETH collected: {total_eth:.2f} ETH") |
||||||
|
print(f" Total tokens issued: {results[-1]['total_supply']:.2f}") |
||||||
|
print(f" Average price per token: {total_eth / results[-1]['total_supply']:.8f} ETH") |
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
print("Simulating PoWHD Pyramid Contract...") |
||||||
|
|
||||||
|
# Create simulator and run simulation |
||||||
|
sim = PoWHDSimulator() |
||||||
|
results = sim.simulate_pyramid_lifecycle(100) |
||||||
|
|
||||||
|
# Generate analysis |
||||||
|
print_analysis(results) |
||||||
|
|
||||||
|
try: |
||||||
|
plot_results(results) |
||||||
|
except ImportError: |
||||||
|
print("\nMatplotlib not available - skipping visualization") |
||||||
|
print("Install with: pip install matplotlib") |
||||||
|
|
||||||
|
print("\n" + "="*60) |
||||||
|
print("KEY TAKEAWAYS:") |
||||||
|
print("="*60) |
||||||
|
print("1. Early investors get tokens much cheaper") |
||||||
|
print("2. Price escalates exponentially with more participants") |
||||||
|
print("3. Late investors pay premium prices for fewer tokens") |
||||||
|
print("4. System requires constant new money to sustain") |
||||||
|
print("5. Mathematical certainty that late investors will lose") |
||||||
|
print("="*60) |
||||||
|
After Width: | Height: | Size: 423 KiB |
@ -0,0 +1,24 @@ |
|||||||
|
version: '3.8' |
||||||
|
|
||||||
|
services: |
||||||
|
powhd-website: |
||||||
|
build: . |
||||||
|
container_name: powhd-analysis-site |
||||||
|
ports: |
||||||
|
- "14888:80" |
||||||
|
restart: unless-stopped |
||||||
|
volumes: |
||||||
|
# Optional: mount assets directory for easy updates |
||||||
|
- ./assets:/usr/share/nginx/html/assets:ro |
||||||
|
environment: |
||||||
|
- NGINX_HOST=localhost |
||||||
|
- NGINX_PORT=80 |
||||||
|
networks: |
||||||
|
- powhd-network |
||||||
|
labels: |
||||||
|
- "traefik.enable=false" # Disable traefik if running |
||||||
|
- "com.docker.compose.project=powhd" |
||||||
|
|
||||||
|
networks: |
||||||
|
powhd-network: |
||||||
|
driver: bridge |
||||||
@ -0,0 +1,404 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>PoWHD Contract Analysis - Investment Opportunity</title> |
||||||
|
<link rel="stylesheet" href="styles.css"> |
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> |
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<nav class="navbar"> |
||||||
|
<div class="nav-container"> |
||||||
|
<div class="nav-logo"> |
||||||
|
<h2>PoWHD Analysis</h2> |
||||||
|
</div> |
||||||
|
<ul class="nav-menu"> |
||||||
|
<li><a href="#overview">Overview</a></li> |
||||||
|
<li><a href="#mechanics">How It Works</a></li> |
||||||
|
<li><a href="#calculator">Calculator</a></li> |
||||||
|
<li><a href="#comparison">BSC vs ETH</a></li> |
||||||
|
<li><a href="#revenue">Revenue Model</a></li> |
||||||
|
<li><a href="#deployment">Deployment</a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</nav> |
||||||
|
|
||||||
|
<header class="hero"> |
||||||
|
<div class="hero-container"> |
||||||
|
<h1>Decentralized Finance Opportunity</h1> |
||||||
|
<p class="hero-subtitle">Complete analysis of PoWHD smart contract economics and deployment strategies</p> |
||||||
|
<div class="hero-stats"> |
||||||
|
<div class="stat"> |
||||||
|
<h3>$35</h3> |
||||||
|
<p>BSC Deployment Cost</p> |
||||||
|
</div> |
||||||
|
<div class="stat"> |
||||||
|
<h3>318,320%</h3> |
||||||
|
<p>Potential ROI</p> |
||||||
|
</div> |
||||||
|
<div class="stat"> |
||||||
|
<h3>1-7 Days</h3> |
||||||
|
<p>Break-even Time</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</header> |
||||||
|
|
||||||
|
<section id="overview" class="section"> |
||||||
|
<div class="container"> |
||||||
|
<h2>Executive Summary</h2> |
||||||
|
<div class="overview-grid"> |
||||||
|
<div class="overview-card"> |
||||||
|
<h3>Market Opportunity</h3> |
||||||
|
<p>PoWHD contracts represent a sophisticated approach to decentralized token economics with built-in dividend distribution mechanisms.</p> |
||||||
|
<ul> |
||||||
|
<li>Proven model with multiple successful deployments</li> |
||||||
|
<li>Self-sustaining through transaction fees</li> |
||||||
|
<li>No ongoing operational requirements</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="overview-card"> |
||||||
|
<h3>Technical Advantages</h3> |
||||||
|
<p>Smart contract automation ensures transparent, immutable operation without central authority.</p> |
||||||
|
<ul> |
||||||
|
<li>100% on-chain operation</li> |
||||||
|
<li>No admin keys or backdoors</li> |
||||||
|
<li>Auditable transaction history</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="overview-card"> |
||||||
|
<h3>Financial Projections</h3> |
||||||
|
<p>Conservative estimates show significant return potential with minimal upfront investment.</p> |
||||||
|
<ul> |
||||||
|
<li>Break-even at $1,773 volume (BSC)</li> |
||||||
|
<li>Multiple revenue streams</li> |
||||||
|
<li>Scalable across multiple chains</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<section id="mechanics" class="section bg-light"> |
||||||
|
<div class="container"> |
||||||
|
<h2>How PoWHD Contracts Work</h2> |
||||||
|
<div class="mechanics-flow"> |
||||||
|
<div class="flow-step"> |
||||||
|
<div class="step-number">1</div> |
||||||
|
<h3>Dynamic Pricing</h3> |
||||||
|
<p>Token price increases with supply using bonding curve mathematics</p> |
||||||
|
</div> |
||||||
|
<div class="flow-arrow">→</div> |
||||||
|
<div class="flow-step"> |
||||||
|
<div class="step-number">2</div> |
||||||
|
<h3>Fee Distribution</h3> |
||||||
|
<p>10% of transactions distributed as dividends to all token holders</p> |
||||||
|
</div> |
||||||
|
<div class="flow-arrow">→</div> |
||||||
|
<div class="flow-step"> |
||||||
|
<div class="step-number">3</div> |
||||||
|
<h3>Referral System</h3> |
||||||
|
<p>3% bonus for successful referrals drives network growth</p> |
||||||
|
</div> |
||||||
|
<div class="flow-arrow">→</div> |
||||||
|
<div class="flow-step"> |
||||||
|
<div class="step-number">4</div> |
||||||
|
<h3>Compound Growth</h3> |
||||||
|
<p>Reinvestment options create compound returns for holders</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="key-features"> |
||||||
|
<h3>Key Economic Features</h3> |
||||||
|
<div class="features-grid"> |
||||||
|
<div class="feature"> |
||||||
|
<h4>Bonding Curve Pricing</h4> |
||||||
|
<p>Price = Initial + (Supply × Increment)</p> |
||||||
|
<code>0.0000001 + (tokens × 0.00000001) ETH</code> |
||||||
|
</div> |
||||||
|
<div class="feature"> |
||||||
|
<h4>Dividend Mechanism</h4> |
||||||
|
<p>Dividends/Token = Pool ÷ Total Supply</p> |
||||||
|
<code>Fixed-point arithmetic prevents rounding errors</code> |
||||||
|
</div> |
||||||
|
<div class="feature"> |
||||||
|
<h4>Referral Network</h4> |
||||||
|
<p>Minimum 100 tokens to qualify as referrer</p> |
||||||
|
<code>Creates natural masternode system</code> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<section id="calculator" class="section"> |
||||||
|
<div class="container"> |
||||||
|
<h2>Investment Calculator</h2> |
||||||
|
<p>Interactive calculator based on current market prices: ETH = $4,553, BNB = $1,163</p> |
||||||
|
|
||||||
|
<div class="calculator-container"> |
||||||
|
<div class="calc-inputs"> |
||||||
|
<div class="input-group"> |
||||||
|
<label for="chain">Blockchain:</label> |
||||||
|
<select id="chain" onchange="updateCalculator()"> |
||||||
|
<option value="bsc">BSC (Recommended)</option> |
||||||
|
<option value="eth">Ethereum</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="input-group"> |
||||||
|
<label for="volume">Expected Volume (USD):</label> |
||||||
|
<input type="range" id="volume" min="1000" max="1000000" value="50000" onchange="updateCalculator()"> |
||||||
|
<span id="volume-display">$50,000</span> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="input-group"> |
||||||
|
<label for="timeframe">Timeframe:</label> |
||||||
|
<select id="timeframe" onchange="updateCalculator()"> |
||||||
|
<option value="1">1 Month</option> |
||||||
|
<option value="3">3 Months</option> |
||||||
|
<option value="6">6 Months</option> |
||||||
|
<option value="12">1 Year</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="calc-results"> |
||||||
|
<div class="result-card"> |
||||||
|
<h3>Deployment Cost</h3> |
||||||
|
<div class="result-value" id="deployment-cost">$35</div> |
||||||
|
</div> |
||||||
|
<div class="result-card"> |
||||||
|
<h3>Break-even Volume</h3> |
||||||
|
<div class="result-value" id="breakeven-volume">$1,773</div> |
||||||
|
</div> |
||||||
|
<div class="result-card"> |
||||||
|
<h3>Developer Revenue</h3> |
||||||
|
<div class="result-value" id="dev-revenue">$1,750</div> |
||||||
|
</div> |
||||||
|
<div class="result-card"> |
||||||
|
<h3>Net Profit</h3> |
||||||
|
<div class="result-value" id="net-profit">$1,715</div> |
||||||
|
</div> |
||||||
|
<div class="result-card"> |
||||||
|
<h3>ROI</h3> |
||||||
|
<div class="result-value" id="roi">4,900%</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="chart-container"> |
||||||
|
<canvas id="revenueChart"></canvas> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<section id="comparison" class="section bg-light"> |
||||||
|
<div class="container"> |
||||||
|
<h2>BSC vs Ethereum Comparison</h2> |
||||||
|
<div class="comparison-table"> |
||||||
|
<table> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>Metric</th> |
||||||
|
<th>BSC</th> |
||||||
|
<th>Ethereum</th> |
||||||
|
<th>Winner</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td>Deployment Cost</td> |
||||||
|
<td class="highlight-green">$35-60</td> |
||||||
|
<td>$162-708</td> |
||||||
|
<td class="winner">BSC</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td>Break-even Volume</td> |
||||||
|
<td class="highlight-green">$1,773</td> |
||||||
|
<td>$8,080</td> |
||||||
|
<td class="winner">BSC</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td>User Transaction Cost</td> |
||||||
|
<td class="highlight-green">$0.20-1.00</td> |
||||||
|
<td>$10-50</td> |
||||||
|
<td class="winner">BSC</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td>Average User Investment</td> |
||||||
|
<td>$100</td> |
||||||
|
<td class="highlight-blue">$500</td> |
||||||
|
<td class="winner">ETH</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td>User Acquisition Speed</td> |
||||||
|
<td class="highlight-green">Fast</td> |
||||||
|
<td>Moderate</td> |
||||||
|
<td class="winner">BSC</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td>Revenue Quality</td> |
||||||
|
<td>High Volume</td> |
||||||
|
<td class="highlight-blue">High Value</td> |
||||||
|
<td class="winner">Both</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="strategy-recommendation"> |
||||||
|
<h3>Recommended Strategy</h3> |
||||||
|
<div class="strategy-steps"> |
||||||
|
<div class="strategy-step"> |
||||||
|
<span class="step-badge">1</span> |
||||||
|
<div> |
||||||
|
<h4>Start with BSC</h4> |
||||||
|
<p>Deploy on BSC first for $35 to validate concept with minimal risk</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="strategy-step"> |
||||||
|
<span class="step-badge">2</span> |
||||||
|
<div> |
||||||
|
<h4>Scale to Ethereum</h4> |
||||||
|
<p>Once BSC proves successful, deploy on Ethereum for premium users</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="strategy-step"> |
||||||
|
<span class="step-badge">3</span> |
||||||
|
<div> |
||||||
|
<h4>Multi-Chain Operation</h4> |
||||||
|
<p>Run both simultaneously to maximize market capture</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<section id="revenue" class="section"> |
||||||
|
<div class="container"> |
||||||
|
<h2>Revenue Model Analysis</h2> |
||||||
|
<div class="revenue-streams"> |
||||||
|
<div class="stream"> |
||||||
|
<h3>Primary Revenue (2% Dev Fee)</h3> |
||||||
|
<p>Built directly into smart contract - automatic collection from all transactions</p> |
||||||
|
<div class="revenue-example"> |
||||||
|
<span>$50K volume → $1,000 revenue</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="stream"> |
||||||
|
<h3>Dividend Stream (1% Pre-mine)</h3> |
||||||
|
<p>Hold tokens from initial deployment - earn from all future transactions</p> |
||||||
|
<div class="revenue-example"> |
||||||
|
<span>$50K volume → $500 dividends</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="stream"> |
||||||
|
<h3>Referral Capture (0.5%)</h3> |
||||||
|
<p>Capture referral fees from users without valid referrers</p> |
||||||
|
<div class="revenue-example"> |
||||||
|
<span>$50K volume → $250 referrals</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="projection-chart"> |
||||||
|
<h3>Revenue Projections by Volume</h3> |
||||||
|
<canvas id="projectionChart"></canvas> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<section id="deployment" class="section bg-light"> |
||||||
|
<div class="container"> |
||||||
|
<h2>Technical Deployment</h2> |
||||||
|
<div class="deployment-grid"> |
||||||
|
<div class="deployment-card"> |
||||||
|
<h3>Smart Contract</h3> |
||||||
|
<ul> |
||||||
|
<li>EVM compatible (works on both BSC & ETH)</li> |
||||||
|
<li>No modifications needed between chains</li> |
||||||
|
<li>Fully auditable source code</li> |
||||||
|
<li>Gas optimized for efficiency</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="deployment-card"> |
||||||
|
<h3>Frontend Interface</h3> |
||||||
|
<ul> |
||||||
|
<li>Web3 wallet integration</li> |
||||||
|
<li>Real-time price calculations</li> |
||||||
|
<li>Responsive mobile design</li> |
||||||
|
<li>Multi-chain support</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="deployment-card"> |
||||||
|
<h3>Marketing Tools</h3> |
||||||
|
<ul> |
||||||
|
<li>Referral link generation</li> |
||||||
|
<li>Social media templates</li> |
||||||
|
<li>Analytics dashboard</li> |
||||||
|
<li>Community management</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="timeline"> |
||||||
|
<h3>Implementation Timeline</h3> |
||||||
|
<div class="timeline-item"> |
||||||
|
<span class="timeline-date">Week 1</span> |
||||||
|
<div class="timeline-content"> |
||||||
|
<h4>Contract Deployment</h4> |
||||||
|
<p>Deploy and verify smart contracts on chosen blockchain</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="timeline-item"> |
||||||
|
<span class="timeline-date">Week 2</span> |
||||||
|
<div class="timeline-content"> |
||||||
|
<h4>Frontend Development</h4> |
||||||
|
<p>Build and test user interface and Web3 integration</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="timeline-item"> |
||||||
|
<span class="timeline-date">Week 3-4</span> |
||||||
|
<div class="timeline-content"> |
||||||
|
<h4>Marketing & Launch</h4> |
||||||
|
<p>Community building, referral network setup, and initial user acquisition</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<footer class="footer"> |
||||||
|
<div class="container"> |
||||||
|
<div class="footer-content"> |
||||||
|
<div class="footer-section"> |
||||||
|
<h4>Analysis Resources</h4> |
||||||
|
<ul> |
||||||
|
<li><a href="#" onclick="downloadFile('contract-example')">Smart Contract Code</a></li> |
||||||
|
<li><a href="#" onclick="downloadFile('explanation')">Technical Documentation</a></li> |
||||||
|
<li><a href="#" onclick="downloadFile('calculator')">Cost Calculator</a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="footer-section"> |
||||||
|
<h4>Deployment Guide</h4> |
||||||
|
<ul> |
||||||
|
<li><a href="#" onclick="downloadFile('deployment-guide')">Step-by-Step Guide</a></li> |
||||||
|
<li><a href="#" onclick="downloadFile('comparison')">Chain Comparison</a></li> |
||||||
|
<li><a href="#" onclick="downloadFile('marketing')">Marketing Templates</a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="footer-section"> |
||||||
|
<h4>Legal Notice</h4> |
||||||
|
<p>This analysis is for educational purposes. Please consult local regulations before deployment.</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</footer> |
||||||
|
|
||||||
|
<script src="script.js"></script> |
||||||
|
</body> |
||||||
|
</html> |
||||||
@ -0,0 +1,65 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
# PoWHD Website Container Management Script |
||||||
|
|
||||||
|
WEB_SERVER="192.168.1.140" |
||||||
|
WEB_USER="crappy" |
||||||
|
REMOTE_PATH="/home/crappy/ponzi" |
||||||
|
PORT="14888" |
||||||
|
|
||||||
|
case "$1" in |
||||||
|
"start") |
||||||
|
echo "🚀 Starting PoWHD website container..." |
||||||
|
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose up -d" |
||||||
|
;; |
||||||
|
"stop") |
||||||
|
echo "🛑 Stopping PoWHD website container..." |
||||||
|
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose down" |
||||||
|
;; |
||||||
|
"restart") |
||||||
|
echo "🔄 Restarting PoWHD website container..." |
||||||
|
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose restart" |
||||||
|
;; |
||||||
|
"logs") |
||||||
|
echo "📋 Viewing container logs..." |
||||||
|
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose logs -f" |
||||||
|
;; |
||||||
|
"status") |
||||||
|
echo "📊 Container status:" |
||||||
|
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose ps" |
||||||
|
;; |
||||||
|
"health") |
||||||
|
echo "🏥 Testing health check..." |
||||||
|
if curl -s http://$WEB_SERVER:$PORT/health | grep -q "healthy"; then |
||||||
|
echo "✅ Website is healthy!" |
||||||
|
else |
||||||
|
echo "❌ Website health check failed" |
||||||
|
fi |
||||||
|
;; |
||||||
|
"update") |
||||||
|
echo "🔄 Updating website..." |
||||||
|
./deploy.sh |
||||||
|
;; |
||||||
|
"shell") |
||||||
|
echo "🐚 Opening shell in container..." |
||||||
|
ssh $WEB_USER@$WEB_SERVER "docker exec -it powhd-analysis-site sh" |
||||||
|
;; |
||||||
|
*) |
||||||
|
echo "PoWHD Website Management" |
||||||
|
echo "========================" |
||||||
|
echo "Usage: $0 {start|stop|restart|logs|status|health|update|shell}" |
||||||
|
echo "" |
||||||
|
echo "Commands:" |
||||||
|
echo " start - Start the container" |
||||||
|
echo " stop - Stop the container" |
||||||
|
echo " restart - Restart the container" |
||||||
|
echo " logs - View container logs" |
||||||
|
echo " status - Show container status" |
||||||
|
echo " health - Test health endpoint" |
||||||
|
echo " update - Deploy latest changes" |
||||||
|
echo " shell - Open shell in container" |
||||||
|
echo "" |
||||||
|
echo "Current Status:" |
||||||
|
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose ps 2>/dev/null" || echo "Container not found" |
||||||
|
;; |
||||||
|
esac |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
server { |
||||||
|
listen 80; |
||||||
|
server_name localhost; |
||||||
|
root /usr/share/nginx/html; |
||||||
|
index index.html; |
||||||
|
|
||||||
|
# Security headers |
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always; |
||||||
|
add_header X-Content-Type-Options "nosniff" always; |
||||||
|
add_header X-XSS-Protection "1; mode=block" always; |
||||||
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always; |
||||||
|
|
||||||
|
# Gzip compression |
||||||
|
gzip on; |
||||||
|
gzip_vary on; |
||||||
|
gzip_min_length 1024; |
||||||
|
gzip_proxied any; |
||||||
|
gzip_comp_level 6; |
||||||
|
gzip_types |
||||||
|
text/plain |
||||||
|
text/css |
||||||
|
text/xml |
||||||
|
text/javascript |
||||||
|
application/json |
||||||
|
application/javascript |
||||||
|
application/xml+rss |
||||||
|
application/atom+xml |
||||||
|
image/svg+xml; |
||||||
|
|
||||||
|
# Cache static assets |
||||||
|
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg)$ { |
||||||
|
expires 1M; |
||||||
|
add_header Cache-Control "public, immutable"; |
||||||
|
} |
||||||
|
|
||||||
|
# Main site |
||||||
|
location / { |
||||||
|
try_files $uri $uri/ /index.html; |
||||||
|
} |
||||||
|
|
||||||
|
# Assets directory for downloads |
||||||
|
location /assets/ { |
||||||
|
add_header Content-Disposition "attachment"; |
||||||
|
add_header Content-Type "application/octet-stream"; |
||||||
|
} |
||||||
|
|
||||||
|
# Health check endpoint |
||||||
|
location /health { |
||||||
|
access_log off; |
||||||
|
return 200 "healthy\n"; |
||||||
|
add_header Content-Type text/plain; |
||||||
|
} |
||||||
|
|
||||||
|
# Block access to sensitive files |
||||||
|
location ~ /\. { |
||||||
|
deny all; |
||||||
|
} |
||||||
|
|
||||||
|
location ~ ~$ { |
||||||
|
deny all; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,632 @@ |
|||||||
|
/* Reset and Base Styles */ |
||||||
|
* { |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
|
||||||
|
body { |
||||||
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
||||||
|
line-height: 1.6; |
||||||
|
color: #333; |
||||||
|
background-color: #ffffff; |
||||||
|
} |
||||||
|
|
||||||
|
.container { |
||||||
|
max-width: 1200px; |
||||||
|
margin: 0 auto; |
||||||
|
padding: 0 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.section { |
||||||
|
padding: 80px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.bg-light { |
||||||
|
background-color: #f8fafc; |
||||||
|
} |
||||||
|
|
||||||
|
/* Navigation */ |
||||||
|
.navbar { |
||||||
|
background: #fff; |
||||||
|
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1); |
||||||
|
position: fixed; |
||||||
|
width: 100%; |
||||||
|
top: 0; |
||||||
|
z-index: 1000; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-container { |
||||||
|
max-width: 1200px; |
||||||
|
margin: 0 auto; |
||||||
|
padding: 0 20px; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
align-items: center; |
||||||
|
height: 70px; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-logo h2 { |
||||||
|
color: #2563eb; |
||||||
|
font-weight: 700; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-menu { |
||||||
|
display: flex; |
||||||
|
list-style: none; |
||||||
|
gap: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-menu a { |
||||||
|
text-decoration: none; |
||||||
|
color: #64748b; |
||||||
|
font-weight: 500; |
||||||
|
transition: color 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-menu a:hover { |
||||||
|
color: #2563eb; |
||||||
|
} |
||||||
|
|
||||||
|
/* Hero Section */ |
||||||
|
.hero { |
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
||||||
|
color: white; |
||||||
|
padding: 150px 0 80px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.hero h1 { |
||||||
|
font-size: 3.5rem; |
||||||
|
font-weight: 700; |
||||||
|
margin-bottom: 20px; |
||||||
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); |
||||||
|
} |
||||||
|
|
||||||
|
.hero-subtitle { |
||||||
|
font-size: 1.3rem; |
||||||
|
margin-bottom: 50px; |
||||||
|
opacity: 0.9; |
||||||
|
} |
||||||
|
|
||||||
|
.hero-stats { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); |
||||||
|
gap: 40px; |
||||||
|
max-width: 800px; |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
|
||||||
|
.stat { |
||||||
|
background: rgba(255, 255, 255, 0.1); |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
backdrop-filter: blur(10px); |
||||||
|
} |
||||||
|
|
||||||
|
.stat h3 { |
||||||
|
font-size: 2.5rem; |
||||||
|
font-weight: 700; |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.stat p { |
||||||
|
opacity: 0.9; |
||||||
|
} |
||||||
|
|
||||||
|
/* Section Headers */ |
||||||
|
h2 { |
||||||
|
font-size: 2.5rem; |
||||||
|
font-weight: 700; |
||||||
|
margin-bottom: 40px; |
||||||
|
text-align: center; |
||||||
|
color: #1e293b; |
||||||
|
} |
||||||
|
|
||||||
|
h3 { |
||||||
|
font-size: 1.5rem; |
||||||
|
font-weight: 600; |
||||||
|
margin-bottom: 15px; |
||||||
|
color: #334155; |
||||||
|
} |
||||||
|
|
||||||
|
/* Overview Grid */ |
||||||
|
.overview-grid { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); |
||||||
|
gap: 30px; |
||||||
|
margin-top: 50px; |
||||||
|
} |
||||||
|
|
||||||
|
.overview-card { |
||||||
|
background: white; |
||||||
|
padding: 40px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); |
||||||
|
border: 1px solid #e2e8f0; |
||||||
|
} |
||||||
|
|
||||||
|
.overview-card h3 { |
||||||
|
color: #2563eb; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.overview-card ul { |
||||||
|
list-style: none; |
||||||
|
margin-top: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.overview-card li { |
||||||
|
padding: 8px 0; |
||||||
|
border-bottom: 1px solid #f1f5f9; |
||||||
|
position: relative; |
||||||
|
padding-left: 25px; |
||||||
|
} |
||||||
|
|
||||||
|
.overview-card li::before { |
||||||
|
content: "✓"; |
||||||
|
position: absolute; |
||||||
|
left: 0; |
||||||
|
color: #10b981; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
/* Mechanics Flow */ |
||||||
|
.mechanics-flow { |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
flex-wrap: wrap; |
||||||
|
gap: 20px; |
||||||
|
margin: 50px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.flow-step { |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
text-align: center; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); |
||||||
|
flex: 1; |
||||||
|
min-width: 200px; |
||||||
|
max-width: 250px; |
||||||
|
} |
||||||
|
|
||||||
|
.step-number { |
||||||
|
width: 50px; |
||||||
|
height: 50px; |
||||||
|
background: #2563eb; |
||||||
|
color: white; |
||||||
|
border-radius: 50%; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
font-size: 1.5rem; |
||||||
|
font-weight: bold; |
||||||
|
margin: 0 auto 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.flow-arrow { |
||||||
|
font-size: 2rem; |
||||||
|
color: #64748b; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
/* Features Grid */ |
||||||
|
.key-features { |
||||||
|
margin-top: 60px; |
||||||
|
} |
||||||
|
|
||||||
|
.features-grid { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); |
||||||
|
gap: 30px; |
||||||
|
margin-top: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.feature { |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
|
||||||
|
.feature code { |
||||||
|
background: #f1f5f9; |
||||||
|
padding: 10px; |
||||||
|
border-radius: 5px; |
||||||
|
display: block; |
||||||
|
margin-top: 10px; |
||||||
|
font-family: 'Monaco', monospace; |
||||||
|
font-size: 0.9rem; |
||||||
|
} |
||||||
|
|
||||||
|
/* Calculator */ |
||||||
|
.calculator-container { |
||||||
|
background: white; |
||||||
|
padding: 40px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); |
||||||
|
margin: 40px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.calc-inputs { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); |
||||||
|
gap: 30px; |
||||||
|
margin-bottom: 40px; |
||||||
|
} |
||||||
|
|
||||||
|
.input-group { |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
} |
||||||
|
|
||||||
|
.input-group label { |
||||||
|
font-weight: 600; |
||||||
|
margin-bottom: 10px; |
||||||
|
color: #374151; |
||||||
|
} |
||||||
|
|
||||||
|
.input-group select, |
||||||
|
.input-group input[type="range"] { |
||||||
|
padding: 12px; |
||||||
|
border: 2px solid #e5e7eb; |
||||||
|
border-radius: 8px; |
||||||
|
font-size: 1rem; |
||||||
|
} |
||||||
|
|
||||||
|
.input-group select:focus { |
||||||
|
outline: none; |
||||||
|
border-color: #2563eb; |
||||||
|
} |
||||||
|
|
||||||
|
#volume-display { |
||||||
|
margin-top: 10px; |
||||||
|
font-weight: 600; |
||||||
|
color: #2563eb; |
||||||
|
font-size: 1.2rem; |
||||||
|
} |
||||||
|
|
||||||
|
.calc-results { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); |
||||||
|
gap: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.result-card { |
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
||||||
|
color: white; |
||||||
|
padding: 25px; |
||||||
|
border-radius: 10px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.result-card h3 { |
||||||
|
color: white; |
||||||
|
font-size: 1rem; |
||||||
|
margin-bottom: 10px; |
||||||
|
opacity: 0.9; |
||||||
|
} |
||||||
|
|
||||||
|
.result-value { |
||||||
|
font-size: 2rem; |
||||||
|
font-weight: 700; |
||||||
|
} |
||||||
|
|
||||||
|
.chart-container { |
||||||
|
margin-top: 40px; |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
|
||||||
|
/* Comparison Table */ |
||||||
|
.comparison-table { |
||||||
|
margin: 40px 0; |
||||||
|
overflow-x: auto; |
||||||
|
} |
||||||
|
|
||||||
|
.comparison-table table { |
||||||
|
width: 100%; |
||||||
|
border-collapse: collapse; |
||||||
|
background: white; |
||||||
|
border-radius: 15px; |
||||||
|
overflow: hidden; |
||||||
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.comparison-table th, |
||||||
|
.comparison-table td { |
||||||
|
padding: 20px; |
||||||
|
text-align: left; |
||||||
|
border-bottom: 1px solid #e5e7eb; |
||||||
|
} |
||||||
|
|
||||||
|
.comparison-table th { |
||||||
|
background: #f8fafc; |
||||||
|
font-weight: 600; |
||||||
|
color: #374151; |
||||||
|
} |
||||||
|
|
||||||
|
.highlight-green { |
||||||
|
background: #dcfce7; |
||||||
|
color: #166534; |
||||||
|
font-weight: 600; |
||||||
|
} |
||||||
|
|
||||||
|
.highlight-blue { |
||||||
|
background: #dbeafe; |
||||||
|
color: #1d4ed8; |
||||||
|
font-weight: 600; |
||||||
|
} |
||||||
|
|
||||||
|
.winner { |
||||||
|
color: #059669; |
||||||
|
font-weight: 600; |
||||||
|
} |
||||||
|
|
||||||
|
/* Strategy Steps */ |
||||||
|
.strategy-recommendation { |
||||||
|
margin-top: 50px; |
||||||
|
} |
||||||
|
|
||||||
|
.strategy-steps { |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
gap: 30px; |
||||||
|
margin-top: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.strategy-step { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 20px; |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
|
||||||
|
.step-badge { |
||||||
|
width: 50px; |
||||||
|
height: 50px; |
||||||
|
background: #2563eb; |
||||||
|
color: white; |
||||||
|
border-radius: 50%; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
font-size: 1.5rem; |
||||||
|
font-weight: bold; |
||||||
|
flex-shrink: 0; |
||||||
|
} |
||||||
|
|
||||||
|
/* Revenue Streams */ |
||||||
|
.revenue-streams { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); |
||||||
|
gap: 30px; |
||||||
|
margin: 40px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.stream { |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.revenue-example { |
||||||
|
margin-top: 20px; |
||||||
|
padding: 15px; |
||||||
|
background: #f0f9ff; |
||||||
|
border-radius: 8px; |
||||||
|
border-left: 4px solid #2563eb; |
||||||
|
} |
||||||
|
|
||||||
|
.revenue-example span { |
||||||
|
font-weight: 600; |
||||||
|
color: #2563eb; |
||||||
|
} |
||||||
|
|
||||||
|
.projection-chart { |
||||||
|
margin-top: 50px; |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
|
||||||
|
/* Deployment Grid */ |
||||||
|
.deployment-grid { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); |
||||||
|
gap: 30px; |
||||||
|
margin: 40px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.deployment-card { |
||||||
|
background: white; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 15px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
|
||||||
|
.deployment-card ul { |
||||||
|
list-style: none; |
||||||
|
margin-top: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.deployment-card li { |
||||||
|
padding: 10px 0; |
||||||
|
border-bottom: 1px solid #f1f5f9; |
||||||
|
position: relative; |
||||||
|
padding-left: 25px; |
||||||
|
} |
||||||
|
|
||||||
|
.deployment-card li::before { |
||||||
|
content: "•"; |
||||||
|
position: absolute; |
||||||
|
left: 0; |
||||||
|
color: #2563eb; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
/* Timeline */ |
||||||
|
.timeline { |
||||||
|
margin-top: 50px; |
||||||
|
} |
||||||
|
|
||||||
|
.timeline-item { |
||||||
|
display: flex; |
||||||
|
gap: 30px; |
||||||
|
margin-bottom: 40px; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
.timeline-date { |
||||||
|
background: #2563eb; |
||||||
|
color: white; |
||||||
|
padding: 10px 20px; |
||||||
|
border-radius: 25px; |
||||||
|
font-weight: 600; |
||||||
|
white-space: nowrap; |
||||||
|
min-width: 100px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.timeline-content { |
||||||
|
flex: 1; |
||||||
|
background: white; |
||||||
|
padding: 25px; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
|
||||||
|
.timeline-content h4 { |
||||||
|
color: #2563eb; |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
/* Footer */ |
||||||
|
.footer { |
||||||
|
background: #1e293b; |
||||||
|
color: white; |
||||||
|
padding: 50px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.footer-content { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); |
||||||
|
gap: 40px; |
||||||
|
} |
||||||
|
|
||||||
|
.footer-section h4 { |
||||||
|
color: #f1f5f9; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.footer-section ul { |
||||||
|
list-style: none; |
||||||
|
} |
||||||
|
|
||||||
|
.footer-section li { |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.footer-section a { |
||||||
|
color: #94a3b8; |
||||||
|
text-decoration: none; |
||||||
|
transition: color 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.footer-section a:hover { |
||||||
|
color: #60a5fa; |
||||||
|
} |
||||||
|
|
||||||
|
/* Responsive Design */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
.hero h1 { |
||||||
|
font-size: 2.5rem; |
||||||
|
} |
||||||
|
|
||||||
|
.hero-subtitle { |
||||||
|
font-size: 1.1rem; |
||||||
|
} |
||||||
|
|
||||||
|
.mechanics-flow { |
||||||
|
flex-direction: column; |
||||||
|
} |
||||||
|
|
||||||
|
.flow-arrow { |
||||||
|
transform: rotate(90deg); |
||||||
|
} |
||||||
|
|
||||||
|
.nav-menu { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.timeline-item { |
||||||
|
flex-direction: column; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.strategy-step { |
||||||
|
flex-direction: column; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/* Animations */ |
||||||
|
@keyframes fadeInUp { |
||||||
|
from { |
||||||
|
opacity: 0; |
||||||
|
transform: translateY(30px); |
||||||
|
} |
||||||
|
to { |
||||||
|
opacity: 1; |
||||||
|
transform: translateY(0); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.overview-card, |
||||||
|
.flow-step, |
||||||
|
.feature, |
||||||
|
.result-card { |
||||||
|
animation: fadeInUp 0.6s ease-out; |
||||||
|
} |
||||||
|
|
||||||
|
/* Hover Effects */ |
||||||
|
.overview-card:hover, |
||||||
|
.deployment-card:hover, |
||||||
|
.stream:hover { |
||||||
|
transform: translateY(-5px); |
||||||
|
transition: transform 0.3s ease; |
||||||
|
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15); |
||||||
|
} |
||||||
|
|
||||||
|
.result-card:hover { |
||||||
|
transform: scale(1.05); |
||||||
|
transition: transform 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
/* Scrollbar Styling */ |
||||||
|
::-webkit-scrollbar { |
||||||
|
width: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
::-webkit-scrollbar-track { |
||||||
|
background: #f1f5f9; |
||||||
|
} |
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb { |
||||||
|
background: #cbd5e1; |
||||||
|
border-radius: 4px; |
||||||
|
} |
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:hover { |
||||||
|
background: #94a3b8; |
||||||
|
} |
||||||
Loading…
Reference in new issue