Skip to content

Instantly share code, notes, and snippets.

View Vishwas1's full-sized avatar
🎯
Focusing

Vishwas Anand Bhushan Vishwas1

🎯
Focusing
View GitHub Profile
@Vishwas1
Vishwas1 / feeTokenContract.sol
Created November 20, 2024 13:00
Sample solidity contract with fee module - deducting %fee and sending it to pool (an address) on every token transfer
/**
*Submitted for verification at Etherscan.io on 2021-06-07
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
/**
* @title Ownable

How to integrate Cavach API in your App?

  • Last Edited: 23/01/2024
  • Edited By: Vishwas Anand (github@vishwas1)

Step 1: Register & Login

Navigate to developer dashboard and login.

import "./verifier.sol";
/**
*Submitted for verification at Etherscan.io on 2021-06-07
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
/*
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW
@Vishwas1
Vishwas1 / gist:fe765cc5d9da9cf1a92a7701d9a7136a
Created March 25, 2021 03:58 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
/*
// cert.pem
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
oYi+1hqp1fIekaxsyQIDAQAB
-----END PUBLIC KEY-----
// Ref: https://github.com/aeternity/aepp-sdk-js/blob/f2088c405ff6071f6b809c279231a3dff40e6ffb/es/utils/crypto.js
const nacl = require('tweetnacl')
const bs58check = require('bs58check')
const { blake2b } = require('blakejs')
const ed2curve = require('ed2curve')
const signer = require('nacl-signature')
nacl.util = require('tweetnacl-util')

Using android Keystore

Importing keystore

//TODO: import keystore in the project

Setting up postgres in stellar with UNIX socket

  • Setup UNIX socket in with stellar postgres db
  • sudo systemctl stop postgresql
  • Update the file sudo vi /etc/postgresql/9.5/main/pg_hba.conf with local core stellar md5
  • Update the db connection string in stellar-core.cfg with DATABASE="postgresql://dbname=core host=/var/run/postgresql user=stellar password=stellar"
  • sudo systemctl start postgresql
  • restart the stellar-core

Setting up stellar with sqllite

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>hanko-plugin-keycloak-parent</artifactId>
<groupId>io.hanko.plugins.keycloak</groupId>
<version>0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>HANKO Plugin Keycloak EJB</name>