Start coding smart contracts in any language like JavaScriptPythonJavaTypeScriptC#C++CGoRustKotlin
QAN TestNet Docsfunction contract(args) {
// THIS SAMPLE ONLY SUPPORTS THE "register" FUNCTION
if (args && args.length === 2 && args[0] === "register") {
// GET THE CURRENT USER'S NAME OR DEFAULT TO "unknown" IF THIS IS THE FIRST CALL
const previous_name = process.env.DB_USER_CURRENT || "unknown";
// GET THE TOTAL USER COUNT
const total_user_count = parseInt(process.env.DB_TOTALUSERS || "0");
// WRITE PREVIOUS USER NAME TO STDOUT
process.stdout.write("OUT=prevname: " + previous_name);
process.stdout.write("\n");
// UPDATE CURRENT USER NAME BY WRITING IT TO DB
process.stdout.write("DBW=USER_CURRENT=" + args[1]);
process.stdout.write("\n");
// STORE USER NAME UNDER A STORAGE SLOT FOR PERSISTENCE (CURRENT GETS OVERWRITTEN ON EACH CALL)
process.stdout.write("DBW=USER_" + total_user_count + "=" + args[1]);
process.stdout.write("\n");
// INCREMENT THE TOTAL USER COUNT
process.stdout.write("DBW=TOTALUSERS=" + (total_user_count + 1));
process.stdout.write("\n");
process.exit(0);
}
if (args.length >= 1) {
process.stderr.write("Wrong CMD: " + args[0]);
process.stderr.write("\n");
process.exit(1);
}
process.stderr.write("Wrong args!");
process.stderr.write("\n");
process.exit(1);
}
contract(process.argv.slice(2));
If you want to dig deeper please click for more
Why QAN is your best choice?
No. 1
Code in any language
No need to learn a new language like Solidity.
You can use your existing knowledge and code in any language like: Java, JavaScript, TypeScript, C, C++, C#, Go, Rust, etc.
Learn moreNo. 2
Get developer royalties
Imagine if GitHub rewarded developers when their code is getting re-used.
QANplatform is the first Layer 1 blockchain that rewards developers after each transaction.
Learn moreNo. 3
PoR consensus algorithm
Proof-of-Randomness (PoR) is a carbon-free and decentralized consensus algorithm developed by QANplatform.
It combines the best parts of Proof-of-Work (PoW) and Proof-of-Stake (PoS).
Learn morePlatform structure
Done
Upcoming
No. 1
Build on QAN blockchain platfrom
No. 2
Code in these languages
No. 3
Types of QAN blockchain platform
No. 4
Deployed using these systems
No. 5
Running on these platforms
Cloud
Virtualized
Bare metal
F.A.Q.
Why is your GitHub empty?
QANplatform has 4 IPs (Intellectual Properties) which the company needs to protect before the QAN MainNet launch. For this reason the developer team is working in a private GitLab.
When will you make the code open source?
The code will be open source after the QAN MainNet launch, although some parts could stay closed source for some time to keep our market advantage.