This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.17; | |
/** | |
///////////////////////////////// | |
// // | |
// // | |
// // | |
// ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.7; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
library Base64 { | |
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate q1tsim; | |
use q1tsim::{circuit, gates}; | |
fn main() { | |
// The number of times this circuit is evaluated | |
let nr_runs = 8192; | |
// Create a quantum circuit with 3 quantum bits and 3 classical (measurement) | |
// bits. The circuit starts by default with all quantum bits in the |0⟩ state, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as anchor from "@project-serum/anchor"; | |
import { Program } from "@project-serum/anchor"; | |
import { Airdrop } from "../target/types/airdrop"; | |
const assert = require("assert"); | |
const anchor = require("@project-serum/anchor"); | |
const { SystemProgram } = anchor.web3; | |
import {Connection, PublicKey, LAMPORTS_PER_SOL} from "@solana/web3.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import logo from './logo.svg'; | |
import './App.css'; | |
import { useEffect, useState } from 'react'; | |
import { Connection, PublicKey } from '@solana/web3.js'; | |
import { Program, BN, AnchorProvider, web3 } from '@project-serum/anchor'; | |
import idl from './idl.json'; | |
import { PhantomWalletAdapter } from '@solana/wallet-adapter-wallets'; | |
import { useWallet, WalletProvider, ConnectionProvider } from '@solana/wallet-adapter-react'; | |
import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anchor_lang::prelude::*; | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
declare_id!("DoV2hRXUUYzyZ7yM9Ttmdv32JLQYJS168sDuugWpU3sQ"); | |
impl DepositeAccount { | |
pub const MAX_SIZE: usize = 2 + (1 + 32) + (4 + 10 * 32); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! An IDO pool program implementing the Mango Markets token sale design here: | |
//! https://docs.mango.markets/litepaper#token-sale. | |
use anchor_lang::prelude::*; | |
use anchor_lang::solana_program::program_option::COption; | |
use anchor_spl::token::{self, Burn, Mint, MintTo, TokenAccount, Transfer}; | |
declare_id!("2xYSvW9TbU7wnefXnBrnAqpwTnMckMG53XeENv1kdrdw"); | |
#[program] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem | |
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt | |
var options = { | |
key: fs.readFileSync('./key.pem', 'utf8'), | |
cert: fs.readFileSync('./server.crt', 'utf8') | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.9; | |
interface tokenRecipient { | |
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; | |
} | |
contract ERC20 { | |
mapping (address => uint256) public balanceOf; | |
mapping (address => mapping (address => uint256)) public allowance; | |
event Transfer(address indexed from, address indexed to, uint256 value); | |
event Approval(address indexed _owner, address indexed _spender, uint256 _value); | |
event Burn(address indexed from, uint256 value); |
NewerOlder