Skip to content

Instantly share code, notes, and snippets.

View abhi3700's full-sized avatar
👁️‍🗨️
Solidity Developer, Subspace Labs

Abhijit Roy abhi3700

👁️‍🗨️
Solidity Developer, Subspace Labs
View GitHub Profile
@abhi3700
abhi3700 / Cargo.toml
Created December 31, 2023 22:24
Build State Machine using Rust | Part 1 | Balances Module
[package]
name = "rsm-tuts"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
mod order_book {
#[derive(Debug, PartialEq)]
pub struct LimitOrder {
limit_price: u64,
amount: u64,
}
#[derive(Debug, PartialEq)]
pub struct OrderBook {
@abhi3700
abhi3700 / test.js
Created July 13, 2022 14:05
Conversion of inline-assembly to JS
const keccak256 = require("keccak256");
// `encryptDecrypt` function
function encryptDecrypt(data, key) {
let length = data.length;
// let result.length = length;
for (let i = 0; i < length; i += 32) {
const hash = keccak256(key.concat(i.toString())).toString("hex");
let chunk;
@abhi3700
abhi3700 / tests.yml
Created June 28, 2022 06:26
"Github Action" - file
name: Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
env:
COIN_MARKET_CAP_API: ${{ secrets.COIN_MARKET_CAP_API }}
KOVAN: "witch collapse practice feed shame open despair creek road again ice least"
@abhi3700
abhi3700 / lima.yaml
Created May 17, 2022 18:29
Config file for "Lima VM" with ARM arch on Mac M1
# ===================================================================== #
# BASIC CONFIGURATION
# ===================================================================== #
# Default values in this YAML file are specified by `null` instead of Lima's "builtin default" values,
# so they can be overridden by the $LIMA_HOME/_config/default.yaml mechanism documented at the end of this file.
# Arch: "default", "x86_64", "aarch64".
# 🟢 Builtin default: "default" (corresponds to the host architecture)
arch: null
@abhi3700
abhi3700 / Incrementer.sol
Created December 28, 2021 15:13
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Incrementer {
uint256 private _value;
address private _lastCaller;
function inc() external {
_value += 1;
_lastCaller = msg.sender;
@abhi3700
abhi3700 / VRFConsumerBaseUpgradeable.sol
Last active January 5, 2023 00:23
Chainlink VRF for Upgradeable Smart contracts in random NFT token generation
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/LinkTokenInterface.sol";
import "./VRFRequestIDBase.sol";
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
/** ****************************************************************************
@abhi3700
abhi3700 / my_pandas_snippets.md
Created June 16, 2019 11:32
Useful Pandas Snippets

Pandas Snippets

  • remove duplicates

df['party_name'].drop_duplicates()