Skip to content

Instantly share code, notes, and snippets.

Avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
View gist:5236a1abc864e2dceb28fe2b8ad914f9
//! 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]
@omgbbqhaxx
omgbbqhaxx / gist:426e57cbc90041cb7b951ac5a4d14cbb
Created Jun 11, 2021
how to generate ssl certificate on macbook instantly for node.js
View gist:426e57cbc90041cb7b951ac5a4d14cbb
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')
};
View decent.sol
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);
View eerlast.sol
pragma solidity >=0.5.16 <0.6.9;
//INCONTRACTWETRUST4.0
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract EthereumeRush {
string public name;
string public symbol;
uint8 public decimals = 18;
View eer.sol
pragma solidity >=0.5.16 <0.6.9;
//INCONTRACTWETRUST4.0
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract EthereumeRush {
string public name;
string public symbol;
uint8 public decimals = 18;
View etherpay.sol
pragma solidity ^0.6.3;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract EthereumPay {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
View x.sol
pragma solidity ^0.6.3;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* This contract neet to support referals system for erush's fast growth.
*/
View lasttwblock.sol
pragma solidity > 0.5.14;
contract eerminer {
function checklasttwentyblock() view public returns(bool, uint256) {
if(uint256(blockhash(block.number-1)) % 5200 == 1){
return (true, block.number-1);
}else if(uint256(blockhash(block.number-2)) % 5200 == 1){
return (true, block.number-2);
} else if(uint256(blockhash(block.number-3)) % 5200 == 1){
return (true, block.number-3);
@omgbbqhaxx
omgbbqhaxx / minePYTHON36.py
Created Oct 22, 2019 — forked from turunut/minePYTHON36.py
Example of how a Bitcoin block is mined by finding a successful nonce
View minePYTHON36.py
import hashlib, struct, codecs
ver = 2
prev_block = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
mrkl_root = "871714dcbae6c8193a2bb9b2a69fe1c0440399f38d94b3a0f1b447275a29978a"
time_ = 0x53058b35 # 2014-02-20 04:57:25
bits = 0x19015f53
# https://en.bitcoin.it/wiki/Difficulty
exp = bits >> 24
@omgbbqhaxx
omgbbqhaxx / block.py
Created Oct 22, 2019 — forked from ChristopherJohnston/block.py
Example Blockchain hash calculations using Python
View block.py
from hashlib import sha256
import time
import struct
import binascii
import datetime
VERSION = 1
def hexify(value, type):
return binascii.hexlify(struct.Struct(type).pack(value))