Skip to content

Instantly share code, notes, and snippets.

View sahilrajput03's full-sized avatar
💭
Eating, Sleeping, Coding, Repeat.

Sahil Rajput sahilrajput03

💭
Eating, Sleeping, Coding, Repeat.
View GitHub Profile
// Source - https://claude.ai/share/e4b0686c-cabf-4408-a9e7-3cf04cf1f9ba
services
{
_id: ObjectId,
name: "CBT",
slug: "cbt",
description: "Cognitive Behavioral Therapy",
category: "Mental Health",
isActive: true,

Upgradable contracts - UUPS (better than Transparent Proxy)

Source: Official Openzeppelin youtube channel

All resources related to Upgradability from Openzeppelin: Click here

Depending on where we put the upgradeTo() function we decide b/w two types of upgradable smart contracts.

image

@sahilrajput03
sahilrajput03 / 721.sol
Created November 14, 2022 04:55
Cleaned
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import './IERC721.sol';
import './IERC721Receiver.sol';
import './extensions/IERC721Metadata.sol';
import '../../utils/Address.sol';
import '../../utils/Context.sol';
@sahilrajput03
sahilrajput03 / arrayBufferToString.js
Created November 13, 2022 14:40 — forked from skratchdot/arrayBufferToString.js
Array Buffer -> String and String -> ArrayBuffer conversions in javascript
// source: http://stackoverflow.com/a/11058858
function ab2str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}

Commentary on ERC1155 - Multi Token Standard

Source: ethereum.org

  • Implementation on Openzeppelin: Click here
  • Implementation with Video Tutorial: @youtube Click here

Smart contracts implementing the ERC-1155 standard MUST implement all of the functions in the ERC1155 interface.

Smart contracts implementing the ERC-1155 standard MUST implement the ERC-165 supportsInterface function and MUST return the constant value true if 0xd9b67a26 is passed through the interfaceID argument.

@sahilrajput03
sahilrajput03 / token_comparisons.md
Last active November 3, 2022 18:10
Token Comparisons