One of the interesting topics that I would like to talk about today is the programming of smart contracts. For the language in which we will program our smart we will take Solidity, and as a platform we will use FreeTON
We will not dive into blockchain technology today, because there are already many articles about it. Therefore, consider a simple smart contract in the following order:
Where to begin;
"Hello World";
TON features of the Hello World smart contract;
Links to additional information.
Fast start
VSCode , Create Solidity Contract:
Contract.sol:
, Compile Solidity Contract:
, -. .tvc .abi.json.
, , HelloWorld.sol.
Hello World!
"Hello World" :
pragma ton-solidity >= 0.35.0;
pragma AbiHeader expire;
contract HelloWorld {
function HelloWorld() public pure returns (string) {
tvm.accept();
return 'Hello World!';
}
}
tvm.log("Hello World!"); TON, TON Solidity Compiller API.
TON - "Hello World"
- , -, "": - , ( DDoS). - , ( ), ( ) .
"Hello World", tvm.accept(); API TON. , , - ( , - ).
"" - -, , blockchain-. C, tvm.accept(); - - ( ). - , require().
require() () , -. , tvm.accept(); require(msg.pubkey() == tvm.pubkey()); -, - -.
. . - JavaScript, . , . , .
To obtain basic information about the TON project, you can go to the official website of the Pavel and Nikolai Durov project . Unfortunately, due to difficulties with regulators in the United States, the project, as part of Telegram, has been closed. The project that continued on its way became an independent community . And here is the developer documentation . Well, github .