Skip to content

Instantly share code, notes, and snippets.

View lainhathoang's full-sized avatar
Farming

lainhathoang

Farming
View GitHub Profile
use base64::{Engine, engine::general_purpose};
use jito_sdk_rust::JitoJsonRpcSDK;
use reqwest::Client;
use serde_json::json;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_sdk::{
pubkey::Pubkey,
signature::Keypair,
signer::{EncodableKey, Signer},
system_instruction::transfer,
studentId name email address dateOfBirth sex
1520264 Lại Nhật Hoàng [email protected] Gfvy84sLYxknKwoWos2bcBGdViwxjRM4UQh6zezJeESC 2001-09-12 MALE
152864 Nguyễn Ngọc Long [email protected] 3eKGfsRifMfLeHuhcLrjJWnF5fq7B3CfumkLcVPmhfht 2001-05-04 MALE
71264 Ngô Vũ Công Hậu [email protected] BZ3Tdb12if3fhoTVEjC5wRXymv91asitQJFg5G8h664P 1998-11-13 MALE
71264 Ngô Vũ Công Hậu [email protected] BZ3Tdb12if3fhoTVEjC5wRXymv91asitQJFg5G8h664P 1998-11-13 MALE
12364 Vũ Trung Kiên [email protected] 46SKB1VPyuVgAxeQGWg7aqEznunZGK31iw8BJ8Z8SrEZ 2001-01-01 MALE
45664 Phạm Đức Hoàng [email protected] HeDfoSZRqJ4YKWTKdKJ2Ey9YcDVCM6dgNNbANL7WQh4K 2001-01-01 MALE
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity =0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract StudentManagement {
// Custom errors
error StudentAlreadyExists(uint256 mssv); // Lỗi khi sinh viên đã tồn tại
error StudentNotFound(uint256 mssv); // Lỗi khi sinh viên không tồn tại
error InvalidGrade(uint256 diem); // Lỗi khi điểm không hợp lệ
error CourseNotCompleted(uint256 maMonHoc); // Lỗi khi môn học chưa hoàn thành
error NotOwner(address caller); // Lỗi khi người gọi không phải là owner
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
contract MyToken is ERC721, ERC721URIStorage, ERC721Burnable, Ownable {
constructor(address initialOwner)
import {
AddressLookupTableAccount,
Connection,
Keypair,
PublicKey,
TransactionInstruction,
TransactionMessage,
VersionedTransaction,
} from "@solana/web3.js";
import axios from "axios";
import {
AddressLookupTableAccount,
Connection,
Keypair,
PublicKey,
TransactionInstruction,
TransactionMessage,
VersionedTransaction,
} from "@solana/web3.js";
import axios from "axios";
import {
AddressLookupTableAccount,
Connection,
Keypair,
PublicKey,
TransactionInstruction,
TransactionMessage,
VersionedTransaction,
} from "@solana/web3.js";
import axios from "axios";
import {
AddressLookupTableAccount,
Connection,
Keypair,
PublicKey,
Transaction,
TransactionInstruction,
TransactionMessage,
VersionedTransaction,
} from "@solana/web3.js";
import {
Connection,
Keypair,
PublicKey,
Transaction,
TransactionMessage,
VersionedTransaction,
} from "@solana/web3.js";
import axios from "axios";
import * as fs from "fs";