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
const xor = function (a, b) { | |
if (!Buffer.isBuffer(a)) a = new Buffer.from(a); | |
if (!Buffer.isBuffer(b)) b = new Buffer.from(b); | |
let res = [] | |
const len = (a.length > b.length) | |
? b.length | |
: a.length; | |
for (let i = 0; i < len; i++) { | |
res.push(a[i] ^ b[i]); | |
} |
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
// Collatz Conjecture | |
fn even_or_odd(num: &u32) -> u32 { num % 2 } | |
fn even(num: u32) -> u32 { num / 2 } | |
fn odd(num: u32) -> u32 { 3 * num + 1 } | |
fn collatz(mut num: u32) { | |
while num != 1 { | |
// println!("Processing: {}", num); | |
let n_type = even_or_odd(&num); |
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
// You can check if domain name already exists by querying the | |
// `ResolveRecord` entry point of the Registry contract; however, | |
// it should be noted this query will return an error for domain | |
// names that are available, and a DNS record for domains that do | |
use cosmwasm_std::{to_binary, QueryRequest, WasmQuery,}; | |
use crate::archid_registry; | |
let registry_contract = "Registry contract address goes here"; | |
let desired_domain_name = "archid.arch"; |
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
const CwStargate = require("@cosmjs/cosmwasm-stargate"); | |
const RPC = process.env.RPC; | |
const CONTRACT = process.env.CONTRACT; | |
async function cwClient() { | |
const cwClient = await CwStargate.SigningCosmWasmClient.connectWithSigner(RPC, null); | |
return cwClient; | |
} |
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
const CwStargate = require("@cosmjs/cosmwasm-stargate"); | |
async function getClient() { | |
const cwClient = await CwStargate.SigningCosmWasmClient.connectWithSigner("https://rpc.constantine-1.archway.tech",null); | |
return cwClient; | |
} | |
async function main() { | |
let client = await getClient(); | |
let queryHandler = client.queryClient.wasm.queryContractSmart; |
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
#!/usr/bin/python3 | |
import base64 | |
import sys | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
class AESCipher(object): | |
def __init__(self, key): | |
self.bs = AES.block_size |
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
{ | |
"name": "ipfs-gateway-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "fa2.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "node tzipIpfsProvider.js" | |
}, | |
"keywords": [ |
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
const TezosToolkit = require('@taquito/taquito') | |
const compose = require('@taquito/taquito'); | |
const tzip12 = require('@taquito/tzip12'); | |
const Tzip12Module = require('@taquito/tzip12'); | |
const tzip16 = require('@taquito/tzip16'); | |
const Tzip16Module = require('@taquito/tzip16'); | |
const importKey = require('@taquito/signer').importKey; | |
const Tezos = new TezosToolkit.TezosToolkit("https://mainnet-tezos.giganode.io"); |
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
const TezosToolkit = require('@taquito/taquito') | |
const compose = require('@taquito/taquito'); | |
const tzip12 = require('@taquito/tzip12'); | |
const Tzip12Module = require('@taquito/tzip12'); | |
const tzip16 = require('@taquito/tzip16'); | |
const Tzip16Module = require('@taquito/tzip16'); | |
const Tezos = new TezosToolkit.TezosToolkit("https://mainnet-tezos.giganode.io"); | |
Tezos.addExtension(new Tzip12Module.Tzip12Module()); |
NewerOlder