-
Notifications
You must be signed in to change notification settings - Fork 302
feat(target_chains/ton): add execute_governance_action #1882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e6b3ca5
eeb36d0
da4c8a0
28d2d72
d8406d2
a69ffed
4c1b140
bebe051
32dfaa2
d0ac2a6
4aa6b91
ccd685c
c2d456b
3d28054
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,25 @@ | ||
| const int ACCUMULATOR_MAGIC = 0x504e4155; ;; "PNAU" (Pyth Network Accumulator Update) | ||
| const int ACCUMULATOR_WORMHOLE_MAGIC = 0x41555756; ;; Stands for AUWV (Accumulator Update Wormhole Verficiation) | ||
| const int ACCUMULATOR_WORMHOLE_MAGIC = 0x41555756; ;; "AUWV" (Accumulator Update Wormhole Verficiation) | ||
| const int GOVERNANCE_MAGIC = 0x5054474d; ;; "PTGM" (Pyth Governance Message) | ||
| const int GOVERNANCE_MODULE = 1; | ||
| const int MAJOR_VERSION = 1; | ||
| const int MINIMUM_ALLOWED_MINOR_VERSION = 0; | ||
|
|
||
| const int GUARDIAN_SET_EXPIRY = 86400; ;; 1 day in seconds | ||
| const int UPGRADE_MODULE = 0x0000000000000000000000000000000000000000000000000000000000436f7265; ;; "Core" (left-padded to 256 bits) in hex | ||
|
|
||
| const int WORMHOLE_MERKLE_UPDATE_TYPE = 0; | ||
|
|
||
| {- | ||
| The main workchain ID in TON. Currently, TON has two blockchains: | ||
| 1. Masterchain: Used for system-level operations and consensus. | ||
| 2. Basechain/Workchain: The primary chain for user accounts and smart contracts. | ||
|
|
||
| While TON supports up to 2^32 workchains, currently only Workchain 0 is active. | ||
| This constant defines the default workchain for smart contract deployment and interactions. | ||
|
|
||
| Note: Gas costs differ between chains: | ||
| - Basechain: 1 gas = 400 nanotons = 0.0000004 TON | ||
| - Masterchain: 1 gas = 10000 nanotons = 0.00001 TON (25x more expensive) | ||
| -} | ||
| const int WORKCHAIN = 0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there are 2 blockchains on TON: https://docs.ton.org/learn/overviews/ton-blockchain#blockchain will add comment to the file to make it clearer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| int get_compute_fee(int workchain, int gas_used) asm(gas_used workchain) "GETGASFEE"; | ||
|
|
||
| ;; The actual gas used for the transaction is 350166 but we add ~10% (385182.6) and round up (390000) to be on the safe side because the amount of gas used can vary based on the current state of the blockchain | ||
| const int UPDATE_PRICE_FEEDS_GAS = 390000; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. calculated by following the best practice suggested here which is to run tests and get the actual |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| const int UPGRADE_CONTRACT = 0; | ||
| const int AUTHORIZE_GOVERNANCE_DATA_SOURCE_TRANSFER = 1; | ||
| const int SET_DATA_SOURCES = 2; | ||
| const int SET_FEE = 3; | ||
| const int SET_VALID_PERIOD = 4; | ||
| const int REQUEST_GOVERNANCE_DATA_SOURCE_TRANSFER = 5; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| const int OP_UPDATE_GUARDIAN_SET = 1; | ||
| const int OP_UPDATE_PRICE_FEEDS = 2; | ||
| const int OP_EXECUTE_GOVERNANCE_ACTION = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will implement in a following PR