|_ contracts
|__ Fancy.sol
|__ Migrations.sol
|_ migrations
|__ 1_initial_migrations.js
|__ 2_deploy_contracts.js
|_ src
|__ index.js
|_ truffle-config.js
contracts/
: Directory for Solidity source files of the smart contract
|_ Fancy.sol
: a smart contract (written in Solidity) that creates a Fancy token
|_ Migrations.sol
: a seperate Solidity file that manages and updates the status of the deployed smart contract
migrations/
: Directory for scriptable deployment files(written in JavaScript)
|_ 1_initial_migrations.js
: Migration (deployment) script for the Migrations
contract found in the Migrations.sol
file
|_ 2_deploy_contracts.js
: Migration script for the Fancy
contract. (This will be executed after file is runned
contracts/
: Directory for javascript source files of function using caver-js
truffle-config.js
: Truffle configuration file for setting network information and other project-related settings
-> Fancy/ERC20/IERC20.sol
-> Emitted when value
tokens are moved from one account (from
) to another (to
).
-> Constructor defines a new ERC20 token's name and symbol, and to mint a predefined amount of token.
->The name
of the token contract is the long name by which the token contract should be known
->The symbol
of the token contract is the symbol by which the token contract should be known
-> Function which returns the amount of tokens in existence
function which shows the balance of the account
function which transfer certain amount of token(_price) from musician to fan if balance of musician should be bigger than the _price.
then emit Transfer
event
function which transfer certain amount of token(_price) from musician to fan if balance of musician should be bigger than the _price.
then emit Transfer
event
-> Function that create a new ERC20 tokens. This is invoked only once from constructor when deploying the smart contract to mint a predefined amount of token
-> If additional token is required after deploying the smart contract, a new public method such as mint should be introduced.
-> CAUTION : only authorized users should be able to mint tokens
-> reference : https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Mintable.sol
- ERC20ABI : 배포된 Smart Contract ERC20ABI
- contractAddress -> 배포된 Smart Contract Address
- defaultAddress -> 배포된 Smart Contract Address default acount의 address
- defaultPrivateKey -> 배포된 Smart Contract Address default acount의 privatekey
- userAddress -> 로그인 되어있는 해당 유저의 address
-> Total Supply 조회
-> 앨범 등록 후 토큰 사용자의 계정에 토큰 지급
-> 물건 구매 후 계정의 토큰 차감
-> 사용자 계정의 잔고 조회