contract DepositsContract { uint256 constant public DEPOSIT_MIN = 10 finney; event Deposited(address indexed payee, uint256 weiAmount); event Withdrawn(address indexed payee, uint256 weiAmount); uint256 public totalDeposited = 0; uint256 public totalWithdrawn = 0; // mapping(address => uint256) public shares; // mapping(address => uint256) public released; struct Deposit { address wallet; uint256 createdAt; uint256 accrualAt; uint256 endAt; uint256 accrued; uint256 totalForAccrual; } struct User { uint256 _id; uint256 createdAt; address upline; uint256 totalDeposited; mapping (uint256 => Deposit) deposits; } address[] public wallets; mapping(address => User) public users; mapping(uint256 => Deposit) public deposits; constructor() public {} function paying() payable public { address wallet = msg.sender; uint256 amount = msg.value; require(wallet != address(0)); require(amount >= DEPOSIT_MIN); if(users[wallet].createdAt==0){ users[wallet] = User({_id: wallets.length + 1, createdAt: now, upline: 0x0, totalDeposited: 0}); wallets.push(wallet); } users[wallet].totalDeposited += amount; totalDeposited += amount; emit Deposited(wallet, amount); } function getTotalDeposited() public view returns(uint256) { return totalDeposited; } function getDepositMin() public pure returns(uint256) { return DEPOSIT_MIN; } }
0.4.25