Skip to content

Instantly share code, notes, and snippets.

View yangga's full-sized avatar
🏠
Working at home

Sungwoo Yang yangga

🏠
Working at home
  • Republic of Korea
View GitHub Profile
const ToToToken = artifacts.require("ToToToken");
module.exports = function(deployer, network, accounts) {
deployer.deploy(ToToToken)
};
pragma solidity 0.5.2;
import "./CustomToken.sol";
contract ToToToken is CustomToken {
uint8 private DECIMALS = 5; //자리수
uint256 private MAX_TOKEN_COUNT = 20000000000; // 총 토큰 개수
uint256 private MAX_SUPPLY = MAX_TOKEN_COUNT * (10 ** uint256(DECIMALS)); //총 발행량
uint256 private INITIAL_SUPPLY = MAX_SUPPLY * 1 / 10; //초기 공급량
truffle(develop)> let instance = await ToToToken.deployed()
truffle(develop)> instance.totalSupply()
<BN: 71afd498cfff6>
truffle(develop)> let accounts = await web3.eth.getAccounts()
truffle(develop)> instance.balanceOf(accounts[0])
<BN: 71afd498cfff6>
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
}
}
const HDWalletProvider = require('truffle-hdwallet-provider');
const infuraKey = [PROJECT ID];
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
$ npm init -y
$ npm install --save-exact openzeppelin-solidity@2.2.0
$ npm install --save-exact truffle-hdwallet-provider@1.0.6
$ npm install -g truffle
$ npm install -g ganache-cli
$ mkdir myproject && cd myproject
$ truffle init
global
maxconn 4096
defaults
mode http
balance roundrobin
option redispatch
option forwardfor
timeout connect 5s
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello Socket!');
});
var server = require('http').createServer(app).listen(3000, function() {
console.log(`Listening on port 3000 with http`);
});
@yangga
yangga / gist:2883c6483511838b1b2172495571eb1e
Created February 18, 2019 12:07
clone sample-hello-node project
git clone https://github.com/yangga/sample-hello-node