SmartBillions smart contract improved: Hackathon 2.0 started!
SmartBillions Hackathon second round just started. SmartBillions smart contract is improved and now we are pleased to announce the Hackathon second round.
1500 ETH was put in the smart contract address to validate the contract security after the improvements were made.
Smart contract address:
https://etherscan.io/address/0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c
The list of contract improvements:
- transferFrom function: You can only send owned Tokens.
- addHashes function: the database initiation is now safer.
- hotStore function: Anyone can deposit funds in the contact.
- coldStore function: In case of emergency the admin Is allowed to withdraw the whole surplus over the contract liabilities only when over 50 % of Tokens are redeemed.
- won function: will not return the bet value in case of database error
- play function: players are required to store more information in the database.
The hackathon prize was deposited in the smart contract using the hotStore function by 6 different ETH addresses. The hotStore function allows any address to store funds anytime in the smart contract and then withdraw the prior stored amount using the won function. However the Jackpot management rules apply to these withdraws. One address cannot withdraw more than 50 % of the contract value and withdraws can be made every (46024*30) blocks
1500 ETH Hackathon prize will be withdrawn in 2 cases: - If there’s another bug found in the contract and Hacker will not withdraw all the funds, the remaining funds will be withdrawn by the same addresses that deposited the funds using the won function.
- If the funds will remain intact before the ICO the same addresses that deposited the funds will be able to withdraw exactly the same amounts as deposited (Hackathon prizes) in the later phase.
The funds from the first Hackathon were withdrawn by the Admin using the coldStore function.
The withdraw was possible because there weren’t any liabilities on the contract such as Token redeem and win payouts. There weren’t any wins to pay out because the players were able to claim the wins after a given time period, they weren’t the lottery winners right after the lottery draw. At the moment of the Admin withdraw there were no wins to pay.
The funds raised during an ICO are protected within the smart contract.
Withdrawals by the admin are possible in the coldStore function only under certain conditions.
function coldStore(uint _amount) external onlyOwner
{
houseKeeping();
require(_amount > 0 && this.balance >= (investBalance * 9 / 10) + walletBalance + _amount);
if(investBalance >= investBalanceGot / 2){ // additional jackpot protection
require((_amount <= this.balance / 400) && coldStoreLast + 4 60 24 * 7 <= block.number);
}
msg.sender.transfer(_amount);
coldStoreLast = block.number;
}
This line:
require(_amount > 0 && this.balance >= (investBalance * 9 / 10) + walletBalance + _amount);
guarantees that the admin can never withdraw funds that are protected: the 90% of the funds invested during the ICO plus the funds in wallets waiting to be withdrawn (these includes unpaid prizes due to lack of funds in the contract; however these prizes must have been claimed with the won() function before, otherwise the prizes are not known to the contract).
There is also an additional important limit that the withdraw amount must be smaller than 0.25% of the jackpot and this fraction cannot be withdrawn more often than every 7 days (46024*7 blocks).
This additional limit is waived if 50% of investors decide to disinvest.
This additional limit means that if there is a large lottery win waiting but the winner did not collect his winnings yet, then the admin can run away with 0.25% of the current jackpot , leaving 99.75% of the jackpot still in the contract. Thus this risk has a negligible effect on the collected funds by the winner. The regular withdraw of 0.25% per week by the admin to promote the lottery is an expected behavior.
you are right to describe the details things, follow me
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Until you're more transparent as an organization, I have a hard time believing the community will back your lottery, the concept is great. The code is better than last week, but I feel as though the first hackathon did a really big number on your reputations..just my opinion hope it helps. @smartbillions
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @smartbillions! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @smartbillions! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit