This file contains 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
import tableify from "https://esm.sh/tableify"; | |
import json2json from "https://gitee.com/zhangweis/deno-report-tools/raw/master/json2json.ts"; | |
json2json(tableify) |
This file contains 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
import Web3 from 'https://deno.land/x/web3/mod.ts' | |
const providerURL = Deno.args[0] | |
const web3 = new Web3(new (Web3 as any).providers.HttpProvider(providerURL)) | |
const balance = await (web3 as any).eth.getBalance("0x7a915e362353d72570dcf90aa5baa1c5b341c7aa") | |
console.log(`the balance is ${balance} wei`) | |
const transactionHash = "0x0d558d490c89fc94ddfebd284e39da5c1bcff15d18c4e9fd2eb37a202d20c703" |
This file contains 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
import "util.scrypt"; | |
contract Token { | |
public function transfer(bytes txPreimage, bytes fromRecord, bytes fromMerklePath, Sig senderSig, | |
bytes toRecord, bytes toMerklePath, bytes insertPoint, bytes insertPointMerklePath, | |
int amount, int utxoAmount) { | |
require(amount>0); | |
require(utxoAmount>=0); | |
// this ensures the preimage is for the current tx | |
require(Tx.checkPreimage(txPreimage)); |