Skip to content

Instantly share code, notes, and snippets.

View thexeromin's full-sized avatar
🎯
Focusing

Abhijit Paul thexeromin

🎯
Focusing
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
function mul(int256 a, int256 b) internal pure returns (int256) {
int256 c = a * b;
@thexeromin
thexeromin / learn.md
Created October 13, 2022 06:29 — forked from rylev/learn.md
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
import './ERC20.sol';
import './Ownable.sol';
import './libraries/SafeMath.sol';
import './interfaces/IDEXFactory.sol';
import './interfaces/IDEXRouter.sol';
import './interfaces/InterfaceLP.sol';
import React, { useEffect, useState } from 'react'
import { useQuery, gql } from '@apollo/client'
const QUERY = gql`
query Tokens($where: Token_filter) {
tokens(where: $where) {
name
symbol
id
totalLiquidity
specVersion: 0.0.2
description: Uniswap is a decentralized protocol for automated token exchange on Ethereum.
repository: https://github.com/Uniswap/uniswap-v2-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Factory
network: mainnet
source:
@thexeromin
thexeromin / settings.py
Created August 9, 2022 08:52
django_project
"""
Django settings for sso_server project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/