* More documentation on the upgrade procedure and mainnet init
* Add profiling utility for aptos
* Reuse contract manager logic to sync guardian sets
* Add documentation for sui gas profiling
* Use the actual wormhole deployment on testnet for sui testnet config
* Simpler deployment script
* Bugfix in upgrade payload deserialization
* Bugfix in fetching upgrade digest
* Small contract manager refactoring and more integration for upgrade script in sui
* Remove old scripts
* Add script for just generating the sui contract digest
* Restrict HotPotatoVector borrow access
The return value of `create_price_infos_hot_potato` should not be inspectable
outside of the package.
* Reorganize the cli lib for sui
* Add minimal README for sui cli
* Update the general README for sui
* Reuse sui sdk logic in contract manager
* Manual serialization of accumulator updates for increasing payload size
Default payload size seems to be 1024 bytes which is not enough for messages
with multiple feeds
* Bump sdk version
* - refactor Pyth governance code path to not use wormhole::governance_message module
- use our own custom WormholeVAAVerificationReceipt struct instead of DecreeReceipt
* delete print
* delete print
* contract edits
* add test vaa / test for set_update_fee
* bring back set data sources test
* use correct VAA for test set data sources
* delete commented out code
* write test for set stale price threshold
* update pyth verify_vaa
* simplify pyth::governance::verify_vaa
* use sequence number for replay protection in both governance and contract upgrade code paths
* only use sequence number for replay protection
* upgrade script for Pyth, so far getting the dependencies and digest works
* upgrade_pyth
* made progress: works up until verify_vaa
* delete some comments
* upgrade almost works, on last step now
* comments
* edit
* upgrade process pretty much works (we got an IncompatibleUpgrade error)
* fix bug in pyth migrate process (handle_migrate threw error because take_digest was destroying non-empty cursor and not removing prefix bytes)
* comments and toml file
* revert change to Move.lock file
* remove migrate__v__0_1_1
* prettier
* move test accumulator message details to above the definition
* camel case to snake case
* deserialize and check header inside of parse_and_verify_accumulator_message
* factor out cleanup / destruction function for worm / pyth states and clock
* take_wormhole_and_pyth_states to simplify 9 tests
* get_balance for price_info_object
* Store fees as dynamic fields
* Rename functions and modules back to the published version to remain bacward compatible
* Remove withdrawal functionality for now
This functionality can always be added via contract upgrades
---------
Co-authored-by: optke3 <optke3@gmail.com>
Co-authored-by: optke3 <108488464+optke3@users.noreply.github.com>
* move test accumulator message details to above the definition
* camel case to snake case
* deserialize and check header inside of parse_and_verify_accumulator_message
* factor out cleanup / destruction function for worm / pyth states and clock
* take_wormhole_and_pyth_states to simplify 9 tests
* update
* Simplify some tests and add more
---------
Co-authored-by: optke3 <optke3@gmail.com>
Co-authored-by: Amin Moghaddam <amin@amins-mbp.tail922f3.ts.net>
* move test accumulator message details to above the definition
* camel case to snake case
* deserialize and check header inside of parse_and_verify_accumulator_message
* factor out cleanup / destruction function for worm / pyth states and clock
* take_wormhole_and_pyth_states to simplify 9 tests
* update
* merkle tree impl
* - take leftmost 20 bytes in hash
- don't assign output of cursor::take_rest to _, instead just drop it
* push PREFIXes (MERKLE_LEAF_PREFIX, MERKLE_NODE_PREFIX) to front instead of back
* delete testXOR
* test construct merkle tree depth exceeded error
* invalid merkle proof test cases
* comments
* rename failure tests
* simplification for initializing a vector
* fix leafHash bug, add tests for hashLeaf and hashNode
* pyth accumulator start, extract_price_info_from_merkle_proof, parse_price_feed_message
* parse_price_feed_message, parse_and_verify_accumulator_updates
* implementation + debugging for merkle pyth accumulator
* edit merkle tree
* testNodehash
* test hash
* delete prints
* test case for parse and verify TEST_ACCUMULATOR_3_MSGS
* hot potato vector -> authenticated price infos
* refactor - move tests from pyth_accumulator to pyth to avoid dependency cycle
* remove _ from deserializing unused vaa
* add sui-contract.yml for github actions
* AuthenticatedPriceInfos -> AuthenticatedVector
* charge base update fee per call to update_single_price_feed
* add back multiple tests, including test_create_and_update_price_feeds_insufficient_fee, update cache, update cache old update
* test multiple price feed creation and update accumulator
* authenticated_price_infos.move -> authenticated_vector.move
* 5 * single_update_fee
* delete some comments, add accumulator test info
* don't make TEST_VAAS test_only in pyth.move
* remove #[test_only]s
* assert price info object contains correct price feed info
* factor out some constants from accumulator test cases to reduce duplicate code
* add sui-contract.yml file for github actions CI
* more refactor and clean-up
* assert price_info_object_1 is correct in test_create_and_update_price_feeds_with_batch_attestation_success
* removed the parse_and_verify_accumulator_message_with_worm_state entirely, and instead added the helper parse_vaa_bytes_from_accumulator_message
* edit comment
* update comment
* edit sui github ci
* fix for sui-contract.yml
* MINIMUM_SUPPORTED_MINOR_VERSION and MAJOR_VERSION
* remove test_get_price_feed_updates_from_accumulator and parse_vaa_bytes_from_accumulator_message from pyth_accumulator.move
* test_parse_and_verify_accumulator_updates_with_extra_bytes_at_end_of_message
* sui contract yml update
* use rev to cargo install sui in github actions ci
* cargo install --locked for github CI
* merkle tree impl
* - take leftmost 20 bytes in hash
- don't assign output of cursor::take_rest to _, instead just drop it
* push PREFIXes (MERKLE_LEAF_PREFIX, MERKLE_NODE_PREFIX) to front instead of back
* delete testXOR
* test construct merkle tree depth exceeded error
* invalid merkle proof test cases
* comments
* rename failure tests
* simplification for initializing a vector
* fix leafHash bug, add tests for hashLeaf and hashNode
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* sui governance
* some newlines
* error codes
* update and comment
* unit tests for pyth.move, add UpgradeCap to Pyth State (will be used for contract upgrades)
* updates
* test_get_update_fee test passes
* fix test_get_update_fee and test_update_price_feeds_corrupt_vaa
* test_update_price_feeds_invalid_data_source
* test_create_and_update_price_feeds
* test_create_and_update_price_feeds_success and test_create_and_update_price_feeds_price_info_object_not_found_failure
* test_update_cache
* update
* test_update_cache_old_update
* update_price_feeds_if_fresh
* comment
* contract upgrades start
* contract upgradeability
* update clock stuff
* edits
* use clone of sui/integration_v2 for stability
* make contract_upgrade::execute a public(friend) fun, remove clock arg
* E_INCORRECT_IDENTIFIER_LENGTH
* comment and edit
* add a single comment
* upgradeability fixes, other fixes
* update, migrate, state, pyth, setup, version_control
* upgradeability, governance, LatestOnly
* - state init_version, init_package_info
- governance and contract ugpradeability stuff
* make several functions public(friend), and friend the right modules in data_source.move
* add comment
* fix bug in from_u8, so that value <= TRANSFER_FEE
* rename error message to E_MUST_USE_CONTRACT_UPGRADE_MODULE_TO_DO_UPGRADES
* set_last_executed_governance_sequence
* set pyth governance_module to 0000000000000000000000000000000000000000000000000000000000000001
* update README
* Update README.md
* Update README.md
* delete comments
* Update README.md
* Update README.md
* change Wormhole dependency to branch sui/mainnet, which has the latest update that includes VAA sequence number in DecreeReceipt
do proper checking of sequence number when executing governance instructions, allow set_governance_data_source to update the sequence number to some initial_sequence.
* state::set_last_executed_governance_sequence
* rename error
* add newline to setup.move
* delete space
* Update README.md
* mark test module as well as some imports #[test_only] so sui move build works
* scripts for Pyth contract testing and deployment
remove required_version.move, as it is no longer being used for access control
make init_and_share_state a public(friend) function
* add build to Makefile
* init pyth ts script
* sui deploy and testing scripts
* contract fixes, set_fee_recipient governance action, emit price update event only if fresh price update
* init_pyth.ts, registry.ts, create_price_feed.ts
* create price feeds
* deploy script and Move.toml
* some contract updates to compile with WH branch sui/mainnet
deployment script updates
* update README
* update readme
* rename TS scripts, edit readme
* add rev for wormhole dependency, edit README
* edit create_price_feed script
* - add price_info::get function for getting PriceInfoObject ID from PriceIdentifier
- add test for price_info::get
* contract updates
* script edits
* contract upgrade in version_control.move and fix pyth_create_price_feed.ts
* add get_price_info_object_id function to pyth::state
* tests and build pass
* update scripts
* Pyth mainnet deploy, create all price feeds script
* clean up script imports
* add mainnet addresses to readme
* correct Pyth Mainnet addresses
* create price feeds on mainnet
* use git dependency in Move.toml
* edits
* delete required contracts
* get price info object ids
* get price info object IDs
* add json file containing price feed id to price info object id
* comment
* clean up scripts folder and imports
* more script clean up (comments)
* script updates
* hot potato stuff
* create_price_infos_hot_potato and update_single_price_feed
* don't create hot potato in batch price attestation
* latest only checks in Pyth.move
* delete tab
* edit
* run pre-commit hooks
* update price feeds script
* update_single_price_feed_logic, give hot potato contents type T copy and drop ability
* delete custom price attestation test
* get update multiple price feeds POC to work
* formatting via pre-commit
* update Move.toml so can run "sui move test", delete some error codes that were unused
* update update_price_feeds demo to auto-retrieve price info object ids
* update readme
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* don't print map, get prices after update
* script comments
* Update update_price_feeds.ts
* Update update_price_feeds.ts
* Update README.md
* script for token transfers
* testnet "mainnet simulation" deployment (with 19 mainnet guardians), and testnet deployment (with single testnet guardian)
* mainnet deploy
* update Move.toml
* Update README.md
* Update README.md
* edit readme
* Update README.md
* Update README.md
* Update README.md
* add PRICE_INFO_OBJECT map ID to README
* common questions
* edit comment
* update readme
* fix link
* add comments for update_single_price_feed
* edits
* Update README.md
* Update README.md
* Update README.md
* pre-commit run --all-files
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* sui governance
* some newlines
* error codes
* update and comment
* unit tests for pyth.move, add UpgradeCap to Pyth State (will be used for contract upgrades)
* updates
* test_get_update_fee test passes
* fix test_get_update_fee and test_update_price_feeds_corrupt_vaa
* test_update_price_feeds_invalid_data_source
* test_create_and_update_price_feeds
* test_create_and_update_price_feeds_success and test_create_and_update_price_feeds_price_info_object_not_found_failure
* test_update_cache
* update
* test_update_cache_old_update
* update_price_feeds_if_fresh
* comment
* contract upgrades start
* contract upgradeability
* update clock stuff
* edits
* use clone of sui/integration_v2 for stability
* make contract_upgrade::execute a public(friend) fun, remove clock arg
* E_INCORRECT_IDENTIFIER_LENGTH
* comment and edit
* add a single comment
* upgradeability fixes, other fixes
* update, migrate, state, pyth, setup, version_control
* upgradeability, governance, LatestOnly
* - state init_version, init_package_info
- governance and contract ugpradeability stuff
* make several functions public(friend), and friend the right modules in data_source.move
* add comment
* fix bug in from_u8, so that value <= TRANSFER_FEE
* rename error message to E_MUST_USE_CONTRACT_UPGRADE_MODULE_TO_DO_UPGRADES
* set_last_executed_governance_sequence
* set pyth governance_module to 0000000000000000000000000000000000000000000000000000000000000001
* update README
* Update README.md
* Update README.md
* delete comments
* Update README.md
* Update README.md
* change Wormhole dependency to branch sui/mainnet, which has the latest update that includes VAA sequence number in DecreeReceipt
do proper checking of sequence number when executing governance instructions, allow set_governance_data_source to update the sequence number to some initial_sequence.
* state::set_last_executed_governance_sequence
* rename error
* add newline to setup.move
* delete space
* Update README.md
* mark test module as well as some imports #[test_only] so sui move build works
* scripts for Pyth contract testing and deployment
remove required_version.move, as it is no longer being used for access control
make init_and_share_state a public(friend) function
* add build to Makefile
* init pyth ts script
* sui deploy and testing scripts
* contract fixes, set_fee_recipient governance action, emit price update event only if fresh price update
* init_pyth.ts, registry.ts, create_price_feed.ts
* create price feeds
* deploy script and Move.toml
* some contract updates to compile with WH branch sui/mainnet
deployment script updates
* update README
* update readme
* rename TS scripts, edit readme
* add rev for wormhole dependency, edit README
* edit create_price_feed script
* - add price_info::get function for getting PriceInfoObject ID from PriceIdentifier
- add test for price_info::get
* contract updates
* script edits
* contract upgrade in version_control.move and fix pyth_create_price_feed.ts
* add get_price_info_object_id function to pyth::state
* tests and build pass
* update scripts
* Pyth mainnet deploy, create all price feeds script
* clean up script imports
* add mainnet addresses to readme
* correct Pyth Mainnet addresses
* create price feeds on mainnet
* use git dependency in Move.toml
* edits
* delete required contracts
* get price info object ids
* get price info object IDs
* add json file containing price feed id to price info object id
* comment
* clean up scripts folder and imports
* more script clean up (comments)
* script updates
* pre-commit run --all-files
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* sui governance
* some newlines
* error codes
* update and comment
* unit tests for pyth.move, add UpgradeCap to Pyth State (will be used for contract upgrades)
* updates
* test_get_update_fee test passes
* fix test_get_update_fee and test_update_price_feeds_corrupt_vaa
* test_update_price_feeds_invalid_data_source
* test_create_and_update_price_feeds
* test_create_and_update_price_feeds_success and test_create_and_update_price_feeds_price_info_object_not_found_failure
* test_update_cache
* update
* test_update_cache_old_update
* update_price_feeds_if_fresh
* comment
* contract upgrades start
* contract upgradeability
* update clock stuff
* edits
* use clone of sui/integration_v2 for stability
* make contract_upgrade::execute a public(friend) fun, remove clock arg
* E_INCORRECT_IDENTIFIER_LENGTH
* comment and edit
* add a single comment
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* sui governance
* some newlines
* error codes
* update and comment
* unit tests for pyth.move, add UpgradeCap to Pyth State (will be used for contract upgrades)
* updates
* test_get_update_fee test passes
* fix test_get_update_fee and test_update_price_feeds_corrupt_vaa
* test_update_price_feeds_invalid_data_source
* test_create_and_update_price_feeds
* test_create_and_update_price_feeds_success and test_create_and_update_price_feeds_price_info_object_not_found_failure
* test_update_cache
* update
* test_update_cache_old_update
* update_price_feeds_if_fresh
* comment
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* sui governance
* some newlines
* error codes
* update and comment
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* sui governance
* some newlines
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* sui pyth
* update price feeds, dynamic object fields, Sui object PriceInfoObject
* register price info object with pyth state after creation
* PriceFeedUpdateEvent
* state getters and setters, change Move.toml dependency to sui/integration_v2
* finish state.move
* add new line to pyth
* use deployer cap pattern for state module
* indent