Skip to content

Instantly share code, notes, and snippets.

View kehiy's full-sized avatar
🏓
pong!

k. kehiy

🏓
pong!
View GitHub Profile
@kehiy
kehiy / pactus_bulk_transaction.py
Created August 20, 2024 16:00
A python script which sends bulk transaction to a list of addresses in Pactus network
import random
import grpc
import json
from pactus.crypto import CryptoConfig
from pactus.crypto.address import Address
from pactus.crypto.bls.private_key import PrivateKey
from pactus.transaction.transaction import Transaction
from pactus.types.amount import Amount
from pactus.rpc.transaction_pb2_grpc import TransactionStub
@kehiy
kehiy / pactus_bulk_address.py
Last active August 20, 2024 15:27
A python script that generates Pactus address and save them in a JSON file
import json
import secrets
from pactus.crypto import CryptoConfig
from pactus.crypto.address import AddressType, Address
from pactus.crypto.bls.private_key import PrivateKey, PublicKey
def main() -> None:
addresses = []
@kehiy
kehiy / collatz.py
Last active April 16, 2024 15:41
Collatz conjecture or 3n+1 problem in python
import random
def is_odd(num: int):
if (num % 2) == 0:
return False
return True
def collatz(num: int):
@kehiy
kehiy / factorial.c
Last active April 3, 2024 10:10
factorial calculation
#include <stdio.h>
int factorial(int n) {
if (n == 0) {
return 1;
}
return n * factorial(n -1);
}
int main()