Commit Graph

159 Commits

Author SHA1 Message Date
optke3 a7383a3648
[sui 11/x] - pyth merkle accumulator (#910)
* 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
2023-06-28 10:09:50 -05:00
optke3 382a6fc9a4
[sui 10/x] - merkle tree (#903)
* 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
2023-06-26 12:05:06 -05:00
Mohammad Amin Khashkhashi Moghaddam ee6a744a33
Fix test by increasing major version instead of minor version (#921)
SDK now allows minor version updates, so the test was not failing anymore
as expected
2023-06-26 12:31:06 +02:00
Ali Behjati e39277dd9c
[eth] Add setWormholeAddress governance message (#917)
* [eth] Add setWormholeAddress governance message

* Address review feedbacks

* Add signatures to errors

This will help with debugging

* Update abi
2023-06-26 11:31:19 +02:00
Mohammad Amin Khashkhashi Moghaddam fb6672fbfb
Aptos accumulators (#904)
* Pin dependency versions

* Implement accumulator support on aptos

* Fix formatting on error.move in aptos

* Add CI workflow for aptos

* Upgrade to aptos cli 1.0.4
2023-06-23 11:27:25 +01:00
swimricky 919f71e68f
[eth] - optimize ReceiverMessages parseAndVerifyVM (#901)
* feat(eth): optimize ReceiverMessages parseAndVerifyVM

* test(eth): update test setups to use wormholeReceiver

* chore(eth): remove console logging

* feat(eth): optimize & revert return type for parseAndVerifyVM

* fix(eth): add index boundary checks

* perf(eth): optimize verifySignature by passing in primitives instead of structs

* test(eth): add wormhole tests related to guardian set validity

* test(eth): add more parseAndVerify failure test cases

* test(eth): add more failure tests for parseAndVerify

* test(eth): add empty forge test, refactor/deduplicate
2023-06-22 14:11:54 -04:00
Ali Behjati d07cc9d1ea
[hermes] Add storage tests + refactor (#907)
* [hermes] Add storage tests + refactor

* Bump pythnet_sdk version + update cosmwasm

* Address review feedbacks
2023-06-22 14:38:56 +01:00
Mohammad Amin Khashkhashi Moghaddam c9c20310d3
Add slot variable in constructing fake wormhole payloads (#908)
The structure of the fake payload was not as expected.
Some tests were failing for the wrong reason but with the right error code.
Added one testcase to make sure the default behavior of the forging function
is correct.
2023-06-22 10:26:34 +01:00
Mohammad Amin Khashkhashi Moghaddam ef963cdfc6
Cosmwasm refactor and preparation for parse price feeds (#895)
* Add more tests for update_fee_amount

Restructure code to split parsing and updating logic so that all
messages can be parsed without being applied

* Fix docker build command for cosmwasm contract

* Refactor is_fee_sufficient tests

Extract out the chain specific part into separate function
Merge test_accumulator_is_fee_sufficient back into is_fee_sufficient

* Rename function and simplify process_batch_attestation tests
2023-06-22 09:49:05 +01:00
optke3 f3edf9c971
[sui 9/x] - hot potato fix for price updates (#805)
* 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
2023-06-20 00:04:01 -04:00
optke3 f34c9df224
[sui 8/x] - finalize contracts, deploy scripts, address audit feedback (#783)
* 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
2023-06-19 23:05:33 -04:00
Ali Behjati 11a0ba17d0
[eth] Deploy to gnosis mainnet (#892) 2023-06-15 20:58:39 +02:00
Jayant Krishnamurthy 25c1ac2c33
[xc-admin] Contract management tool (#885)
* cleanup

* blah

* gr

* stuff

* hm

* hmm

* wtf

* ah fix this

* ok finally it does something

* ok

* hrm

* hrm

* blah

* blah
2023-06-15 07:17:20 -07:00
swimricky 44cd5fc42d
[eth] more update/parsePriceFeed optimizations (#886)
* perf(ethereum): optimize gas & bytesize by changing  some function parameters to use bytes memory

change parseWormholeMerkleHeaderNumUpdates & parsePriceFeedMessage to use bytes memory instead of
bytes calldata for function parameters

* perf(ethereum): more optimizations

use bytes memory for more functions, change parsePriceFeedMessage to use offset instead of copying a
slice

* [eth] Add unsafe calldata bytes lib (#888)

* Copy UnsafeBytesLib to UnsafeCalldataBytesLib

* [eth] Add UnsafeCalldataBytesLib and update code

---------

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2023-06-14 09:20:52 -04:00
swimricky bc338ccfb5
[eth]: add forward compatibility test for accumulator updateData (#884)
* test(ethereum): add forward compatibility test for accumulator data

* test(ethereum): fix typo and rename
2023-06-13 11:02:41 -07:00
swimricky 19b77e2c84
[ethereum] - charge updateFee per number of updates (#878)
* feat(ethereum): charge update fee per numUpdates for accumulator updates

* refactor(ethereum): refactor, add benchmarks for getUpdateFee

* refactor(ethereum): add back parseWormholeMerkleHeaderNumUpdates

* refactor: increment totalNumUdpates by 1 for batch prices

* test(ethereum): add test for checking getUpdateFee for accumulator, clean up unused code
2023-06-13 07:25:46 -07:00
Mohammad Amin Khashkhashi Moghaddam 211bf02450
Implement accumulator updates for cosmwasm (#880)
* Implement accumulator updates for cosmwasm

* Update fee calculation logic for accumulator messages

The fee for accumulator messages is base fee times the number of messages
but the logic remains the same for the batch method
2023-06-13 12:59:29 +02:00
Ali Behjati 183081cc20
Expose pythnet message buffer idls (#865) 2023-06-09 14:10:28 +02:00
swimricky 31e8d020cc
[eth] - optimize parse/updatePriceFeeds for gas & bytesize (#868)
* perf: optimize parse/updatePriceFeeds for gas & bytesize

* chore: cleanup

* refactor: renaming functions

* test: add benchmark tests for parse with wh merkle, clean up duplicate code
2023-06-08 13:49:21 -07:00
swimricky 9ddc7fdc7d
Ethereum/parse price feed updates accumulators (#855)
* feat(target-chains/ethereum): add accumulator support for parsePriceFeedUpdates

* feat(target-chains/ethereum): working impl & test of parsePriceFeedUpdates w/ accumulator data

* refactor(target-contracts/ethereum): refactor pyth accumulator

* refactor: remove console logs & imports

* refactor(target-chain/eth): refactor and more tests

* feat(target-chains/ethereum): address PR feedback

refactor, add parse revert tests

* chore: fix comment

* test(target-chains/ethereum): add/clean up tests

* test: add another test

* test: address more feedback
2023-06-07 12:44:47 -07:00
Ali Behjati bdc3fede24
[eth] Deploy to Kava (#859)
* [eth] Deploy to Kava

* [eth] Bump sdk/js package version

* [eth] Fix pre-commit
2023-06-07 15:29:03 +02:00
Jayant Krishnamurthy 925f606550
Fix oracle swap example and add docs (#856) 2023-06-03 07:39:00 -07:00
guibescos 11cb14ca76
Deploy neon (#854)
* Push

* Add config

* Sync up optimization for hardhat and truffle
2023-06-02 11:29:35 +01:00
Jayant Krishnamurthy 64bce66383
Choose unique VAA for query time if it exists (#853)
* hmm this way works but is complicated

* choose unique vaa

* update tests

* lint

* bump versions
2023-06-01 07:32:10 -07:00
Dev Kalra afecda7881
sei mainnet deployment (#851) 2023-05-30 13:11:03 +05:30
Daniel Chew 6cdcf4dffd
make cosmwasm deploy tools private (#850) 2023-05-29 21:25:42 +09:00
Daniel Chew f99f23c416
update price service sdk (#849)
* update price service sdk

* bump version

* fix test

* include slot

* bump price-service-client version

* bump all that uses price-service-client

* bump all that uses price-service-client
2023-05-29 20:18:29 +09:00
Dev Kalra c0956f8157
[cosmwasm] contracts test and updates (#839)
* contracts test and updates

* wormhole deployment

* sei contract details update
2023-05-26 14:24:40 +05:30
Ali Behjati 4072520006
[eth] Update accumulator deserialization (#838) 2023-05-24 16:05:17 +02:00
Dev Kalra 315fd413a8
[cosmwasm] osmosis mainnet deployment (#833)
* correct lable

* osmosis mainnet deploymnent
2023-05-24 17:39:23 +05:30
Jayant Krishnamurthy 01b54d2c58
Add PythErrors abi (#827)
* add error abis

* add to script too
2023-05-23 07:13:01 -07:00
Dev Kalra fbcb8a14f6
[cosmwasm] chain ids for pyth mainnet, pyth testnet stable, and pyth testnet edge feeds (#822)
* add chainids

* chain ids

* wormhole, instantiate, and test

* update chain structure

* update test script

* update chain id guidelines

* if brackets

* correct test arguments
2023-05-23 11:16:50 +05:30
Dev Kalra 3b03f9eddc
[cosmwasm] instantiate contracts on multiple chains (#799)
* instantiate contracts on multiple chains

* deploy to neurtron

* function not being used anymore

* rename file dir

* better logs

* wormhole guardian upgrade

* set default wormhole contract

* add all to stages to one file

* add extended chain config

* bug fix

* juno deployment

* removed unused parameter

* resolve bug add comments

* typo

* rename to vaa mainnet

* comment

* remove T

* hardcode checksum

* update download method comment

* update package-lock

* update package-json
2023-05-16 13:13:43 +05:30
Ali Behjati 1dbc592836
[eth] Fix oracle-swap example frontend bugs (#813)
* [eth] Fix oracle-swap example frontend bugs

* [eth] Fix build warnings

* remove test

* add passWithNoTests to amm example

---------

Co-authored-by: Daniel Chew <cctdaniel@outlook.com>
2023-05-11 12:53:50 +02:00
guibescos 71bab7a9fd
[evm] Make comment match the function below (#804)
* Make comment match the function below

* Fix precommit
2023-05-05 12:49:14 -05:00
Ali Behjati 1d59e9052b
[tilt] Fix issues (#801) 2023-05-05 15:31:57 +02:00
optke3 b609b17fdf
[sui 7/x] - contract upgrades, version control (#762)
* 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
2023-05-03 12:29:29 -04:00
Dev Kalra 079828f8ac
Wormhole stub (#789)
* add

* add sei to wormhole chains

* add wormhole code to the repo

* add lib to gitignore

* cosmwasm bug fix

* add tmp to gitignore

* no need for simulation

* add wormhole deployment stuff

* better comments

* resolve build errors

* trying a fix

* fix

* rename compiled code

* address feedback

* remove gitignore

* sei deployment

* complete sentences

* address comments
2023-05-03 20:48:00 +05:30
Ali Behjati f94dceb1bc
[eth] Add Pyth Accumulator (#776)
This PR adds the support WormholeMerkle accumulator message to the ethereum contract while still supporting the old message format. The code is not optimized yet and with more optimizations we can achieve a better gas usage. Currently based on the gas benchmark below it has a 18% improvement with a single price feed. Although the cost of updating 5 feeds in the same batch is higher than the current approach but in reality the chances that all 5 feeds be in the same batch is very low.
2023-05-03 16:08:53 +02:00
guibescos 71632fa848
[docs] improve oracle amm (#791)
* Add address to Polygon clontract and cleanup

* Add url

* Typo

* Typo

* Improve writing

* Add comma

* Fix precommit

* Revert package-lock.json
2023-05-02 09:41:50 -05:00
optke3 d8c69a63d0
[sui 6/x] - Pyth unit tests (#757)
* 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
2023-04-30 15:46:09 -04:00
optke3 f541ffa698
[sui 5/x] - Sui clock, error codes, fee computation (#740)
* 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
2023-04-30 15:39:02 -04:00
optke3 2bbeb03ca9
[sui 4/x] - governance modules, update to sui `0.29.0` (#732)
* 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
2023-04-28 15:28:09 -04:00
guibescos 3e5600508b
Fix axios bug by downgrading, bump all dependents (#786) 2023-04-28 10:19:40 -05:00
Dev Kalra 259f0124f1
[cosmwasm] wormhole stub (#770)
* docker file to build wormhole contracts

* move to wormhole stub

* add comment

* update readme
2023-04-20 16:22:06 +05:30
Dev Kalra ec65d3ca81
[cosmwasm] osmosis release (#767)
* update contract version

* update script to build for osmosis

* update pyth sdk cw version

* update release pipeline

* fix pipeline
2023-04-17 18:25:09 +05:30
Dev Kalra 15060d6a5e
[cosmwasm] Osmosis multiple fee token support (#763)
* osmosis txfee supoort

* add get update fee for denom

* query for tx fee support

* add fee checker

* add comment

* implement osmosis code

* correct err response

* fix bugs

* cargo update

* disable rust feature

* return bool instead of result

* add wormhole comment

* tests added

* address feedback

* improve comments

* cargo update
2023-04-14 12:19:57 +05:30
Jayant Krishnamurthy 91dfc36e85
Move cosmwasm sdk into standard tree structure (#761)
* move cosmos sdk into standard tree structure

* fix typo

---------

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-04-13 12:27:34 -07:00
Jayant Krishnamurthy c2484b1514
Gas usage experiments (#756)
* add gas usage experiments

* add proof verification

* extend existing contract

* update struct

* cleanup

* add threshold comparison

* ok this mostly works

* fix

* comment

* rename

* use rand utils
2023-04-11 07:07:45 -07:00
Dev Kalra 1371f18e84
add injective mainnet (#754) 2023-04-10 17:08:19 +05:30
Jayant Krishnamurthy 843a30c2c7
[solana] Add pre-commit for solana target chain contract (#753)
* precommit

* format
2023-04-09 19:38:29 -07:00
Ali Behjati 85b9c80e2a
[eth] Add Canto mainnet (#751)
* [eth] Add Canto mainnet

This deployment also enables contract rewards on canto. Since the
changed code is only specific to the Canto network and is used only
in initialization, only the diff is added as a file.

* Remove ds store

* Add some doc to deploying.md
2023-04-07 17:49:01 +02:00
Ali Behjati 71da520647
[eth] Deploy to Conflux eSpace (#748) 2023-04-07 16:23:20 +02:00
Dev Kalra 96c9e83e0f
[cosmwasm] Refactor deployer (#739)
* chain generic code

* pyth wrapper

* factory

* add calc fee and correct raw log

* add documentation

* rename method

* remove update fee  response

* add more documentation

* remove chain specific things

* minor tweak
2023-04-07 18:09:39 +05:30
Jayant Krishnamurthy c3b2322ac0
[solana receiver] Try solana signature verification builtin (#736)
* gr

* wtf

* wtf

* jfc

* jfc

* oh thank god

* make the test work

* cleanup

* cleanup
2023-04-05 10:44:45 -07:00
Ali Behjati 2db5a26752
[eth] Deploy to testnet Mantle (#742) 2023-04-04 13:34:32 +02:00
Ali Behjati 343091d788
[eth] Update ethereum js sdk readme (#738) 2023-04-04 10:04:12 +02:00
optke3 e4db9cac81
[sui 3/x]: events, dynamic fields, `update_price_feed`, `PriceInfoObject` (#714)
* 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
2023-03-31 13:43:39 -05:00
Ali Behjati 111b0fa09f
[eth] Deploy to meter (#731)
* [eth] Deploy to meter testnet

* Add mainnet
2023-03-31 18:51:18 +02:00
optke3 55bc1b95bb
[sui 2/x]: `state`, `batch_price_attestation`, `set` (#710)
* 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
2023-03-31 10:10:10 -05:00
Dev Kalra ccc2e33dee
update cleanup (#735) 2023-03-31 18:12:28 +05:30
Dev Kalra 299417396b
[cosmwasm] implement a build script (#733)
* implement a build script

* update readme
2023-03-31 12:50:35 +05:30
Dev Kalra 0b9f1f161d
[cosmwasm] implement contract version (#730)
* remove depreceated config

* add a contract version

* check valid instantiation

* up a version and generate schema

* update contract upgrade code
2023-03-30 22:35:53 +05:30
Cinque McFarlane-Blake 38a8c2831a
[evm] Deploy on Canto Testnet (#725)
* [evm] Deploy on Canto Testnet

* Redeploy

* Address feedbacks

---------

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2023-03-29 19:15:08 +02:00
Jayant Krishnamurthy 94f38fdd74
Fix JS workflow (#727) 2023-03-29 09:36:25 -07:00
Ali Behjati 272f11aac2
[eth] Redeploy shimmer testnet (#724) 2023-03-28 10:11:56 +02:00
Jayant Krishnamurthy 7dad38ea89
[evm] Deploy on Polygon ZkEVM mainnet (#723)
* [evm] Deploy on Polygon ZkEVM mainnet

* Trigger CI

* clippy

---------

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2023-03-27 08:18:09 -07:00
Ali Behjati 989ac4653a
Update .dockerignore (#722)
* Update .dockerignore

* Update .dockerignore + .gitignore

* Fix docker issue

* Update .dockerignore again

* Fix precommit
2023-03-27 16:44:08 +02:00
Jayant Krishnamurthy c45664c951
[evm] Polygon ZKEVM deployment (#711)
* gr

* doc

* add zkevm deployment

* gr

* zkevm deployment

* add zkevm testnet
2023-03-22 13:04:47 -07:00
Jayant Krishnamurthy e995a2b89e
Add CI workflow to publish javascript packages (#707)
* workflows

* try private

* private

* more private

* update files

* fix workflow

* hm

* hm

* bump version

* bump version

* another bump

* text

* update readme

* update package lock
2023-03-21 12:25:30 -07:00
optke3 cbcc294017
sui: integration start, set up dependencies, copy over modules from Pyth-Aptos (#706)
* start

* move over initial contracts from aptos

* newline Move.toml
2023-03-21 09:58:29 -05:00
Jayant Krishnamurthy 9fef120b1f
[sdk] Move Solidity sdk into this repo (#674)
* fix dependencies

* wtf

* remove redundant pre-commit

* some sort of lerna issue

* fix dockerfile
2023-03-20 12:25:28 -07:00
guibescos d06c10502d
[evm] Verifying shimmer_testnet and neon_devnet with hardhat (#703)
* Add shimmer testnet and neon_devnet

* zksync comment

* Add verify
2023-03-17 09:47:59 -05:00
Ali Behjati fc0de28b86
[eth] Update zksync goerli after network reset (#697) 2023-03-16 09:36:13 +01:00
Jayant Krishnamurthy 04a8b75f80
add docs (#690)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-03-15 07:25:01 -07:00
guibescos 156fb23f24
[evm] deploy neon devnet (#693)
* add evmos_testnet deployment files

* fix precommit

* Deploy to neon

* Precommit

* Add to evm-js

* Fix precommit

---------

Co-authored-by: Daniel Chew <cctdaniel@outlook.com>
2023-03-14 22:48:46 -05:00
Dev Kalra 93ca9c427a
migration logic (#687) 2023-03-14 14:58:57 +05:30
Daniel Chew de0096efd4
[eth] add evmos mainnet (#686)
* add evmos mainnet

* add evmos to sdk
2023-03-14 18:12:49 +09:00
Daniel Chew 533181cc80
[eth] add evmos testnet (#683)
* add evmos_testnet deployment files

* fix precommit

* fix precommit

* bump
2023-03-14 14:11:23 +09:00
Dev Kalra 3e104b4184
[cosmwasm] address audit (#685)
* remove todos

* add governance source index check

* bumb pyth-sdk-cw version
2023-03-14 00:18:19 +05:30
Yunhao Zhang b6fcb03d6b
[solana] A working solana receiver program (#632)
* A working version of solana receiver

* Cleanup

* Minor

* Commit for triggering tilt

* Add program key starting with pyth

* Remove duplicated hard-coded wormhole address

* Add check for VAA magic number and emmitter is Pythnet or Solana

* Cleaner command for building the cli package

* Fix bug and use BatchPriceAttestation for deserialization

* minor
2023-03-13 12:45:51 -05:00
Dev Kalra 8ff1ada6dc
[cosmwasm] Injective cosmwasm (#680)
* update process_batch_attestation

* add type to Response

* add injective's support

* add cfg feature

* compilation feature flag

* change price status to pyth status

* update README

* update injective's struct
2023-03-13 15:30:48 +05:30
Ali Behjati 085f08055a
[eth] Add zksync mainnet (#682)
* [eth] Add zksync mainnet

Also adds verify url for shimmer testnet

* Bump client version

* Update dummy value
2023-03-13 09:12:46 +01:00
Ali Behjati 1771a8a98a
[eth] Add new testnets (#669)
- Add chiado (gnosis testnet) and shimmer testnet
- Add chiado and shimmer_testnet and base_goerli addr to js sdk
2023-03-08 10:01:05 +01:00
Ali Behjati 70c006176b
Add base goerli config (#668) 2023-03-08 09:48:24 +01:00
Jayant Krishnamurthy bab6cccbad
add getPrice call to example (#666) 2023-03-07 06:36:42 -08:00
Dev Kalra 16ac58539e
[pyth-cosmwasm] sec review update (#649)
* remove owner

* address sec review feedback

* update storage for pricefeeds

* deprecate owner

* remove owner field
2023-03-03 20:11:15 +05:30
Jayant Krishnamurthy deb804617b
add an example for benchmarks (#647) 2023-03-01 12:34:32 -08:00
Jayant Krishnamurthy 66783e5ef1
add docs for audit (#645)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-03-01 08:29:12 -08:00
Jayant Krishnamurthy b9430aee81
[sdk] Add new SDK packages to lerna (#630) 2023-02-28 09:14:52 +01:00
Jayant Krishnamurthy bbe10ba553
[sdk] Move JS sdks into this repo (#611)
* move files to subdir and js sdk here

* update pointer

* fix move

* delete lib

* fix this

* gitignore

* aptos sdk

* gitignore

* terra js

* gitignore

* move price pusher

* add lib to gitignore

* move examples

* fix workflow

* gr

* contracts

* hm

* fix

* gr

* grrr

* fix dockerfile

* wtf

* fix
2023-02-22 13:44:42 -08:00
Stanisław Drozd 8e11caa1ee
Bump wormhole rust crates to v2.14.8, remove rent adjustment (#601)
This change upgrades our wormhole dependency to the current latest
release. It introduces a fix in rent calculation logic, making Solitaire compatible with
PythNet. This lets us get rid of dedicated rent adjustment logic,
which we also remove in this change.
2023-02-20 11:06:57 +01:00
Yunhao Zhang 16caff1b04
[solana] Start to implement the solana receiver contract (#557)
* Start to implement the solana receiver contract

* Use "cargo run" instead of the compiled binary under target/debug

* Update cargo dependency

* Add "pyth-" prefix to crate names

* Remove the transfer step in cli which is only necessary for pythnet, not solana
2023-02-15 15:43:51 +00:00
Dev Kalra 40e42a5b21
[cosmwasm] pyth-sdk-cw update version v1.0.0 (#595)
* update version

* update contract version
2023-02-14 20:22:14 +05:30
Dev Kalra d95c9247a2
[cosmwasm] Release setup (#594)
* update comment

* add a workflow

* update contracts readme

* add readme to pyth-sdk-cw
2023-02-14 15:28:31 +05:30
Dev Kalra 6daeb88244
[cosmwasm] Update example contract (#593)
* consume pyth-sdk-cw

* use helper queriers

* expose UnixTimestamp

* add testing examples
2023-02-14 14:55:42 +05:30
Dev Kalra c59c00333a
add query helper functions (#587) 2023-02-13 22:50:38 +05:30
Dev Kalra 66a46dd488
add testing module (#585) 2023-02-13 22:05:58 +05:30
Dev Kalra 62083eb6d6
[cosmwasm] Move data structures to pyth-sdk-cw (#578)
* pyth-sdk-cw add data structures

* consume pyth-sdk-cw data structure

* pre commit hooks
2023-02-11 00:23:24 +05:30
Dev Kalra 7f991bbdbc
[cosmwasm] pyth-sdk-cw (#575)
* pyth-sdk-cw

* update contract to use pyth-sdk-cw

* update schema

* update tilt config

* pre commit hooks

* remove raw schema
2023-02-10 22:48:09 +05:30