Commit Graph

7 Commits

Author SHA1 Message Date
Mohammad Amin Khashkhashi Moghaddam b189937365
[sui] Sui dx improvement (#1011)
* 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
2023-08-15 17:56:43 +02:00
Mohammad Amin Khashkhashi Moghaddam 272f3c1984
[contract-manager] Contract manager improvements (#1000)
* Use arrays instead of separate files per config

* Remove redundant endpoint on cosmwasm

* Add functions for upgrading the wormhole guardian sets

* Add wormhole contract management on evm and cosmwasm

* Add getter functions to check what sort of wormhole-deployment is used

* Reorganize contract manager package to be used via other packages

* Remove .env files per network and create a script that outputs the same file

* Use env variables in truffle config and output config in deployments

* Add executeUpdatePriceFeed to contract interface

* Add update pricefeed script

* Add saving functionality to store

* Save new contract configs automatically on Evm

* Make deploy script use the create-env.js internally

* Add utility function to get implementation address for Evm Proxy contracts

* Add shimmer testnet and replace evmos nunfunctional rpc

* New procedure for contract verification

* Update docs and remove duplicate configurations

* Remove shimmer configs

* Read default data source configs via contract manager

* Remove flattened contract before compiling/deploying
2023-08-07 14:13:29 +02:00
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 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 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 6c52eb6606
Contract manager upgrades (#952)
* Reuse xc_governance logic as much as possible in contract manager

Some functions in xc_governance were moved and refactored in order to become usable in
contract manager

* Add getBaseUpdateFee function for contract manager

* Add method for executeGovernanceInstructions

* Move up SetFee method to base class

* Add governance upgrade instruction

* Move governance payload generators out of contract classes into chain classes

* Switch from json to yaml for storage

* Remove test script for ci

* Add minimal aptos implementation

* Remove global Chains and Contracts variable and put them in DefaultStore

* Move aptos getClient function to Chain class

* Make denom field in baseUpdateFee optional and remove it from non-cosmwasm chains

* More documentation and minor fixes

* Add vaults storage

Although the set of vaults used in testing/production is just 2 it's a good idea to
not set them as predefined constants. So that for development purposes, we can create
new vaults and test them on the fly without changing too many places.
2023-07-14 12:14:24 +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