Yura Zarudniy a9013fd148 fix leak (#3181) 1 тиждень тому
..
contracts a9013fd148 fix leak (#3181) 1 тиждень тому
scripts 1b5195aa0a fix: run turbo fix 8 місяців тому
tests 0b3f734c79 chore(ton): increase test timeout 2 тижнів тому
wrappers 5f7408b076 chore: went back to previous engines versions 3 тижнів тому
.prettierignore 6efbe89542 chore: updated prettier ignores to prevent bikeshedding 2 тижнів тому
README.md 7bf23f24b8 add comments and ignore bounced messages (#2151) 11 місяців тому
jest.config.js 0b3f734c79 chore(ton): increase test timeout 2 тижнів тому
package.json 31c364cf41 feat: performed a minor bump all packages, since all were changed in the big dual package update 2 тижнів тому
tsconfig.build.json a615b5a17f chore: linting and typechecking yak shaving to the nth degree 3 тижнів тому
tsconfig.json 5ccba32169 fix: builds are back. updated to latest ts-duality which formats with prettier if it's available 3 тижнів тому

README.md

pyth

Project structure

  • contracts - source code of all the smart contracts of the project and their dependencies.
  • wrappers - wrapper classes (implementing Contract from ton-core) for the contracts, including any [de]serialization primitives and compilation functions.
  • tests - tests for the contracts.
  • scripts - scripts used by the project, mainly the deployment scripts.

How to use

Build

npx blueprint build or yarn blueprint build

Test

npx blueprint test or yarn blueprint test

Deploy or run another script

First, visit TON Center and register to get an API key to bypass rate limits. Replace <YOUR-API-KEY> with the API key you obtained from TON Center. <CUSTOM-TYPE> is either testnet or mainnet. <CHAIN-ID> is the chain ID of the chain you want to deploy to.

Then run:

CHAIN_ID=<CHAIN-ID> npx blueprint run --custom https://testnet.toncenter.com/api/v2/jsonRPC --custom-version v2 --custom-type <CUSTOM-TYPE> --custom-key <YOUR-API-KEY>

Add a new contract

npx blueprint create ContractName or yarn blueprint create ContractName

Important Note on Message Handling

When using the Pyth price feed in the recommended flow (User/App -> Pyth -> Protocol), be aware that:

Security Warning ⚠️

CRITICAL: Integrators MUST validate the sender address in their receive function to ensure messages are coming from the Pyth Oracle contract. Failure to do so could allow attackers to:

  • Send invalid price responses
  • Impersonate users via the sender_address and custom_payload fields
  • Potentially drain the protocol

Message Bouncing Behavior

  • If the target protocol bounces the message (e.g., due to invalid custom payload or other errors), the forwarded TON will remain in the Pyth contract and will not be automatically refunded to the original sender.
  • This could be significant when dealing with large amounts of TON (e.g., in DeFi operations).
  • Integrators should implement proper error handling and refund mechanisms in their applications.