Hello Word smart contract for TON (FreeTON)

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:





  1. Where to begin;





  2. "Hello World";





  3. TON features of the Hello World smart contract;





  4. Links to additional information.





Fast start

VSCode TONDev, :





VSCode , Create Solidity Contract:





Selecting Create Solidity Contract in VSCode
Create Solidity Contract VSCode

Contract.sol:





Created default smart contract in VSCode
- VSCode

, Compile Solidity Contract:





Compiling a smart contract in VSCode
- VSCode

, -. .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 .








All Articles