MINI Sh3ll
<?
function x($val){
print '<pre>';
print_r($val);
print '</pre>';
die;
}
function y($val){
print '<pre>';
print_r($val);
print '</pre>';
}
function cmp_mintedon_epoch($a, $b) {
return $a['mintedon_epoch'] < $b['mintedon_epoch'];
}
function getMintedTokens(){
$curl = curl_init();
curl_setopt_array($curl, array(
//CURLOPT_URL => 'https://token.api.qila.io/tokens/?cc=2023080364cb65ba2bc08',
CURLOPT_URL => 'https://api.qila.io/bc/read?cc=202309136501a2fdba111',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'{}',
CURLOPT_HTTPHEADER => array(
'api_key: 2309136501a12bd7709',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
$response = json_decode($response, true);
usort($response['tokens'], "cmp_mintedon_epoch");
//y($response);
curl_close($curl);
return $response['tokens'];
}
function mintToken($jsondata){
$curl = curl_init();
curl_setopt_array($curl, array(
//CURLOPT_URL => 'https://token.api.qila.io/tokens/mint?cc=2023080364cb65ba2bc08',
CURLOPT_URL => 'https://api.qila.io/bc/write?cc=202309136501a2fdba111',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $jsondata,
CURLOPT_HTTPHEADER => array(
'api_key: 2309136501a12bd7709',
'Content-Type: application/json'
),
));
$mint_response = curl_exec($curl);
curl_close($curl);
$mint_response = json_decode($mint_response, true);
return $mint_response;
}
function getTokenHistory($tokenId){
//x($tokenId);
$curl = curl_init();
curl_setopt_array($curl, array(
//CURLOPT_URL => 'https://token.api.qila.io/tokens/history?cc=2023080364cb65ba2bc08',
CURLOPT_URL => 'https://api.qila.io/bc/history?cc=202309136501a2fdba111',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'{
"token_id" : "'.$tokenId.'"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'api_key: 2309136501a12bd7709',
),
));
$response = curl_exec($curl);
curl_close($curl);
$response = json_decode($response, true);
return $response;
}
function transferToken($tokenId, $toUser){
$curl = curl_init();
curl_setopt_array($curl, array(
//CURLOPT_URL => 'https://token.api.qila.io/tokens/transfer?cc=2023080364cb65ba2bc08',
CURLOPT_URL => 'https://api.qila.io/bc/transfer?cc=202309136501a2fdba111',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"token_id":"'.$tokenId.'",
"transfer_to":"'.$toUser.'"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'api_key: 2309136501a12bd7709',
),
));
$response = curl_exec($curl);
curl_close($curl);
$response = json_decode($response, true);
return $response;
}
function burnToken($tokenId, $owner){
$curl = curl_init();
curl_setopt_array($curl, array(
//CURLOPT_URL => 'https://token.api.qila.io/tokens/burn?cc=2023080364cb65ba2bc08',
CURLOPT_URL => 'https://api.qila.io/bc/delete?cc=202309136501a2fdba111',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"token_id":"'.$tokenId.'",
"owner": "'.$owner.'"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
//'api_key: 23080264ca01ef07d96',
'api_key: 2309136501a12bd7709',
),
));
$response = curl_exec($curl);
x($response);
curl_close($curl);
$response = json_decode($response, true);
return $response;
}
$tokenUsers = [
"Rajesh" => "x509::/OU=org1/OU=client/CN=651bd877e1cd11696323703::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"Kapil" => "x509::/OU=org1/OU=client/CN=651bfacdbb08e1696332493::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"Vijay" => "x509::/OU=org1/OU=client/CN=651bfb0b345681696332555::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"Anuj" => "x509::/OU=org1/OU=client/CN=651bfb153adc71696332565::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server"
];
/*$tokenUsers = [
"Rajesh" => "x509::/OU=org1/OU=client/CN=Rajesh::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"Nilesh" => "x509::/OU=org1/OU=client/CN=Nilesh::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"Raju" => "x509::/OU=org1/OU=client/CN=Raju::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"kiran" => "x509::/OU=org1/OU=client/CN=kiran::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server",
"Admin" => "x509::/OU=org1/OU=client/CN=6501ab46c26721694608198::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server"
];
$tokenOwnerNames = [
"x509::/OU=org1/OU=client/CN=Rajesh::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server" => "Rajesh",
"x509::/OU=org1/OU=client/CN=Nilesh::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server" => "Nilesh",
"x509::/OU=org1/OU=client/CN=Raju::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server" => "Raju",
"x509::/OU=org1/OU=client/CN=kiran::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server" => "kiran",
"x509::/OU=org1/OU=client/CN=6501ab46c26721694608198::/C=US/ST=North Carolina/O=Hyperledger/OU=Fabric/CN=fabric-ca-server" => "Admin"
];
$tokenColors = [
"Rajesh" => "primary",
"Nilesh" => "success",
"Raju" => "warning",
"kiran" => "danger",
];*/
?>
OHA YOOOO