Skip to content

Instantly share code, notes, and snippets.

View 0xAnon101's full-sized avatar
๐ŸŽ“
Rain , coffee , code

0xAnon 0xAnon101

๐ŸŽ“
Rain , coffee , code
  • EVM
View GitHub Profile
@0xAnon101
0xAnon101 / .js
Created September 27, 2018 13:18
import React from "react";
import classes from './App.scss';
const App = () => {
return <div className={classes.app}>Hello React!</div>;
};
export default App;
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
โœ… did:3:bafyreigvarwlqf4ascor2rolrm2tmtenf6x6jtrgiksmlfjkbo6ctvqweu โœ…
Create your profile today to start building social connection and trust online at https://3Box.io/
@0xAnon101
0xAnon101 / Owner.sol
Last active January 31, 2021 15:06
Owner contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
contract Address {
event OwnerChanged( address indexed oldOwner, address indexed newOwner, uint256 value);
event Received(address indexed sender, uint value);
@0xAnon101
0xAnon101 / Address.sol
Last active January 26, 2021 11:03
Address coercion
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.7.0;
contract Address {
// address addressA = 0x111122223333444455556666777788889999AAAABBBBCCCCDDDDEEEEFFFFCCCC; notimplicity convertible
address addressA;
function compressAddressSize() external pure returns(address ) {
@0xAnon101
0xAnon101 / currency.sol
Created February 1, 2021 11:09
send/mint/transfer currency
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.9.0;
import "github/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol";
contract Scoin {
using SafeMath for uint256;
address public minter;
mapping (address => uint256) public balances;
@0xAnon101
0xAnon101 / Migrations.js
Last active May 17, 2021 07:05
Deployer modifications
const Registration = artifacts.require("Registration");
const fs = require('fs');
const path = '/../src/metaData.js'; // need to create src folder first
module.exports = async function (deployer) {
await deployer.deploy(Registration);
const instance = await Registration.deployed();
fs.writeFile(
__dirname + path,
@0xAnon101
0xAnon101 / subgraph.yaml
Last active June 27, 2022 04:31
subgraph yaml file for BAYC
specVersion: 0.0.5
schema:
file: ./schema.graphql
features:
- fullTextSearch
- ipfsOnEthereumContracts
dataSources:
- kind: ethereum
name: baycToken
network: mainnet
@0xAnon101
0xAnon101 / schema.graphql
Created June 27, 2022 03:30
Schema graph
# fulltext query: searchable keywords
type _Schema_
@fulltext(
name: "apeFilter"
language: en
algorithm: rank
include: [
{
entity: "BoredApeToken"
fields: [{ name: "eyes" }, { name: "background" }]
@0xAnon101
0xAnon101 / bored-ape-yacht-club.ts
Created June 27, 2022 05:16
mapping of handleTransfer
import { log, ipfs, json, JSONValue } from "@graphprotocol/graph-ts";
import {
Transfer as TransferEvent,
baycToken as BaycTokenContract,
} from "../generated/baycToken/baycToken";
import { BoredApeToken, BoredApeUser } from "../generated/schema";
export function handleTransfer(event: TransferEvent): void {
/**
* load ipfs of bayc
@0xAnon101
0xAnon101 / merkleTrie.sol
Last active July 10, 2022 15:59
Merkle verification for random txn
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/// @title A simple contract named MerkleTrie
/// @author 0xAnon101
/// @notice Shows you the functioning of Merkle Trie. Not meant to be used in Production environment
/// due to high gas cost in this demo methodology. It is here just to understand the underlining
/// structure of Merkle Trie.
/// @dev Implementaion using custom string based array which includes sample transactions.
contract MerkleTrie {