ERC20-based crowsale token using pre-sale incentives, shareholders and refunds (if funding goal not met) Refunds and Withdrawal of shareholder funds are controlled by the contract.
TO TEST with Ethereum Wallet:
- Connect to, and fully synch the Ethereum Wallet with the TEST network (Ropsten or Rinkeby)
- Create 4 new accounts from the File Menu: "owner", "buyer", vault" and one or more "shareholders"
- Give owner at least .5 test eth from a faucet (https://faucet.metamask.io/ works well if you have metamask)
- Give buyer at least 5 ether
- Click Contracts - Deploy New Contract
- Paste in the AGE_Token.sol file contents
- Edit line 7 & 8 if you wish to name your Token
- Edit Line #27 uint256 minFundingGoal = 10000000000000000000000; change to 5000000000000000000; (10,000 eth to 5 eth)
- Edit Line #29 address AGE_Vault = 0x29725Ac55276EdE262ed17F3e95483cAf7DBCc77; <- overwite the address with your vault address from step #1
- Edit Line #30 address AGE_EOS_Community = 0x5d9d570Ab2DfB72c9dCDCA6A5bf3E1dacDa433d9; <- overwrite the address with your shareholder
- Edit Line #149
preSaleEndBlock = SafeMath.add(startBlock, 5 days); change '5 days' to '10 minutes'
and change Line #150
endBlock = SafeMath.add(startBlock, 95 days); change '95 days to '20 minutes' - IMPORTANT: set from at the top to be owner
- Under select contact to deploy - select the Token (not SafeMath or tokenRecepient - they will 'ride along')
- Add some gas if you're in a hurry, and click Deploy
- Wait for confirmations
- Click Contracts on top right, then your contract
- Select Set_Live from the dropdown, check the checkbox, and IMPORTANT: select Owner to execute from
- Wait for Confirmations -
Your token is live. You can scroll down and check the running values like isLive, isFunded, your start and end time and so on. If you created more than one shareholder: you can list their addresses by changing the value in the Payees box (0,1,2,3..)
- On the contract page - click copy address
- From the Buyer - send 1 eth to the contract address
- Wait for confirmations, and check to see the buyer got 1,250 tokens and the vault got its 20%
- Wait for the pre-sale time to end and repeat step #19
- This time the buyer only got 1,000 tokens, and the vault got 20%
- Wait for the end of the sale (check endblock value on the token page)
- Try and send a small amount of ether to the contract... it will fail we're done selling) and refunds enabled should now be Yes.
- Go to the contact page, select refund from the drop-down, paste in the buyers address and execute from buyer
- You'll note (after confirmation) the ether in the contract has dropped and the buyer got their ether back
- Go back up to Step #16 and Set_Live to true again
- Send the contract 6 ether from buyer
- You will now see on the contract page isFunded is yes (since we set 5 ether as a minimum funding goal
- Select Claim from the contract drop-down
- Pick one of your shareholders and click execute
- Note that the contracts ether was reduced and the shareholder got their share
- If you try to have the same shareholder grab more ether - they wont be able to
- If you have the buyer send more ether - the same shareholder can get claim their share of the new ether
NOTE: The amount of shares a shareholder owns is set at lines 219-228 in the contract. Since solidity doesn't do decimals, 10 shares = 1%. 805 shares = 80.5%. The contract allows you to add shareholders on the fly (while it's running) - and will adjust everyones shares accordingly (but not the shares that were already claimed).
Enjoy and Happy-Coding! Feel free to comment or email me Address is available at https://adultgeneticediting.com