Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'm happy these days.

Sahil Rajput sahilrajput03

💭
I'm happy these days.
View GitHub Profile
View haq-se-single-magnet-link.txt
View my-personality.md
View a.js
// post hooks for inserMany
schema.post<MovieDocument[]>('insertMany', async function (docs, next) {
console.log('docs POST =', docs);
if (Array.isArray(docs) && docs.length) {
const correctData = docs.map((singleDoc) => {
console.log('singelDoc post before added =', JSON.stringify(singleDoc));
// If id AND name are present, then we can use them to generate the sort_name
if (singleDoc.id?.length > 0 && singleDoc.name) {
View a.json
{
"subscriber": {
"email_address": "barbuyer@gmail.com",
"payer_id": "VZXRX2AG4RY6G",
"name": {
"given_name": "BarBuyer",
"surname": "Jones"
},
"shipping_address": {
"name": {
View Learn Upgradable Smart Contracts.md

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
View 721.sol
// 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';