Skip to content

Instantly share code, notes, and snippets.

View jdkanani's full-sized avatar
🎯
Focusing

Jaynti Kanani jdkanani

🎯
Focusing
View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@jdkanani
jdkanani / CrossTransfer.sol
Last active November 30, 2021 06:23
Cross PoS Portal ERC20 token transfer from Polygon PoS chain to Ethereum chain through contract
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
interface IERC20 {
function withdraw(uint256 amount) external payable;
function transfer(address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
}
interface IRootChainManager {
@jdkanani
jdkanani / 1_Storage.sol
Created February 12, 2021 09:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.9+commit.c68bc34e.js&optimize=false&runs=200&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
pragma solidity 0.5.9;
contract DepositTest {
event Deposit(
address rootToken,
address user,
uint256 amountOrTokenId,
uint256 depositCount
);
#!/bin/bash
set -e
VERSION="1.15.5"
[ -z "$GOROOT" ] && GOROOT="$HOME/.go"
[ -z "$GOPATH" ] && GOPATH="$HOME/go"
OS="$(uname -s)"
ARCH="$(uname -m)"
name: Docker Image CI
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
name: Docker Image CI
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
package main
import (
"encoding/hex"
"fmt"
"github.com/maticnetwork/heimdall/bor"
"github.com/maticnetwork/heimdall/helper"
)
@jdkanani
jdkanani / ChildERC20.sol
Last active March 19, 2019 17:06
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.4+commit.9549d8ff.js&optimize=true&gist=
// pragma solidity >=0.4.22 <0.6.0;
pragma solidity >=0.5.2 <0.6.0;
import { ERC20 } from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import { ERC20Detailed } from "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
import { LibTokenTransferOrder } from "./libs/TokenTransferOrder.sol";
import { ECRecover } from "./libs/ECRecover.sol";
contract ChildERC20 is ERC20, ERC20Detailed, LibTokenTransferOrder, ECRecover {
@jdkanani
jdkanani / fire-model.js
Last active January 10, 2019 10:06
Mobx firebase binding
import { extendObservable } from "mobx"
import { firebaseActions } from "../plugins/mobfire"
export default class FireModel {
// constructor
constructor(data = {}) {
// treat data as properties
const v = {}
Object.keys(data).forEach(key => {
if (key !== ".value" && key !== ".key" && key !== "_id") {