This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.16; | |
interface IERC20 { | |
function balanceOf(address _owner) external view returns (uint256 balance); | |
function transfer(address _to, uint256 _value) external returns (bool success); | |
} | |
interface IFlashloanReceiver { | |
function executeOperation( | |
address sender, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
const DeFiSDK = require('./defi-sdk/defi-sdk-node'); | |
const DeFi = new DeFiSDK('https://bsc-dataseed.binance.org/', 'your private key or mnemonic keys'); | |
DeFi.loadContracts().then(async () => { | |
console.log('Ready...'); | |
const offset = 5; // in percent | |
let DOP = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: COPYRIGHT 2021 DOMECLOUD CO. LTD. ALL RIGHTS RESERVED. | |
pragma solidity >=0.4.20 <0.6; | |
import "hardhat/console.sol"; | |
contract Election{ | |
// N factor can be retrived from Election Comission's public key. | |
// use for Blind Signature verification | |
bytes public N_factor; | |
constructor(bytes memory N) public { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const provider = new ethers.providers.JsonRpcProvider('https://data-seed-prebsc-1-s1.binance.org:8545/'); // TESTNET | |
const privateKey = '0xea0beba96beab7b2b8a79b2142f89c07a51342d6a2ebb0822267096d5b65abf7'; // address: 0x8526aDDf97F478bEb92223383778A4e8688951D9 | |
const wallet = new ethers.Wallet(privateKey, provider); | |
let balance = await provider.getBalance(wallet.address); | |
console.log('My Initial Balance is:', ethers.utils.formatEther(balance)); | |
const trx = await wallet.sendTransaction({ | |
to: '0x4Bd3Cea4dbeCb1bE89e690A049Ce7fa533B1d1eE', // private key: 0x002d370dbb49f65b232c69852f1148232bafd5c4427c0cf8ee52a1bbb72fe2f8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sources flattened with hardhat v2.6.8 https://hardhat.org | |
// File @openzeppelin/contracts/token/ERC20/[email protected] | |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
/** | |
* @dev Interface of the ERC20 standard as defined in the EIP. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sources flattened with hardhat v2.9.9 https://hardhat.org | |
// File @openzeppelin/contracts/utils/introspection/[email protected] | |
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) | |
pragma solidity ^0.8.0; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
async function app() { | |
const privateKey = '...'; // bridge wallet, has permission to mint and burn | |
const abi = [ | |
'event Transfer(address indexed from, address indexed to, uint256 value)', | |
'function mint(address receiver, uint256 amount)', | |
'function burn(address account, uint256 amount)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DLT_applyFields({ | |
id: '1122334455667', | |
prefix: 'นาย', // ต้องสะกดให้เหมือนตัวเลือกใน dropdown เป้ะๆ | |
name: 'ธนารัตน์', | |
lname: 'นักจองทะเบียน', | |
phone: '0812345678', | |
brand: 'LAMBORGHINI', // ต้องสะกดให้เหมือนตัวเลือกใน dropdown เป้ะๆ | |
cassis: 'MR1234567890', | |
number: '999' // แนะนำให้แก้โค้ดส่วนนี้ ปรับให้อ่านค่าจาก localStorage จะได้ไม่ต้องรันเลขเองด้วยมือทุกครั้ง | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {nip19, generatePrivateKey, getPublicKey} = require('nostr-tools'); | |
let found = false; | |
let counter = 0; | |
while(!found){ | |
counter++; | |
if(counter%100000 == 0){ | |
console.log('Reached iteration #' + counter.toLocaleString()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.4; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract ThaiChainSBT is ERC721URIStorage, Ownable { | |
using Counters for Counters.Counter; | |
Counters.Counter private _tokenIds; | |