Coding Workshop : how to create your own crypto currency and NFT
Learn to create your own cryptocurrency coin or token with a mix of blockchain development, and smart contracts and a webpage.
Metpass NFT holder is highly prioritized
Agenda:
? 1. Related terms & structure introduction
? 2. Development software tools and development environment
? 3. Create crypto currency
? 4. Create user interface
? 5. transfer crypto currency
? 6. check the balance of crypto currency
? 7. Introduce mainstream currencies ¨C ERC20
1 of 33
More Related Content
20221110 MetaCoin
2. Kenneth Hu
? I am a software developer , not trader.
? I am enthusiast, not expert.
? Ethereum, Bitcoin
? Email: Kenneth.hu@Hotmail.com
? Linkedin https://www.linkedin.com/in/hukenneth/
? Blockchain&Dapps meetup
? DeFi - Decentralized Finance, SG
3. Agenda
? 1. Introduction
? 2. Development software tools and environment
? 3. Create crypto currency
? 4. Create the user interface
? 5. Connect to wallet
? 6. Send crypto currency
? 7. Confirm receipt of virtual currency
? 8. ERC20
8. installation
1. Install Truffle globally.
> npm install ¨Cg truffle
2. Initial truffle project
> truffle init
3. Run the Ganache.
1. setup port -8545
9. Truffle project folder
? contracts/: Directory for Solidity contracts
? migrations/: Directory for scriptable deployment files
? test/: Directory for test files for testing your application and
contracts
? Truffle-config.js: Truffle configuration file
11. Deployment & Test
4. Compile and migrate the smart contracts.
> truffle compile
> truffle migrate
5. To run all test , simply run
> truffle test
12. Deploy smart contract
Ethereum Blockchain
Ethereu
Node
Interact by transaction
Deploy smart contract
Solidity compiler: solc
Contracts bytecode
and ABI
Development
Source code: *.sol
13. installation
6. Run the lite server for front-end hot
reloading (outside the development
console). Smart contract changes must be
manually recompiled and migrated.
> npm run dev
28. ERC20
? ERC ¨C Ethereum Request for Comment
? the most widespread token standard for fungible assets, albeit
somewhat limited by its simplicity.
? ERC20 has 3 info, 6 functions and 2 events¡£
? https://theethereum.wiki/w/index.php/ERC20_Token_Standard
29. ERC20 - information
? Name: the name of the token.
? Symbol: the symbol of the token. https://etherscan.io/
? Decimals: the number of decimals the token uses ¨C
? e.g. 8, means to divide the token amount by 100000000 to get its
user representation.
30. ERC20 - Functions
? totalSupply(): the total token supply.
? balanceOf(address _owner): the account balance of another
account with address _owner
? Transfer(address _to, uint256 _value):Transfers _value amount of
tokens to address _to, and MUST fire the Transfer event.
? transferFrom(address _from, address _to, uint256 _value):
_value amount of tokens from address _from to address _to, and
MUST fire the Transfer event.
31. ERC20 - Functions
? Approve (address _spender, uint256 _value): Allows _spender to
withdraw from your account multiple times, up to
the _value amount.
? Allowance(address _owner, address _spender): the amount
which _spender is still allowed to withdraw from _owner.
32. ERC20 - Event
? Transfer(address indexed _from, address indexed _to, uint256 _value):
MUST trigger when tokens are transferred, including zero value
transfers.
? Approval(address indexed _owner, addressindexed _spender, uint256
_value): MUST trigger on any successful call to approve.