Skip to content

Instantly share code, notes, and snippets.

View mingderwang's full-sized avatar

Ming-der Wang mingderwang

View GitHub Profile

Hi, 你好

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
contract Fundraiser is Ownable {
using SafeMath for uint256;
}
@shobhitic
shobhitic / MyToken.sol
Last active March 20, 2024 19:24
ERC20 Permit OpenZeppelin Tutorial - https://www.youtube.com/watch?v=lFKcga4Y6Ys
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.7.3/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.7.3/token/ERC20/extensions/draft-ERC20Permit.sol";
contract MyToken is ERC20, ERC20Permit {
constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {}
function mint(address to, uint256 value) external {
@cereum
cereum / AAPL.sol
Created August 24, 2020 14:46
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Ropsten ETH faucet: https://faucet.ropsten.be/
* - Ropsten LINK faucet: https://ropsten.chain.link/
*/
pragma solidity ^0.6.0;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/ChainlinkClient.sol";
@mingderwang
mingderwang / demo.json
Last active August 25, 2020 04:39
demo.json for Python Taiwan 讀書會
[
{
"id": 1,
"name": "王銘德",
"amount": 345.33,
"Remark": "Pays on time"
},
{
"id": 2,
"name": "Sam \"Mad Dog\" Smith",
@mingderwang
mingderwang / 空污資料.json
Last active August 16, 2020 03:23
資料資源欄位: SiteName(測站名稱)、County(縣市)、AQI(空氣品質指標)、Pollutant(空氣污染指標物)、Status(狀態)、SO2(二氧化硫(ppb))、CO(一氧化碳(ppm))、CO_8hr(一氧化碳8小時移動平均(ppm))、O3(臭氧(ppb))、O3_8hr(臭氧8小時移動平均(ppb))、PM10(懸浮微粒(μg/m3))、PM2.5(細懸浮微粒(μg/m3))、NO2(二氧化氮(ppb))、NOx(氮氧化物(ppb))、NO(一氧化氮(ppb))、WindSpeed(風速(m/sec))、WindDirec(風向(degrees))、PublishTime(資料建置日期)、PM2.5_AVG(細懸浮微粒移動平均值(μg/m3))、PM10_AV…
{"include_total": true, "resource_id": "8ff027dc-2da2-42e8-85de-78ac3faf470e", "fields": [{"info": {"notes": "", "label": "\u6e2c\u7ad9\u540d\u7a31"}, "type": "text", "id": "SiteName"}, {"info": {"notes": "", "label": "\u7e23\u5e02"}, "type": "text", "id": "County"}, {"info": {"notes": "", "label": "\u7a7a\u6c23\u54c1\u8cea\u6307\u6a19"}, "type": "text", "id": "AQI"}, {"info": {"notes": "", "label": "\u7a7a\u6c23\u6c61\u67d3\u6307\u6a19\u7269"}, "type": "text", "id": "Pollutant"}, {"info": {"notes": "", "label": "\u72c0\u614b"}, "type": "text", "id": "Status"}, {"info": {"notes": "", "label": "\u4e8c\u6c27\u5316\u786b(ppb)"}, "type": "text", "id": "SO2"}, {"info": {"notes": "", "label": "\u4e00\u6c27\u5316\u78b3(ppm)"}, "type": "text", "id": "CO"}, {"info": {"notes": "", "label": "\u4e00\u6c27\u5316\u78b38\u5c0f\u6642\u79fb\u52d5\u5e73\u5747(ppm)"}, "type": "text", "id": "CO_8hr"}, {"info": {"notes": "", "label": "\u81ed\u6c27(ppb)"}, "type": "text", "id": "O3"}, {"info": {"notes": "", "label": "\u81ed\u6c278
@mingderwang
mingderwang / ansible_playbook.yml
Created November 8, 2019 08:27 — forked from nikhiljha/ansible_playbook.yml
GlusterFS Ansible Setup
---
- hosts: gluster
become: true
vars:
gluster_mount_dir: /mnt/g1
gluster_brick_dir: /bricks/brick1
gluster_brick_name: g1
tasks:
- name: Install parted
@Bradleykingz
Bradleykingz / animals.txt
Last active September 9, 2023 18:41 — forked from atduskgreg/animals.txt
Alphabetized, removed all occurrences of 'list'
Aardvark
Aardwolf
African Buffalo
African Elephant
African Leopard
Albatross
Alligator
Alpaca
Alpaca
American Buffalo (bison)
@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic