Skip to content

Instantly share code, notes, and snippets.

BCH Atomic Swaps, 1.5.2024

This document will serve as Flipstarter campagin delivery tracker

See the flipstarter page: https://atomic-flip.pat.mn

@mainnet-pat
mainnet-pat / cs-flip-gist.md
Created November 11, 2023 18:08
cs-flip-gist.md

Extended debugging tools for CashScript, 11.11.2023

This document will serve as Flipstarter campagin delivery tracker

See the flipstarter page: https://cs-flip.pat.mn

@mainnet-pat
mainnet-pat / wc2-flipstarter.md
Created June 4, 2023 06:14
wc2-flipstarter.md

WalletConnect v2 Flipstarter 06.2023

This document will serve as Flipstarter campagin delivery tracker

See the flipstarter page: https://fund-wc2.pat.mn

@mainnet-pat
mainnet-pat / bcmr.json
Created May 11, 2023 05:37
Example bcmr
{
"$schema": "https://cashtokens.org/bcmr-v2.schema.json",
"version": {
"major": 0,
"minor": 1,
"patch": 0
},
"latestRevision": "2023-04-24T10:47:49.164Z",
"registryIdentity": {
"name": "example bcmr for NFTs",

mainnet.cash Flipstarter 04.2023

This document will serve as Flipstarter campagin delivery tracker

See the flipstarter page: https://fund.pat.mn

@mainnet-pat
mainnet-pat / anyhedge.template.json
Created March 30, 2023 17:33
Anyhedge libauth template generated from mainnet-js contract package
{
"$schema": "https://ide.bitauth.com/authentication-template-v0.schema.json",
"description": "Imported from cashscriptpragma cashscript ^0.8.0;\n\n // AnyHedge contract allows Hedge and Long to enter into an agreement where Hedge reduces their exposure\n // to price volatility, measured in UNITS/BCH, and Long increases their exposure to the same volatility.\n // AnyHedge also has a safety feature where Hedge and Long can exit the contract at any time through mutual agreement.\n contract AnyHedge_v0_11(\n // Mutual redemption\n // Hedge and Long public keys. Required to verify the mutual redemption transaction signatures.\n pubkey hedgeMutualRedeemPublicKey, // 33 B\n pubkey longMutualRedeemPublicKey, // 33 B\n int enableMutualRedemption, // 1 B\n\n // Arbitrary output lock scripts for Hedge and Long.\n // AnyHedge can payout to p2pkh, p2sh or any valid output.\n // E.g. p2pkh: pus
@mainnet-pat
mainnet-pat / config
Created February 1, 2023 11:33
BitcoinVerde Flipstarter nginx config
```
server {
server_name fund.mainnet-pat.me;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 7d;

mainnet.cash Flipstarter 01.2023

This document will serve as Flipstarter campagin delivery tracker

See the flipstarter page: https://fund.mainnet-pat.me

Rules: all users currently owning a domain name will be rewarded with a DNS tokens.
Example: Alice owns 3 5+ char names, and 1 3 char name. Total reward is 103 DNS.
Name Length | DNS Reward
----------
5+ | 1
4 | 10
3 | 100
2 | 1000
const walletSeed = "your seed";
const routerContract = "0x367b37741BB22Da8f9992b7122DDd2931c098f72";
const lpAddress = "0x838063e7FB494bd631C46Cdb5b07936ee7F3cBd3"; // BLP flex-flexusd
const tokenA = "0x7b2b3c5308ab5b2a1d9a94d20d35ccdf61e05b72"; // flexusd
const tokenB = "0x98dd7ec28fb43b3c4c770ae532417015fa939dd3"; // flex
const wallet = await SmartBchWallet.fromSeed(walletSeed);
const balance: ethers.BigNumber = await wallet.sep20.contract(lpAddress).contract.balanceOf(wallet.getDepositAddress());
const allowance: ethers.BigNumber = await wallet.sep20.contract(lpAddress).contract.allowance(wallet.getDepositAddress(), routerContract);
console.log(balance.toString(), allowance.toString());