Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 

Repository files navigation

Sample Contracts for TON Labs ToolChain

New sample contracts in Solidity:

  • contract01: demonstrates how to save data to a persistent storage. Use the getaccount command to obtain the contract state;
  • contract02: demonstrates how to call a remote contract by passing an integer. The remote contract saves this integer and it is available for checking;
  • contract03: demonstrates the way msg.sender function allows getting an address of a contract that called you;
  • contract04: demonstrates Grams transfer with the address.transfer() function;
  • contract05: callback implementation. One contract calls another one and gets response with a callback;
  • contract06: demonstrates implementation of mappings, external methods and callbacks.

Sample contracts in C:

  • example-1-hello-world: the simplest contract in the repository, it adds 2 and 2 and returns the sum as an external message. Use it as a starting point.
  • example-2-echo: stores the last input value in a persistent variable. Value changes allow a user to track method invocation results by using the getaccount command.
  • example-3-transfer-80000001: sends 0xAAAA nanograms (43960 in decimal) to the 0x80000001 account. This contract shows how to create and send internal messages.

For additional guidelines, go to https://ton.dev/quickstart and to ReadMe's of each sample.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors