• Bundle id, app name can be changed easily by search and replace
  • The app…


First, create a mintable token

// SPDX-License-Identifier: MIT
// @nhancv
pragma solidity 0.8.4;

interface IMintable {
function mint(address account, uint256 amount) external;
}
// SPDX-License-Identifier: MIT
// @nhancv
pragma solidity 0.8.4;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "./ERC20Token.sol";
import "./interfaces/IMintable.sol";

contract ERC20Mintable is ERC20Token, IMintable, AccessControlUpgradeable {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

/**
* @dev Upgradable initializer…

type(ITest).interfaceId
  • Return zero with empty interface
=> bytes4: 0x00000000// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ITest {
}
contract Test is ITest {…

  • Clean: No unused code, nonsense comment,
  • Well document: Comment to all functions
  • Formatted: Reformat, reformat, reformat
  • Unit test all functions
  • Migration for testnet and mainnet
  • Avoid duplication code, avoid using too many unnecessary modifiers…

What is “Dividend Token”?


Preparing source

  • Clone pancake-swap-core
git clone git@github.com:pancakeswap/pancake-swap-core.git
cd pancake-swap-core
git checkout -b factory 3b214306770e86bc3a64e67c2b5bdb566b4e94a7
yarn install
yarn compile
  • Clone pancake-swap-periphery
git clone git@github.com:pancakeswap/pancake-swap-periphery.git
cd pancake-swap-periphery
git checkout -b router d769a6d136b74fde82502ec2f9334acc1afc0732
yarn install
yarn add @uniswap/v2-core@"file:../pancake-swap-core"
yarn compile


Config Server

nano /etc/zabbix/zabbix_server.conf===>Update DB information
  • Config frontend web
nano /etc/zabbix/web/zabbix.conf.php
===>
# Update DB information, must be matched with server config above
....
# Integrate with server
ZBX_SERVER = '**your zabbix ip address or name**';
ZBX_SERVER_PORT = '10051';
ZBX_SERVER_NAME = '**your zabbix hostname**';
Example
$ZBX_SERVER…

  • A contract has an infinite internal storage
  • There are 2 limits to practicality: gas costs and the block gas limit.

Example

  • [WRITE] Can add 500 player in 1 tx
  • [READ] Can…

Setup MongoDB


* Check linux version: lsb_release -a
sudo apt install wget
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

* https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/
* Debian 10 "Buster"
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

* https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
* Ubuntu 20.04 (Focal)
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt update
sudo apt install -y build-essential
sudo…

Make sure your application is stateless: share database/cache, cronjob
// https://pm2.keymetrics.io/docs/usage/application-declaration/
// # Start all applications
// pm2 start ecosystem.config.js
//
// # Stop all
// pm2 stop ecosystem.config.js
//
// # Restart all
// pm2 restart ecosystem.config.js
//
// # Reload all
// pm2 reload ecosystem.config.js
//
// # Delete all
// pm2 delete ecosystem.config.js
module.exports = {
apps…

Nhan Cao

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store