Skip to content
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

Contract manager upgrades #952

Merged
merged 14 commits into from
Jul 14, 2023
Merged

Contract manager upgrades #952

merged 14 commits into from
Jul 14, 2023

Conversation

m30m
Copy link
Collaborator

@m30m m30m commented Jul 13, 2023

No description provided.

@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Jul 14, 2023 9:04am
xc-admin-frontend ⬜️ Ignored (Inspect) Jul 14, 2023 9:04am

Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! Overall looks great. I left you some minor comments about code structure, but feel free to merge and address later.

contract_manager/examples/deploy_cosmwasm.ts Outdated Show resolved Hide resolved
contract_manager/src/aptos.ts Outdated Show resolved Hide resolved
contract_manager/src/aptos.ts Show resolved Hide resolved
* @param sender based on the contract type, this can be a private key, a mnemonic, a wallet, etc.
* @param vaa the VAA to execute
*/
abstract executeGovernanceInstruction(sender: any, vaa: Buffer): Promise<any>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sender any concerns me a bit, as it's going to be confusing what info to provide where. A simple solution would be to make a type that contains the union of all private key information needed by any chain, then pass that here.

* @param fee the new fee to set
* @param exponent the new fee exponent to set
*/
generateGovernanceSetFeePayload(fee: number, exponent: number): Buffer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these governance payload methods on Chain? these are really operations that apply to specific contracts, even though the identification of those contracts is somewhat imprecise because it's using chain id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also a bit on the fence on where to put these. Putting them in the contract classes gives a false sense that it can only be executed on that specific contract whereas it can be executed on any contract deployed on that chain (as long as the governance data source matches). Also, I'm planning to add a GlobalChain with id 0 for global messages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun fact, in aptos and sui, the target chain id is the same for testnet/mainnet!

contract_manager/src/entities.ts Outdated Show resolved Hide resolved
contract_manager/src/entities.ts Outdated Show resolved Hide resolved
contract_manager/src/evm.ts Outdated Show resolved Hide resolved
import { Chains, CosmWasmChain } from "../src/chains";
import { CosmWasmContract } from "../src/cosmwasm";
import { DefaultStore } from "../src/store";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be helpful for me to see an example for running a governance action also, as the flow is a little different.

m30m added 5 commits July 14, 2023 09:38
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.
@m30m
Copy link
Collaborator Author

m30m commented Jul 14, 2023

Thanks for the comments. Addressed most of them. The rest would be on a different PR.

@m30m m30m merged commit 6c52eb6 into main Jul 14, 2023
4 checks passed
@m30m m30m deleted the contract-manager-upgrades branch July 14, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants