Commit Graph

150 Commits

Author SHA1 Message Date
Mohammad Amin Khashkhashi Moghaddam 175dfef5bd
Deploy to the latest shimmer testnet (#1001) 2023-08-02 16:59:39 +01:00
Mohammad Amin Khashkhashi Moghaddam ce86586744
Make aptos abi backward compatible (#999)
In our previous release this function was an entry function by mistake.
Now in order to keep our abi backward compatible, we need to keep it as entry function.
In order to allow the newer aptos cli to ignore this issue, we decorate it with `legacy_entry_fun`
2023-08-02 10:48:15 +01:00
Mohammad Amin Khashkhashi Moghaddam ce66a36415
Revert aptos address change (#998) 2023-08-01 16:47:36 +01:00
Mohammad Amin Khashkhashi Moghaddam 1d5a96c35a
[aptos] New address for aptos deployments and some small improvements (#996)
* Add abi diff command and small documentation fix

* Redeploy aptos package and update the address
2023-08-01 07:36:52 +01:00
Mohammad Amin Khashkhashi Moghaddam 2782c6bf64
[aptos] Aptos cleanup (#994)
* Better errors

* Better variable typing

* Upgrade cli with more straightforward flow

* Remove unnecessary configs and distinguish between deployer contract and signer

* Convert the named-addresses argument to 3 separate options with default values

* Add README
2023-07-31 11:43:58 +01:00
Mohammad Amin Khashkhashi Moghaddam 7674a3a07c
[docs] More documentation on different packages (#992)
* More documentation on different packages
2023-07-28 17:11:29 +01:00
Ali Behjati 928027a270
chore(ethereum): deploy to base and syndr_testnet (#988) 2023-07-27 16:16:45 +03:30
Mohammad Amin Khashkhashi Moghaddam 92b295bd7a
[contract-manager] Cosmwasm contracts (#986)
* Add stable testnet contracts

* Fix bug in creating InjectiveExecutor from mnemonic

* Import only from root library

* Code verification on proposals for cosmwasm

* Minimal script to upload wasm codes

* Use the netwrok parameter for InjectiveChain executor instead of endpoints
2023-07-27 14:36:16 +02:00
Mohammad Amin Khashkhashi Moghaddam ea37f6aab5
Add injective executor logic and contracts and getVersion utility function (#983) 2023-07-25 17:37:47 +02:00
Dev Kalra 7cd9ec7e03
[cosmwasm] bump version (#977)
* bump version

* pre commit fix
2023-07-25 18:49:31 +05:30
Mohammad Amin Khashkhashi Moghaddam 741f763375
Fix mainnet values on fuji and chiado and remove oasis network (#979) 2023-07-25 11:31:45 +03:30
Mohammad Amin Khashkhashi Moghaddam 31ad2b66a3
[contract-manager] Evm upgrades (#971)
* Add evm contract infos + minor improvements

* Throw error if chainId is invalid instead of using 0 silently

* Add wormholeChainName property for chains to use in governance actions

* Return all signatures upon proposal execution

* Unify privateKey schema for contract manager

* Implement getLastExecutedGovernanceSequence for all contract types

* Unify getPriceFeed interface between contracts

* Add update price feed for evm

* Adjust gasPrice on evm

* Add setter for datasources + add global chain for universal governance instructions

* Add utility function to execute arbitrary governance Vaa

* Remove redundant contract

* Better error message when gas is not enough on deployment

* Add aptos mainnet config

* Restore sui override of setFee governance message generation

* Export executeVaa function

* Address PR feedbacks

* More documentation and cleanup

* Remove INFURA_KEY logic and replace RPC endpoints with public ones

* EVMContract -> EvmContract, EVMChain -> EvmChain

* Make executeUpdatePriceFeed interface on cosmos similar to evm

* Better error message and more comment regarding gas
2023-07-25 08:14:31 +02:00
Mohammad Amin Khashkhashi Moghaddam 4660026009
Remove osmosis testnet 4 as it is deprecated and we already have testnet 5 (#974) 2023-07-24 19:37:55 +09:00
Mohammad Amin Khashkhashi Moghaddam 49fbd2f121
Pin wormhole dependency in aptos to a revision which has pinned the AptosStdLib dependency (#962) 2023-07-19 08:38:37 +02:00
Ali Behjati e63490be48
[eth] Add EOS network (#963) 2023-07-18 23:00:47 +03:30
Ali Behjati dcec1e9328
[eth] Finalize accumulator contract (#960) 2023-07-18 12:57:29 +03:30
Mohammad Amin Khashkhashi Moghaddam 9bdc493ce6
Update evm chain and contract configs (#961)
Remove ropsten and shimmer_testnet network as they are deprecated
Provide neon rpc url as it is not private anymore
2023-07-18 10:36:26 +02:00
Mohammad Amin Khashkhashi Moghaddam 6f8fa11b20
Fix README.md for prettier (#959) 2023-07-17 16:42:03 +02:00
Ali Behjati c86e4f2610
[eth] Add linea (#956)
* [eth] Add linea

* Fix pre-commit
2023-07-17 17:51:22 +03:30
Mohammad Amin Khashkhashi Moghaddam c732fcf586
Abolish xc governance sdk (#957)
* Replace xc-governance-sdk with xc_admin_common package

xc_admin_package was not using the CHAIN overrides declared in the governance-sdk so it was moved
to that package as well

* Replace xc-governance-sdk with xc_admin_common in other packages

* Remove the package and all of its references

* Fix tests

* Fix bug in GovernanceDataSourceTransfer encoding

* Rename all references to the old package

* Redeploy neutron_testnet contract with new chain id

* Move SetWormholeAddress to separate file
2023-07-17 15:24:54 +02:00
Mohammad Amin Khashkhashi Moghaddam b64090aa75
Update README.md (#958) 2023-07-17 15:23:16 +02:00
Jayant Krishnamurthy aa76c15d1c
Log sui errors (#951)
* log sui errors

* fix precommit
2023-07-13 15:41:29 -07:00
optke3 e3fe85c312
[Sui 18/x] - governance action tests (#949)
* on-chain tests for governance actions

* edit name

* edit

* remove governance data source test that is not working

* edit comment
2023-07-12 12:47:45 -04:00
Mohammad Amin Khashkhashi Moghaddam eddb789134
Restore accidentally removed file (#950) 2023-07-12 16:12:57 +02:00
Mohammad Amin Khashkhashi Moghaddam 66e5f186b2
Initial version of contract manager sdk (#943)
* Initial version of governance sdk

* Add more functionality to Sui contract manager and migrate variable naming to camelCase

* Refactor sui functions

* Add prettier

* Add SuiAuthorizeUpgradeContractInstruction for governance

* Update cosmwasm deploy tools entry point and expose some classes

* Remove console.logs from CosmWasm

* Refactor storage logic and add sui docs

* Use relative path for default path of store

* More documentation and minor fixes

* Rename package

* Add EVM classes

* Implement getters for data sources

* Use Google naming convention for abbreviations

More info here:
https://google.github.io/styleguide/tsguide.html#identifiers-abbreviations

* Change package license

* More comments and documentation

* Store code proxy function in CosmWasm
2023-07-12 15:50:24 +02:00
guibescos a77ee78d13
[eth] Deploy to mantle (#948)
* Deploy mantle

* Update pyth-evm-ks

* Update docs
2023-07-12 14:18:56 +01:00
Daniel Chew 8752291aa2
fix broken links (#945)
* fix broken links

* undo import order changes

* Fix more links

* Fix more broken links

* Fix more broken links

* Fix more broken links

* Fix precommit

---------

Co-authored-by: Thomaz Leite <thomaz@pyth.network>
Co-authored-by: Guillermo Bescos <g.bescos@yahoo.com>
2023-07-11 11:41:43 +01:00
Ali Behjati 2a4045504d
[eth] Add Linea goerli network (#947)
* [eth] Add Linea goerli network

* Add linea_testnet to eth/sdk/js
2023-07-11 11:15:22 +01:00
optke3 0ec7b69031
[Sui 15/x] - Pyth upgrade script + bug fix (#936)
* 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
2023-07-10 09:43:27 -04:00
optke3 2c334b6b92
[sui 16/x] - update imports (#942)
* update some script imports

* another one

* remove @optke3/sui.js from dependencies
2023-07-07 11:17:29 -04:00
Ali Behjati bef4073b54
[price-service/client] Crash by default on WsError (#934)
* [price-service/client] Crash by default on WsError

* Update docker-compose files

* Update package versions again
2023-07-07 11:43:04 +03:30
Sturdy 4f41525a2f
fix: Use generic_err constructor instead of literal (#941)
* fix: Use generic_err constructor instead of literal

* bump version

---------

Co-authored-by: Jayant Krishnamurthy <jayantkrishnamurthy@gmail.com>
2023-07-06 11:02:32 -07:00
swimricky ac97b4d35d
[eth] - Aave FallbackOracle Integration (#924)
* feat(eth): aave integration

Add IPriceOracleGetter and PythAssetRegistry mapping

* feat(eth): remove IPriceOracleGetter from PythAssetRegistryGetter

* refactor(eth): flatten PythAssetRegistySetter/Getter into PythAssetRegistry

* feat(eth): address feedback

move aave related contracts into separate directory, add explicit exponent/decimal handling, add
staleness check

* refactor(eth): minor rename to avoid shadowing

* fix(eth): handle exponent conversion and add tests

* chore(eth): remove unused console import

* feat(eth): address PR feedback

add more checks, tests & minor refactoring

* feat(eth): add more tests and address feedback
2023-07-06 08:29:08 -04:00
Ali Behjati aa0e6fdf22
[eth] Add WEMIX network (#940)
* [eth] Add WEMIX network

* Fix pre-commit

* Remove unnecessary change

* Fix prettier

---------

Co-authored-by: Guillermo Bescos <g.bescos@yahoo.com>
2023-07-05 18:15:43 +01:00
Mohammad Amin Khashkhashi Moghaddam 14fd210a16
[sui] More documentation on sui (#938) 2023-07-04 15:24:38 +02:00
Mohammad Amin Khashkhashi Moghaddam 9d2d673d01
[WIP] Finalize SUI contracts and make it backward compatible (#935)
* 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>
2023-07-04 09:40:32 +02:00
Mohammad Amin Khashkhashi Moghaddam 3170e3fc92
[sui] Simplify some tests and add more (#933)
* 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>
2023-07-03 14:45:22 +02:00
optke3 fb1a35af76
[sui 12/x] - updates to pyth accumulator and merkle tree (#926)
* 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
2023-06-30 12:02:38 -05:00
optke3 5e064b0a30
[sui 14/x] - PyCharm Move linter (#928)
* linting stuff

* more linting

* more linting
2023-06-30 12:02:20 -05:00
Mohammad Amin Khashkhashi Moghaddam e5fd5a9d81
[target_chains] Add deployment information for neutron mainnet (#930)
* Deploy pyth cosmwasm 1.2.0 contract to neutron mainnet
2023-06-30 14:33:25 +02:00
Ryu 5e44fa4c95
[price_service] js client: getPriceFeed() (#922)
* [price_service] js client: getPriceFeed()

* Fix pre-commit

* Bump package versions

---------

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2023-06-28 18:28:37 +02:00
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