Skip to content

Instantly share code, notes, and snippets.

@nasdf
nasdf / NFTLicense.cs
Last active March 4, 2022 19:22
Unity3D NFT License
using Nethereum.Signer;
using System;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using UnityEngine;
public class NFTLicense : MonoBehaviour
{
[DllImport("__Internal")]
@nasdf
nasdf / versioned.sol
Created August 14, 2021 21:48
Versioned NFT
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract Versioned is ERC721URIStorage {
using Counters for Counters.Counter;
using Strings for uint256;
@nasdf
nasdf / Blockies.swift
Created June 14, 2020 18:33
Ethereum Blockies in SwiftUI
struct Blockies: View {
private var color: Color!
private var bgColor: Color!
private var spotColor: Color!
private var seed: [Int32] = Array(repeating: 0, count: 4)
private var pixels: [UInt8] = Array(repeating: 0, count: 100)
var body: some View {
VStack(alignment: .center, spacing: 0) {
@nasdf
nasdf / JSONRPC.swift
Created June 9, 2020 17:22
Swift JSON-RPC 2.0
import Foundation
class RPCMessage: Codable {
var container: KeyedDecodingContainer<CodingKeys>
var timestamp = NSDate.now.timeIntervalSince1970
var jsonrpc = "2.0"
var method: String?
var id: Int?