Invest/Donate so i can continue developing smart contracts
Please donate/Invest at 0xA01F32b1898Ea5c0079997D28bF00D441Ad0883c
Donate/Invest so i can focus on smart contracts ,add more smart contracts here and fix the bugs.Thank you !
Contract 1:
Turn your token in to shares/stocks with my honeypot contract .
pragma solidity ^0.4.24;
contract ERC20 {
function totalSupply() public constant returns (uint _totalSupply);
function balanceOf(address _owner) public constant returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
contract HoneyPot {
//step 1 create admin
address public honeypotadmin;
address public contractaddress;
address public tokenaddress;
address public useraddr;
uint public withdrawlimit;
uint public mindeposit;
uint public maxdeposit;
uint public totaltokenbalance;
uint public allowrelease;
uint public sharedamount;
uint public sharevalue;
// Here Stibco becomes owner of the main contract
function CreateAdmin() public {
if(honeypotadmin!=address(0)){
honeypotadmin = honeypotadmin;
}else{
honeypotadmin = msg.sender;
}
}
//only admin addr
modifier adminsets() {
require(msg.sender == honeypotadmin);
_;
}
function AddTokenAndSetLimit(address token,uint withdrawlimi,uint minimumdeposit,uint maximumdeposit) public payable adminsets {
require(withdrawlimit == 0);
tokenaddress = token;
withdrawlimit = withdrawlimi;
mindeposit = minimumdeposit;
maxdeposit = maximumdeposit;
contractaddress = address(this);
allowrelease = 0;
}
//users deposits
mapping (address => uint) public sharesbyaddress;
//user has to approve before deposit
function UserDepositsToken(address tokensaddress,uint amount) public payable {
require(tokenaddress == tokensaddress);
require(amount >= mindeposit);
require(amount <= maxdeposit);
require(amount > 0);
sharesbyaddress[msg.sender] = sharesbyaddress[msg.sender] + amount;
totaltokenbalance = totaltokenbalance + amount;
ERC20(tokensaddress).transferFrom(msg.sender,contractaddress,amount);
}
function DepositETH(uint amount) public payable{
require(amount == msg.value);
}
function AllowRelease() public payable {
if(withdrawlimit == address(this).balance){
//allow relase for all users
allowrelease = 1;
}
}
function UserWithdraws() public payable {
require(allowrelease == 1);
//total eth balance = 10 000 000
//case 1 total user deposited = 1000 token
//case 2 total user deposited = 95.8542 token
//total token balance in contract = 1000000 token
sharevalue = address(this).balance / totaltokenbalance;
sharedamount = sharevalue * sharesbyaddress[msg.sender];
useraddr = msg.sender;
useraddr.transfer(sharedamount);
}
//get contract address
function getContractAddr() public view returns (address) {
return contractaddress;
}
//get contract balance
function getContractBalance() public view returns (uint) {
return address(this).balance;
}
//get Minimum deposit amount set by Admin
function getMinAm() public view returns (uint) {
return mindeposit;
}
//get Maximum deposit amount set by Admin
function getMaxAm() public view returns (uint) {
return maxdeposit;
}
//get withdrawlimit set by Admin
function getWithdrawLimit() public view returns (uint) {
return withdrawlimit;
}
//get allowedtoken set by Admin
function getAllowedToken() public view returns (address) {
return tokenaddress;
}
//get token balance
function getBalanceToken() public view returns (uint) {
return totaltokenbalance;
}
//get contract admin
function getContractAdmin() public view returns (address) {
return honeypotadmin;
}
//get user total tokens deposited
function getUserTotalTokens(address uaddr) public view returns (uint) {
return sharesbyaddress[uaddr];
}
}