https://github.com/archlinuxstudio/als_ico
https://github.com/archlinuxstudio/als_ico
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/archlinuxstudio/als_ico
- Owner: ArchLinuxStudio
- License: gpl-3.0
- Created: 2022-04-19T11:40:32.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-03T13:07:31.000Z (over 3 years ago)
- Last Synced: 2025-02-24T10:18:46.686Z (11 months ago)
- Language: TypeScript
- Homepage: https://archlinuxstudio.github.io/ALS_ICO/
- Size: 2.65 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ALS_ICO
This project teaches how to issue ERC-20 tokens based on the Ethereum Virtual Machine.
If you have Ethereum in the rinkeby testnet, you can participate in the test.
This project borrows a lot from this youtube video: [Code Your Own Cryptocurrency on Ethereum (Full)
](https://www.youtube.com/watch?v=XdKv5uwEk5A&list=PLS5SEs8ZftgWFuKg2wbm_0GLV0Tiy1R-n).
## Deploy to rinkeby test network
1. Run geth node
```bash
geth --rinkeby --http --http.api personal,eth,net,web3 --allow-insecure-unlock
```
This can take dozens of hours, depending on your machine configuration and internet speed.
This will cost you close to 100GB or so of hard drive space.
2. Create a new account
```bash
geth --rinkeby account new
```
3. Attach into geth console
```bash
geth --rinkeby attach
```
And you can do many things in geth console
```bash
eth.syncing #check the syncing status
eth.accounts #check all accounts
eth.getBalance(eth.accounts[0]) #check account balance
personal.unlockAccount(eth.accounts[0],null,1200) #unlock a certain accont for 20 minutes
```
4. Acquire eth from https://www.rinkeby.io/#faucet
Here they require that you have to post a twitter or facebook, which is disgusting.
rinkeby.io may be unstable, you can use the following alt sites to get ether.
- https://faucets.chain.link/rinkeby
- https://rinkebyfaucet.com/
- https://app.mycrypto.com/faucet
- https://faucet.paradigm.xyz/
5. Migrate
```bash
truffle migrate --reset --compile-all --network rinkeby
```
6. Verify deployment and transfer tokens to sale contract
```bash
geth --rinkeby attach
```
```bash
var admin = eth.accounts[0]
var tokensAvailable = 20000000
var tokenSaleAddress = "Your_Sale_Contract_Address" # check the address in build/contracts/ALSTokenSale.json
var abi = [Your_Token_Contract_ABI_Array] #copy the abi ARRAY in build/contracts/Election.json, turn it into one line style. in oss code, select all data, and press F1, search join line.
var tokenAddress = "Your_Contract_Address" # check the address in build/contracts/ALSTokenSale.json
var TokenContract = web3.eth.contract(abi) # describe the contract - ABI to web3
var tokenInstance = TokenContract.at(tokenAddress) # tell web3 the contract address
tokenInstance.name() # check the name
tokenInstance.address # check the address
tokenInstance.transfer(tokenSaleAddress, tokensAvailable, {from: admin})
tokenInstance.balanceOf(tokenSaleAddress) # check the sale contract balance
```
7. import rinkeby account to metamask
keystore dir: `~/.ethereum/rinkeby/keystore`
keystore is the restore file, keep it carefully.
import your rinkeby account key file into metamask, use password for the account at the same time.
this may take several minutes, be patient.