编辑 /etc/docker/daemon.json
去除docker默认30个桥接限制, 修改完后, 需要重启docker
{
"default-address-pools": [
{
"base": "172.80.0.0/16",
"size": 24
#define uint32_t uint | |
#define uint64_t ulong | |
#define uint8_t uchar | |
#define NULL 0 | |
static void memset(uchar *str, int c, size_t n){ | |
for(int i=0;i<n;i++){ | |
str[i] = c; | |
} | |
} |
基础环境安装
sudo apt update -y &&sudo apt upgrade -y
sudo apt install curl tar wget lz4 jq build-essential git make -y
go 安装
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "./Logarithm.sol"; | |
import "./TransferHelper.sol"; | |
// This is common token interface, get balance of owner's token by ERC20/ERC721/ERC1155. | |
interface ICommonToken { | |
function balanceOf(address owner) external returns(uint256); |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "./Logarithm.sol"; | |
import "./TransferHelper.sol"; | |
// This is common token interface, get balance of owner's token by ERC20/ERC721/ERC1155. | |
interface ICommonToken { | |
function balanceOf(address owner) external returns(uint256); |
let pancakeSwapAbi = [ | |
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"}, | |
]; | |
let tokenAbi = [ | |
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}, | |
]; | |
const Web3 = require('web3'); | |
/* | |
Required Node.js |
try {
await ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: '0xf00' }],
});
} catch (switchError) {
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "hardhat test", | |
"skipFiles": ["<node_internals>/**"], | |
"runtimeExecutable": "${workspaceFolder}/packages/hardhat/node_modules/.bin/hardhat", | |
"args": ["test", "--network", "localhost"], |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello World DApp</title> | |
<link href='https://fonts.googleapis.com/css?family=Open Sans:400,700' rel='stylesheet' type='text/css'> | |
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' type='text/css'> | |
</head> | |
<body class="container"> | |
<h1>A Simple Hello World Voting Application</h1> | |
<div class="table-responsive"> |
// SPDX-License-Identifier: MIT | |
// | |
// $BabyCake proposes an innovative feature in its contract. | |
// | |
// DIVIDEND YIELD PAID IN CAKE! With the auto-claim feature, | |
// simply hold$BabyCake and you'll receive CAKE automatically in your wallet. | |
// | |
// Hold Baby Cake and get rewarded in Cake on every transaction! | |
// |