diff --git a/chain/cosmos/base.go b/chain/cosmos/base.go new file mode 100644 index 000000000..637533c16 --- /dev/null +++ b/chain/cosmos/base.go @@ -0,0 +1,227 @@ +package cosmos + +import ( + "context" + "encoding/json" + "fmt" + "log" + "strconv" + + "github.com/strangelove-ventures/interchaintest/v8/examples/cosmwasm/external_contracts/daodaocore" + "github.com/strangelove-ventures/interchaintest/v8/ibc" + "github.com/strangelove-ventures/interchaintest/v8/testreporter" +) + +func (c *CosmosChain) SetupDAODAO(ctx context.Context, ibcPath string, keyName string) (any, error) { + daoProposalSingleCodeID, err := c.StoreContract(ctx, keyName, "../../../external_contracts/daodao/dao_proposal_single.wasm") + if err != nil { + return nil, err + } + + propCodeID, err := strconv.Atoi(daoProposalSingleCodeID) + if err != nil { + return nil, err + } + + votingTokenStakedCodeID, err := c.StoreContract(ctx, keyName, "../../../external_contracts/daodao/dao_voting_token_staked.wasm") + if err != nil { + return nil, err + } + + userAddrBz, err := c.GetAddress(ctx, keyName) + if err != nil { + return nil, err + } + userAddr := string(userAddrBz) + + coreInitMsg := daodaocore.InstantiateMsg{ + ImageUrl: nil, + InitialItems: []daodaocore.InitialItem{}, + Name: "V2_DAO", + ProposalModulesInstantiateInfo: []daodaocore.ModuleInstantiateInfo{ + { + Admin: &daodaocore.Admin{ + Address: nil, + CoreModule: &daodaocore.Admin_CoreModule{}, + }, + CodeId: propCodeID, + Funds: []daodaocore.Coin{}, + Label: "v2_dao", + Msg: "", + }, + }, + VotingModuleInstantiateInfo: daodaocore.ModuleInstantiateInfo{}, + AutomaticallyAddCw721S: true, + AutomaticallyAddCw20S: true, + DaoUri: nil, + Description: "V2_DAO", + Admin: &userAddr, + } + + initMsg, err := json.Marshal(coreInitMsg) + + if err != nil { + return nil, err + } + + daoCore, err := c.UploadAndInstantiateContract(ctx, keyName, "../../../external_contracts/daodao/dao_dao_core.wasm", + string(initMsg), "daodao_core", true, + ) + if err != nil { + return nil, err + } + + log.Println(daoProposalSingleCodeID, votingTokenStakedCodeID, daoCore) + + return nil, nil +} + +func (c *CosmosChain) SetupPolytone( + ctx context.Context, + r ibc.Relayer, + eRep *testreporter.RelayerExecReporter, + ibcPath string, + keyName string, + destinationChain *CosmosChain, + destinationKeyName string, +) (*PolytoneInstantiation, error) { + note, listener, err := c.SetupPolytoneSourceChain(ctx, keyName, destinationChain.Config().ChainID) + if err != nil || note == nil || listener == nil { + return nil, err + } + + voice, err := destinationChain.SetupPolytoneDestinationChain(ctx, destinationKeyName, c.Config().ChainID) + if err != nil || voice == nil { + return nil, err + } + + channelId, err := c.FinishPolytoneSetup(ctx, r, eRep, ibcPath, note.ContractInfo.IbcPortID, voice.ContractInfo.IbcPortID, destinationChain.Config().ChainID) + if err != nil { + return nil, err + } + + return &PolytoneInstantiation{ + Note: *note, + Listener: *listener, + Voice: *voice, + ChannelID: channelId, + }, nil +} + +func (c *CosmosChain) SetupPolytoneDestinationChain(ctx context.Context, keyName string, sourceChainId string) (*ContractInfoResponse, error) { + + var blockGasLimit uint64 + queriedLimit, err := c.GetBlockGasLimit(ctx) + if err != nil { + return nil, err + } + + if queriedLimit == nil { + // Default to 100M gas limit + blockGasLimit = uint64(100_000_000) + } else { + blockGasLimit = *queriedLimit + } + + proxyCodeID, err := c.StoreContract( + ctx, + keyName, + "../../../external_contracts/polytone/v1.0.0/polytone_proxy.wasm") + + if err != nil { + return nil, err + } + + voice, err := c.UploadAndInstantiateContract(ctx, keyName, + "../../../external_contracts/polytone/v1.0.0/polytone_voice.wasm", + fmt.Sprintf("{\"proxy_code_id\":\"%s\", \"block_max_gas\":\"%d\"}", proxyCodeID, blockGasLimit), + fmt.Sprintf("polytone_voice_from_%s", sourceChainId), + true) + + if err != nil { + return nil, err + } + + return voice, nil + +} + +func (c *CosmosChain) SetupPolytoneSourceChain(ctx context.Context, keyName string, destinationChainId string) (*ContractInfoResponse, *ContractInfoResponse, error) { + var blockGasLimit uint64 + queriedLimit, err := c.GetBlockGasLimit(ctx) + if err != nil { + return nil, nil, err + } + + if queriedLimit == nil { + // Default to 100M gas limit + blockGasLimit = uint64(100_000_000) + } else { + blockGasLimit = *queriedLimit + } + + // Upload the note contract- it emits the ibc messages + note, err := c.UploadAndInstantiateContract(ctx, keyName, + "../../../external_contracts/polytone/v1.0.0/polytone_note.wasm", + fmt.Sprintf(`{"block_max_gas":"%d"}`, blockGasLimit), + fmt.Sprintf("polytone_note_to_%v", destinationChainId), + true) + + if err != nil { + return nil, nil, err + } + + // Upload the listener contract- it listens for the ibc messages + listener, err := c.UploadAndInstantiateContract(ctx, keyName, + "../../../external_contracts/polytone/v1.0.0/polytone_listener.wasm", + fmt.Sprintf("{\"note\":\"%s\"}", note.Address), + fmt.Sprintf("polytone_listener_from_%v", destinationChainId), + true) + + if err != nil { + return nil, nil, err + } + + return note, listener, nil +} + +func (c *CosmosChain) FinishPolytoneSetup(ctx context.Context, r ibc.Relayer, eRep *testreporter.RelayerExecReporter, ibcPath string, notePortId string, voicePortId string, destChainId string) (string, error) { + + // Create the channel between the two contracts + err := r.CreateChannel(ctx, eRep, ibcPath, ibc.CreateChannelOptions{ + SourcePortName: notePortId, + DestPortName: voicePortId, + Order: ibc.Unordered, + Version: "polytone-1", + }) + if err != nil { + return "", err + } + + err = r.StopRelayer(ctx, eRep) + if err != nil { + return "", err + } + + err = r.StartRelayer(ctx, eRep) + if err != nil { + return "", err + } + + channelsInfo, err := r.GetChannels(ctx, eRep, c.Config().ChainID) + if err != nil { + return "", err + } + + channelId := channelsInfo[len(channelsInfo)-1].ChannelID + + return channelId, nil + +} + +type PolytoneInstantiation struct { + Note ContractInfoResponse + Listener ContractInfoResponse + Voice ContractInfoResponse + ChannelID string +} diff --git a/chain/cosmos/chain_node.go b/chain/cosmos/chain_node.go index d426417e0..43ac0d478 100644 --- a/chain/cosmos/chain_node.go +++ b/chain/cosmos/chain_node.go @@ -144,7 +144,7 @@ func (tn *ChainNode) NewClient(addr string) error { tn.Client = rpcClient - grpcConn, err := grpc.Dial( + grpcConn, err := grpc.NewClient( tn.hostGRPCPort, grpc.WithTransportCredentials(insecure.NewCredentials()), ) if err != nil { @@ -1046,6 +1046,20 @@ func (tn *ChainNode) QueryBankMetadata(ctx context.Context, denom string) (*Bank return &meta, nil } +// QueryConsensusParams returns the consensus parameters of the chain. +func (tn *ChainNode) QueryConsensusParams(ctx context.Context) (*ConsensusParamsResponse, error) { + stdout, _, err := tn.ExecQuery(ctx, "consensus", "params") + if err != nil { + return nil, err + } + var params ConsensusParamsResponse + err = json.Unmarshal(stdout, ¶ms) + if err != nil { + return nil, err + } + return ¶ms, nil +} + func (tn *ChainNode) ExportState(ctx context.Context, height int64) (string, error) { tn.lock.Lock() defer tn.lock.Unlock() diff --git a/chain/cosmos/cosmos_chain.go b/chain/cosmos/cosmos_chain.go index 75287c3f6..40c61d23c 100644 --- a/chain/cosmos/cosmos_chain.go +++ b/chain/cosmos/cosmos_chain.go @@ -128,7 +128,6 @@ func (c *CosmosChain) WithPreStartNodes(preStartNodes func(*CosmosChain)) { c.preStartNodes = preStartNodes } - // GetCodec returns the codec for the chain. func (c *CosmosChain) GetCodec() *codec.ProtoCodec { return c.cdc @@ -544,6 +543,26 @@ func (c *CosmosChain) InstantiateContract(ctx context.Context, keyName string, c return c.getFullNode().InstantiateContract(ctx, keyName, codeID, initMessage, needsNoAdminFlag, extraExecTxArgs...) } +// UploadAndInstantiateContract uploads a contract and then instantiates it immediately. Returns both the code id and the new address. +func (c *CosmosChain) UploadAndInstantiateContract(ctx context.Context, keyName string, fileName string, initMessage string, label string, needsNoAdminFlag bool, extraExecTxArgs ...string) (*ContractInfoResponse, error) { + codeID, err := c.StoreContract(ctx, keyName, fileName) + if err != nil { + return nil, err + } + + contractAddress, err := c.getFullNode().InstantiateLabeledContract(ctx, keyName, codeID, initMessage, label, needsNoAdminFlag, extraExecTxArgs...) + if err != nil { + return nil, err + } + + contractInfo, err := c.QueryContractInfo(ctx, contractAddress) + if err != nil { + return nil, err + } + + return contractInfo, err +} + // ExecuteContract executes a contract transaction with a message using it's address. func (c *CosmosChain) ExecuteContract(ctx context.Context, keyName string, contractAddress string, message string, extraExecTxArgs ...string) (res *types.TxResponse, err error) { return c.getFullNode().ExecuteContract(ctx, keyName, contractAddress, message, extraExecTxArgs...) @@ -559,6 +578,11 @@ func (c *CosmosChain) QueryContract(ctx context.Context, contractAddress string, return c.getFullNode().QueryContract(ctx, contractAddress, query, response) } +// NullableQueryContract performs a smart query, taking in a query struct and returning a error with the response struct possibly populated. If the query returned null the response will be nil. +func (c *CosmosChain) NullableQueryContract(ctx context.Context, contractAddress string, query any, response any) error { + return c.getFullNode().NullableQueryContract(ctx, contractAddress, query, response) +} + // DumpContractState dumps the state of a contract at a block height. func (c *CosmosChain) DumpContractState(ctx context.Context, contractAddress string, height int64) (*DumpContractStateResponse, error) { return c.getFullNode().DumpContractState(ctx, contractAddress, height) @@ -596,6 +620,23 @@ func (c *CosmosChain) GetGasFeesInNativeDenom(gasPaid int64) int64 { return int64(math.Ceil(fees)) } +// GetBlockGasLimit returns the gas limit for a block on the chain. +func (c *CosmosChain) GetBlockGasLimit(ctx context.Context) (*uint64, error) { + consensus_params, err := c.ConsensusQueryParams(ctx) + if err == nil { + max_gas_limit := consensus_params.Params.Block.MaxGas + // the chain only has a block gas limit if it's not set to -1 + if max_gas_limit > -1 { + var gas_limit = uint64(max_gas_limit) + return &gas_limit, nil + } else { + return nil, nil + + } + } + return nil, err +} + func (c *CosmosChain) UpgradeVersion(ctx context.Context, cli *client.Client, containerRepo, version string) { c.cfg.Images[0].Version = version for _, n := range c.Validators { diff --git a/chain/cosmos/module_consensus.go b/chain/cosmos/module_consensus.go new file mode 100644 index 000000000..e2a4301ec --- /dev/null +++ b/chain/cosmos/module_consensus.go @@ -0,0 +1,13 @@ +package cosmos + +import ( + "context" + + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" +) + +// ConsensusQueryParams queries the chain consensus parameters via grpc. +func (c *CosmosChain) ConsensusQueryParams(ctx context.Context) (*consensustypes.QueryParamsResponse, error) { + res, err := consensustypes.NewQueryClient(c.GetNode().GrpcConn).Params(ctx, &consensustypes.QueryParamsRequest{}) + return res, err +} diff --git a/chain/cosmos/module_cosmwasm.go b/chain/cosmos/module_cosmwasm.go index 4940471ec..094cce849 100644 --- a/chain/cosmos/module_cosmwasm.go +++ b/chain/cosmos/module_cosmwasm.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "encoding/json" "fmt" + "log" "os" "path" "path/filepath" @@ -77,7 +78,12 @@ func (tn *ChainNode) StoreContract(ctx context.Context, keyName string, fileName // InstantiateContract takes a code id for a smart contract and initialization message and returns the instantiated contract address. func (tn *ChainNode) InstantiateContract(ctx context.Context, keyName string, codeID string, initMessage string, needsNoAdminFlag bool, extraExecTxArgs ...string) (string, error) { - command := []string{"wasm", "instantiate", codeID, initMessage, "--label", "wasm-contract"} + return tn.InstantiateLabeledContract(ctx, keyName, codeID, initMessage, "wasm-contract", needsNoAdminFlag, extraExecTxArgs...) +} + +// InstantiateContract takes a code id for a smart contract and initialization message and returns the instantiated contract address. +func (tn *ChainNode) InstantiateLabeledContract(ctx context.Context, keyName string, codeID string, initMessage string, label string, needsNoAdminFlag bool, extraExecTxArgs ...string) (string, error) { + command := []string{"wasm", "instantiate", codeID, initMessage, "--label", label} command = append(command, extraExecTxArgs...) if needsNoAdminFlag { command = append(command, "--no-admin") @@ -138,6 +144,7 @@ func (tn *ChainNode) QueryContract(ctx context.Context, contractAddress string, if q, ok := queryMsg.(string); ok { var jsonMap map[string]interface{} + log.Println("Querying contract with string query: ", queryMsg, jsonMap) if err := json.Unmarshal([]byte(q), &jsonMap); err != nil { return err } @@ -161,6 +168,51 @@ func (tn *ChainNode) QueryContract(ctx context.Context, contractAddress string, return err } +// NullableQueryContract performs a smart query, taking in a query struct and returning a error with the response struct populated. +// This should be used when the contract is returning an Option value. +func (tn *ChainNode) NullableQueryContract(ctx context.Context, contractAddress string, queryMsg any, response any) error { + var query []byte + var err error + + if q, ok := queryMsg.(string); ok { + var jsonMap map[string]interface{} + log.Println("Querying contract with string query: ", queryMsg, jsonMap, q) + log.Println("Querying query: ", []byte(q), q) + if err := json.Unmarshal([]byte(q), &jsonMap); err != nil { + return err + } + + query, err = json.Marshal(jsonMap) + log.Println("Nullable marshal query: ", query, " err: ", err) + if err != nil { + return err + } + } else { + query, err = json.Marshal(queryMsg) + if err != nil { + return err + } + } + + stdout, _, err := tn.ExecQuery(ctx, "wasm", "contract-state", "smart", contractAddress, string(query)) + log.Println("NullableQueryContract stdout: ", stdout) + if err != nil { + return err + } + + // first let's see if data is null + var jsonMap map[string]*string + nilCaseErr := json.Unmarshal(stdout, &jsonMap) + if nilCaseErr == nil && jsonMap["data"] == nil { + // response = nil + return nil + } + + // if not, let's try to unmarshal the data + err = json.Unmarshal(stdout, response) + return err +} + // MigrateContract performs contract migration func (tn *ChainNode) MigrateContract(ctx context.Context, keyName string, contractAddress string, codeID string, message string, extraExecTxArgs ...string) (res *types.TxResponse, err error) { cmd := []string{"wasm", "migrate", contractAddress, codeID, message} diff --git a/chain/cosmos/types.go b/chain/cosmos/types.go index 22350bcc7..e790664e3 100644 --- a/chain/cosmos/types.go +++ b/chain/cosmos/types.go @@ -226,3 +226,24 @@ type ContractInfoResponse struct { Extension any `json:"extension"` } `json:"contract_info"` } + +type ConsensusParamsResponse struct { + Params struct { + Block struct { + MaxBytes string `json:"max_bytes"` + MaxGas string `json:"max_gas"` + } `json:"block"` + Evidence struct { + MaxAgeNumBlocks string `json:"max_age_num_blocks"` + MaxAgeDuration string `json:"max_age_duration"` + MaxBytes string `json:"max_bytes"` + } `json:"evidence"` + Validator struct { + PubKeyTypes []string `json:"pub_key_types"` + } `json:"validator"` + Version struct { + } `json:"version"` + Abci struct { + } `json:"abci"` + } `json:"params"` +} diff --git a/chain/penumbra/penumbra_client_node.go b/chain/penumbra/penumbra_client_node.go index 1b83c14bb..e04b39067 100644 --- a/chain/penumbra/penumbra_client_node.go +++ b/chain/penumbra/penumbra_client_node.go @@ -582,7 +582,7 @@ func (p *PenumbraClientNode) StartContainer(ctx context.Context) error { p.hostGRPCPort = hostPorts[0] - p.GRPCConn, err = grpc.Dial(p.hostGRPCPort, grpc.WithTransportCredentials(insecure.NewCredentials())) + p.GRPCConn, err = grpc.NewClient(p.hostGRPCPort, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err } diff --git a/examples/cosmwasm/external_contracts/daodaocore/daodao_core_msgs.go b/examples/cosmwasm/external_contracts/daodaocore/daodao_core_msgs.go new file mode 100644 index 000000000..ff2720b40 --- /dev/null +++ b/examples/cosmwasm/external_contracts/daodaocore/daodao_core_msgs.go @@ -0,0 +1,879 @@ +/* Code generated by github.com/srdtrk/go-codegen, DO NOT EDIT. */ +package daodaocore + +type InstantiateMsg struct { + // An image URL to describe the core module contract. + ImageUrl *string `json:"image_url,omitempty"` + /* + The items to instantiate this DAO with. Items are arbitrary key-value pairs whose contents are controlled by governance. + + It is an error to provide two items with the same key. + */ + InitialItems []InitialItem `json:"initial_items"` + // The name of the core contract. + Name string `json:"name"` + // Instantiate information for the core contract's proposal modules. NOTE: the pre-propose-base package depends on it being the case that the core module instantiates its proposal module. + ProposalModulesInstantiateInfo []ModuleInstantiateInfo `json:"proposal_modules_instantiate_info"` + // Instantiate information for the core contract's voting power module. + VotingModuleInstantiateInfo ModuleInstantiateInfo `json:"voting_module_instantiate_info"` + // If true the contract will automatically add received cw721 tokens to its treasury. + AutomaticallyAddCw721S bool `json:"automatically_add_cw721s"` + // If true the contract will automatically add received cw20 tokens to its treasury. + AutomaticallyAddCw20S bool `json:"automatically_add_cw20s"` + // Implements the DAO Star standard: + DaoUri *string `json:"dao_uri,omitempty"` + // A description of the core contract. + Description string `json:"description"` + // Optional Admin with the ability to execute DAO messages directly. Useful for building SubDAOs controlled by a parent DAO. If no admin is specified the contract is set as its own admin so that the admin may be updated later by governance. + Admin *string `json:"admin,omitempty"` +} + +type ExecuteMsg struct { + // Callable by the Admin, if one is configured. Executes messages in order. + ExecuteAdminMsgs *ExecuteMsg_ExecuteAdminMsgs `json:"execute_admin_msgs,omitempty"` + // Callable by proposal modules. The DAO will execute the messages in the hook in order. + ExecuteProposalHook *ExecuteMsg_ExecuteProposalHook `json:"execute_proposal_hook,omitempty"` + // Pauses the DAO for a set duration. When paused the DAO is unable to execute proposals + Pause *ExecuteMsg_Pause `json:"pause,omitempty"` + // Unpauses the DAO + Unpause *ExecuteMsg_Unpause `json:"unpause,omitempty"` + // Executed when the contract receives a cw20 token. Depending on the contract's configuration the contract will automatically add the token to its treasury. + Receive *ExecuteMsg_Receive `json:"receive,omitempty"` + // Executed when the contract receives a cw721 token. Depending on the contract's configuration the contract will automatically add the token to its treasury. + ReceiveNft *ExecuteMsg_ReceiveNft `json:"receive_nft,omitempty"` + // Removes an item from the governance contract's item map. + RemoveItem *ExecuteMsg_RemoveItem `json:"remove_item,omitempty"` + // Adds an item to the governance contract's item map. If the item already exists the existing value is overridden. If the item does not exist a new item is added. + SetItem *ExecuteMsg_SetItem `json:"set_item,omitempty"` + /* + Callable by the admin of the contract. If ADMIN is None the admin is set as the contract itself so that it may be updated later by vote. If ADMIN is Some a new admin is proposed and that new admin may become the admin by executing the `AcceptAdminNomination` message. + + If there is already a pending admin nomination the `WithdrawAdminNomination` message must be executed before a new admin may be nominated. + */ + NominateAdmin *ExecuteMsg_NominateAdmin `json:"nominate_admin,omitempty"` + /* + Callable by a nominated admin. Admins are nominated via the `NominateAdmin` message. Accepting a nomination will make the nominated address the new admin. + + Requiring that the new admin accepts the nomination before becoming the admin protects against a typo causing the admin to change to an invalid address. + */ + AcceptAdminNomination *ExecuteMsg_AcceptAdminNomination `json:"accept_admin_nomination,omitempty"` + // Callable by the current admin. Withdraws the current admin nomination. + WithdrawAdminNomination *ExecuteMsg_WithdrawAdminNomination `json:"withdraw_admin_nomination,omitempty"` + // Callable by the core contract. Replaces the current governance contract config with the provided config. + UpdateConfig *ExecuteMsg_UpdateConfig `json:"update_config,omitempty"` + // Updates the list of cw20 tokens this contract has registered. + UpdateCw20List *ExecuteMsg_UpdateCw20List `json:"update_cw20_list,omitempty"` + // Updates the list of cw721 tokens this contract has registered. + UpdateCw721List *ExecuteMsg_UpdateCw721List `json:"update_cw721_list,omitempty"` + // Updates the governance contract's governance modules. Module instantiate info in `to_add` is used to create new modules and install them. + UpdateProposalModules *ExecuteMsg_UpdateProposalModules `json:"update_proposal_modules,omitempty"` + // Callable by the core contract. Replaces the current voting module with a new one instantiated by the governance contract. + UpdateVotingModule *ExecuteMsg_UpdateVotingModule `json:"update_voting_module,omitempty"` + // Update the core module to add/remove SubDAOs and their charters + UpdateSubDaos *ExecuteMsg_UpdateSubDaos `json:"update_sub_daos,omitempty"` +} + +type MigrateMsg struct { + FromV1 *MigrateMsg_FromV1 `json:"from_v1,omitempty"` + FromCompatible *MigrateMsg_FromCompatible `json:"from_compatible,omitempty"` +} + +type QueryMsg struct { + // Get's the DAO's admin. Returns `Addr`. + Admin *QueryMsg_Admin `json:"admin,omitempty"` + // Get's the currently nominated admin (if any). + AdminNomination *QueryMsg_AdminNomination `json:"admin_nomination,omitempty"` + // Gets the contract's config. + Config *QueryMsg_Config `json:"config,omitempty"` + // Gets the token balance for each cw20 registered with the contract. + Cw20Balances *QueryMsg_Cw20Balances `json:"cw20_balances,omitempty"` + // Lists the addresses of the cw20 tokens in this contract's treasury. + Cw20TokenList *QueryMsg_Cw20TokenList `json:"cw20_token_list,omitempty"` + // Lists the addresses of the cw721 tokens in this contract's treasury. + Cw721TokenList *QueryMsg_Cw721TokenList `json:"cw721_token_list,omitempty"` + // Dumps all of the core contract's state in a single query. Useful for frontends as performance for queries is more limited by network times than compute times. + DumpState *QueryMsg_DumpState `json:"dump_state,omitempty"` + // Gets the address associated with an item key. + GetItem *QueryMsg_GetItem `json:"get_item,omitempty"` + // Lists all of the items associted with the contract. For example, given the items `{ "group": "foo", "subdao": "bar"}` this query would return `[("group", "foo"), ("subdao", "bar")]`. + ListItems *QueryMsg_ListItems `json:"list_items,omitempty"` + // Returns contract version info + Info *QueryMsg_Info `json:"info,omitempty"` + // Gets all proposal modules associated with the contract. + ProposalModules *QueryMsg_ProposalModules `json:"proposal_modules,omitempty"` + // Gets the active proposal modules associated with the contract. + ActiveProposalModules *QueryMsg_ActiveProposalModules `json:"active_proposal_modules,omitempty"` + // Gets the number of active and total proposal modules registered with this module. + ProposalModuleCount *QueryMsg_ProposalModuleCount `json:"proposal_module_count,omitempty"` + // Returns information about if the contract is currently paused. + PauseInfo *QueryMsg_PauseInfo `json:"pause_info,omitempty"` + // Gets the contract's voting module. + VotingModule *QueryMsg_VotingModule `json:"voting_module,omitempty"` + // Returns all SubDAOs with their charters in a vec. start_after is bound exclusive and asks for a string address. + ListSubDaos *QueryMsg_ListSubDaos `json:"list_sub_daos,omitempty"` + // Implements the DAO Star standard: + DaoURI *QueryMsg_DaoURI `json:"dao_u_r_i,omitempty"` + // Returns the voting power for an address at a given height. + VotingPowerAtHeight *QueryMsg_VotingPowerAtHeight `json:"voting_power_at_height,omitempty"` + // Returns the total voting power at a given block height. + TotalPowerAtHeight *QueryMsg_TotalPowerAtHeight `json:"total_power_at_height,omitempty"` +} + +type ExecuteMsg_RemoveItem struct { + Key string `json:"key"` +} + +type ExecuteMsg_UpdateVotingModule struct { + Module ModuleInstantiateInfo `json:"module"` +} + +/* +An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message. + +It is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451) +*/ +type Empty struct{} + +/* +The message types of the staking module. + +See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto +*/ +type StakingMsg struct { + // This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address. + Delegate *StakingMsg_Delegate `json:"delegate,omitempty"` + // This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address. + Undelegate *StakingMsg_Undelegate `json:"undelegate,omitempty"` + // This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address. + Redelegate *StakingMsg_Redelegate `json:"redelegate,omitempty"` +} + +type QueryMsg_AdminNomination struct{} + +type QueryMsg_Cw721TokenList struct { + Limit *int `json:"limit,omitempty"` + StartAfter *string `json:"start_after,omitempty"` +} + +// Returned by the `AdminNomination` query. +type AdminNominationResponse struct { + // The currently nominated admin or None if no nomination is pending. + Nomination *Addr `json:"nomination,omitempty"` +} + +// Information needed to instantiate a module. +type ModuleInstantiateInfo struct { + // CosmWasm level admin of the instantiated contract. See: + Admin *Admin `json:"admin,omitempty"` + // Code ID of the contract to be instantiated. + CodeId int `json:"code_id"` + // Funds to be sent to the instantiated contract. + Funds []Coin `json:"funds"` + // Label for the instantiated contract. + Label string `json:"label"` + // Instantiate message to be used to create the contract. + Msg Binary `json:"msg"` +} + +/* +A point in time in nanosecond precision. + +This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. + +## Examples + +``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); + +let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` +*/ +type Timestamp Uint64 + +type InfoResponse struct { + Info ContractVersion `json:"info"` +} + +type list_sub_daos []SubDao + +type QueryMsg_Info struct{} + +type QueryMsg_ListSubDaos struct { + Limit *int `json:"limit,omitempty"` + StartAfter *string `json:"start_after,omitempty"` +} + +type VotingPowerAtHeightResponse struct { + Height int `json:"height"` + Power Uint128 `json:"power"` +} + +// Top level type describing a proposal module. +type ProposalModule struct { + // The status of the proposal module, e.g. 'Enabled' or 'Disabled.' + Status ProposalModuleStatus `json:"status"` + // The address of the proposal module. + Address Addr `json:"address"` + // The URL prefix of this proposal module as derived from the module ID. Prefixes are mapped to letters, e.g. 0 is 'A', and 26 is 'AA'. + Prefix string `json:"prefix"` +} + +// Returned by the `Cw20Balances` query. +type Cw20BalanceResponse struct { + // The address of the token. + Addr Addr `json:"addr"` + // The contract's balance. + Balance Uint128 `json:"balance"` +} + +// Information about the CosmWasm level admin of a contract. Used in conjunction with `ModuleInstantiateInfo` to instantiate modules. +type Admin struct { + // Set the admin to a specified address. + Address *Admin_Address `json:"address,omitempty"` + // Sets the admin as the core module address. + CoreModule *Admin_CoreModule `json:"core_module,omitempty"` +} + +/* +The message types of the bank module. + +See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto +*/ +type BankMsg struct { + /* + Sends native tokens from the contract to the given address. + + This is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address. + */ + Send *BankMsg_Send `json:"send,omitempty"` + // This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired. + Burn *BankMsg_Burn `json:"burn,omitempty"` +} + +type VoteOption string + +const ( + VoteOption_Yes VoteOption = "yes" + VoteOption_No VoteOption = "no" + VoteOption_Abstain VoteOption = "abstain" + VoteOption_NoWithVeto VoteOption = "no_with_veto" +) + +type V2CodeIds struct { + Cw20Stake int `json:"cw20_stake"` + Cw20StakedBalancesVoting int `json:"cw20_staked_balances_voting"` + Cw4Voting int `json:"cw4_voting"` + ProposalSingle int `json:"proposal_single"` +} + +type QueryMsg_Cw20Balances struct { + StartAfter *string `json:"start_after,omitempty"` + Limit *int `json:"limit,omitempty"` +} + +type QueryMsg_ActiveProposalModules struct { + StartAfter *string `json:"start_after,omitempty"` + Limit *int `json:"limit,omitempty"` +} + +type ExecuteMsg_SetItem struct { + Key string `json:"key"` + Value string `json:"value"` +} + +type QueryMsg_ProposalModuleCount struct{} + +// Information about if the contract is currently paused. +type pause_info struct { + Paused *pause_info_Paused `json:"paused,omitempty"` + Unpaused *pause_info_Unpaused `json:"unpaused,omitempty"` +} +type ExecuteMsg_ReceiveNft Cw721ReceiveMsg + +type ExecuteMsg_UpdateCw721List struct { + ToAdd []string `json:"to_add"` + ToRemove []string `json:"to_remove"` +} + +/* +This message type allows the contract interact with the [x/gov] module in order to cast votes. + +## Examples + +Cast a simple vote: + +``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption}; + +#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, vote: VoteOption::Yes, })) } ``` + +Cast a weighted vote: + +``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = "cosmwasm_1_2")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption}; + +# #[cfg(feature = "cosmwasm_1_2")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ``` + +[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov +*/ +type GovMsg struct { + // This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address. + Vote *GovMsg_Vote `json:"vote,omitempty"` +} + +// In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set. +type IbcTimeout struct { + Block *IbcTimeoutBlock `json:"block,omitempty"` + Timestamp *Timestamp `json:"timestamp,omitempty"` +} + +// The params we need to provide for migration msgs +type ProposalParams struct { + CloseProposalOnExecutionFailure bool `json:"close_proposal_on_execution_failure"` + PreProposeInfo PreProposeInfo `json:"pre_propose_info"` +} + +type cw20_token_list []Addr + +type ExecuteMsg_UpdateSubDaos struct { + ToAdd []SubDao `json:"to_add"` + ToRemove []string `json:"to_remove"` +} + +/* +The message types of the wasm module. + +See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto +*/ +type WasmMsg struct { + /* + Dispatches a call to another contract at a known address (with known ABI). + + This is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address. + */ + Execute *WasmMsg_Execute `json:"execute,omitempty"` + /* + Instantiates a new contracts from previously uploaded Wasm code. + + The contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2. + + This is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address. + */ + Instantiate *WasmMsg_Instantiate `json:"instantiate,omitempty"` + /* + Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior. + + Only the contract admin (as defined in wasmd), if any, is able to make this call. + + This is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address. + */ + Migrate *WasmMsg_Migrate `json:"migrate,omitempty"` + // Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract. + UpdateAdmin *WasmMsg_UpdateAdmin `json:"update_admin,omitempty"` + // Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract. + ClearAdmin *WasmMsg_ClearAdmin `json:"clear_admin,omitempty"` +} + +type proposal_modules []ProposalModule + +type QueryMsg_TotalPowerAtHeight struct { + Height *int `json:"height,omitempty"` +} + +/* +A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq. + +# Examples + +Use `from` to create instances of this and `u128` to get the value out: + +``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123); + +let b = Uint128::from(42u64); assert_eq!(b.u128(), 42); + +let c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ``` +*/ +type Uint128 string + +type ExecuteMsg_UpdateConfig struct { + Config Config `json:"config"` +} + +type ExecuteMsg_UpdateCw20List struct { + ToAdd []string `json:"to_add"` + ToRemove []string `json:"to_remove"` +} + +/* +The message types of the distribution module. + +See https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto +*/ +type DistributionMsg struct { + // This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address. + SetWithdrawAddress *DistributionMsg_SetWithdrawAddress `json:"set_withdraw_address,omitempty"` + // This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address. + WithdrawDelegatorReward *DistributionMsg_WithdrawDelegatorReward `json:"withdraw_delegator_reward,omitempty"` +} + +// Top level config type for core module. +type Config struct { + // A description of the contract. + Description string `json:"description"` + // An optional image URL for displaying alongside the contract. + ImageUrl *string `json:"image_url,omitempty"` + // The name of the contract. + Name string `json:"name"` + // If true the contract will automatically add received cw20 tokens to its treasury. + AutomaticallyAddCw20S bool `json:"automatically_add_cw20s"` + // If true the contract will automatically add received cw721 tokens to its treasury. + AutomaticallyAddCw721S bool `json:"automatically_add_cw721s"` + // The URI for the DAO as defined by the DAOstar standard + DaoUri *string `json:"dao_uri,omitempty"` +} + +type MigrateV1ToV2 struct { + MigrationParams MigrationModuleParams `json:"migration_params"` + SubDaos []SubDao `json:"sub_daos"` + V1CodeIds V1CodeIds `json:"v1_code_ids"` + V2CodeIds V2CodeIds `json:"v2_code_ids"` +} + +type QueryMsg_Admin struct{} + +type ContractVersion struct { + // contract is the crate name of the implementing contract, eg. `crate:cw20-base` we will use other prefixes for other languages, and their standard global namespacing + Contract string `json:"contract"` + // version is any string that this implementation knows. It may be simple counter "1", "2". or semantic version on release tags "v0.7.0", or some custom feature flag list. the only code that needs to understand the version parsing is code that knows how to migrate from the given contract (and is tied to it's implementation somehow) + Version string `json:"version"` +} + +type ExecuteMsg_UpdateProposalModules struct { + // NOTE: the pre-propose-base package depends on it being the case that the core module instantiates its proposal module. + ToAdd []ModuleInstantiateInfo `json:"to_add"` + ToDisable []string `json:"to_disable"` +} + +// Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg +type Cw20ReceiveMsg struct { + Amount Uint128 `json:"amount"` + Msg Binary `json:"msg"` + Sender string `json:"sender"` +} + +// Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined +type Duration struct { + Height *Duration_Height `json:"height,omitempty"` + // Time in seconds + Time *Duration_Time `json:"time,omitempty"` +} + +// Cw721ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg +type Cw721ReceiveMsg struct { + Msg Binary `json:"msg"` + Sender string `json:"sender"` + TokenId string `json:"token_id"` +} + +type QueryMsg_DumpState struct{} + +type QueryMsg_ProposalModules struct { + StartAfter *string `json:"start_after,omitempty"` + Limit *int `json:"limit,omitempty"` +} + +type active_proposal_modules []ProposalModule + +type CosmosMsg_for_Empty struct { + Bank *CosmosMsg_for_Empty_Bank `json:"bank,omitempty"` + Custom *CosmosMsg_for_Empty_Custom `json:"custom,omitempty"` + Staking *CosmosMsg_for_Empty_Staking `json:"staking,omitempty"` + Distribution *CosmosMsg_for_Empty_Distribution `json:"distribution,omitempty"` + // A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) + Stargate *CosmosMsg_for_Empty_Stargate `json:"stargate,omitempty"` + Ibc *CosmosMsg_for_Empty_Ibc `json:"ibc,omitempty"` + Wasm *CosmosMsg_for_Empty_Wasm `json:"wasm,omitempty"` + Gov *CosmosMsg_for_Empty_Gov `json:"gov,omitempty"` +} + +// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) +type IbcTimeoutBlock struct { + // block height after which the packet times out. the height within the given revision + Height int `json:"height"` + // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) + Revision int `json:"revision"` +} + +type QueryMsg_ListItems struct { + Limit *int `json:"limit,omitempty"` + StartAfter *string `json:"start_after,omitempty"` +} + +// Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future) +type Expiration struct { + // AtHeight will expire when `env.block.height` >= height + AtHeight *Expiration_AtHeight `json:"at_height,omitempty"` + // AtTime will expire when `env.block.time` >= time + AtTime *Expiration_AtTime `json:"at_time,omitempty"` + // Never will never expire. Used to express the empty variant + Never *Expiration_Never `json:"never,omitempty"` +} + +// Information about if the contract is currently paused. +type PauseInfoResponse struct { + Paused *PauseInfoResponse_Paused `json:"paused,omitempty"` + Unpaused *PauseInfoResponse_Unpaused `json:"unpaused,omitempty"` +} + +type ExecuteMsg_Unpause struct{} + +type SubDao struct { + // The contract address of the SubDAO + Addr string `json:"addr"` + // The purpose/constitution for the SubDAO + Charter *string `json:"charter,omitempty"` +} + +type MigrateMsg_FromV1 struct { + DaoUri *string `json:"dao_uri,omitempty"` + Params *MigrateParams `json:"params,omitempty"` +} + +type QueryMsg_GetItem struct { + Key string `json:"key"` +} + +type QueryMsg_VotingModule struct{} + +// The status of a proposal module. +type ProposalModuleStatus string + +const ( + ProposalModuleStatus_Enabled ProposalModuleStatus = "enabled" + ProposalModuleStatus_Disabled ProposalModuleStatus = "disabled" +) + +type ProposalModuleCountResponse struct { + // The number of active proposal modules. + ActiveProposalModuleCount int `json:"active_proposal_module_count"` + // The total number of proposal modules. + TotalProposalModuleCount int `json:"total_proposal_module_count"` +} + +type PreProposeInfo struct { + // Anyone may create a proposal free of charge. + AnyoneMayPropose *PreProposeInfo_AnyoneMayPropose `json:"anyone_may_propose,omitempty"` + // The module specified in INFO has exclusive rights to proposal creation. + ModuleMayPropose *PreProposeInfo_ModuleMayPropose `json:"module_may_propose,omitempty"` +} + +type TotalPowerAtHeightResponse struct { + Height int `json:"height"` + Power Uint128 `json:"power"` +} + +type list_items []string + +type ExecuteMsg_ExecuteAdminMsgs struct { + Msgs []CosmosMsg_for_Empty `json:"msgs"` +} + +type ExecuteMsg_Pause struct { + Duration Duration `json:"duration"` +} + +type MigrateMsg_FromCompatible struct{} + +type MigrateParams struct { + MigratorCodeId int `json:"migrator_code_id"` + Params MigrateV1ToV2 `json:"params"` +} + +// Top level config type for core module. +type Config_2 struct { + // The name of the contract. + Name string `json:"name"` + // If true the contract will automatically add received cw20 tokens to its treasury. + AutomaticallyAddCw20S bool `json:"automatically_add_cw20s"` + // If true the contract will automatically add received cw721 tokens to its treasury. + AutomaticallyAddCw721S bool `json:"automatically_add_cw721s"` + // The URI for the DAO as defined by the DAOstar standard + DaoUri *string `json:"dao_uri,omitempty"` + // A description of the contract. + Description string `json:"description"` + // An optional image URL for displaying alongside the contract. + ImageUrl *string `json:"image_url,omitempty"` +} + +type DaoURIResponse struct { + DaoUri *string `json:"dao_uri,omitempty"` +} + +type cw721_token_list []Addr + +type Coin struct { + Amount Uint128 `json:"amount"` + Denom string `json:"denom"` +} + +type ExecuteMsg_ExecuteProposalHook struct { + Msgs []CosmosMsg_for_Empty `json:"msgs"` +} +type ExecuteMsg_Receive Cw20ReceiveMsg + +type ExecuteMsg_NominateAdmin struct { + Admin *string `json:"admin,omitempty"` +} + +type ExecuteMsg_AcceptAdminNomination struct{} + +type QueryMsg_DaoURI struct{} + +type QueryMsg_VotingPowerAtHeight struct { + Address string `json:"address"` + Height *int `json:"height,omitempty"` +} + +// Relevant state for the governance module. Returned by the `DumpState` query. +type DumpStateResponse struct { + // The governance contract's version. + Version ContractVersion `json:"version"` + // The voting module associated with the governance contract. + VotingModule Addr `json:"voting_module"` + // The number of active proposal modules. + ActiveProposalModuleCount int `json:"active_proposal_module_count"` + // Optional DAO Admin + Admin Addr `json:"admin"` + // The governance contract's config. + Config Config `json:"config"` + PauseInfo PauseInfoResponse `json:"pause_info"` + // The governance modules associated with the governance contract. + ProposalModules []ProposalModule `json:"proposal_modules"` + // The total number of proposal modules. + TotalProposalModuleCount int `json:"total_proposal_module_count"` +} + +// These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points) +type IbcMsg struct { + // Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to. + Transfer *IbcMsg_Transfer `json:"transfer,omitempty"` + // Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this. + SendPacket *IbcMsg_SendPacket `json:"send_packet,omitempty"` + // This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port + CloseChannel *IbcMsg_CloseChannel `json:"close_channel,omitempty"` +} + +/* +A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq. + +# Examples + +Use `from` to create instances of this and `u64` to get the value out: + +``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42); + +let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ``` +*/ +type Uint64 string + +type QueryMsg_Config struct{} + +/* +A human readable address. + +In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length. + +This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances. + +This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance. +*/ +type Addr string + +// Returned by the `GetItem` query. +type GetItemResponse struct { + // `None` if no item with the provided key was found, `Some` otherwise. + Item *string `json:"item,omitempty"` +} + +/* +Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline. + +This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also . +*/ +type Binary string + +// Information about an item to be stored in the items list. +type InitialItem struct { + // The name of the item. + Key string `json:"key"` + // The value the item will have at instantiation time. + Value string `json:"value"` +} + +type ExecuteMsg_WithdrawAdminNomination struct{} + +type V1CodeIds struct { + Cw20StakedBalancesVoting int `json:"cw20_staked_balances_voting"` + Cw4Voting int `json:"cw4_voting"` + ProposalSingle int `json:"proposal_single"` + Cw20Stake int `json:"cw20_stake"` +} + +type MigrationModuleParams struct { + // Rather or not to migrate the stake_cw20 contract and its manager. If this is not set to true and a stake_cw20 contract is detected in the DAO's configuration the migration will be aborted. + MigrateStakeCw20Manager *bool `json:"migrate_stake_cw20_manager,omitempty"` + ProposalParams []any `json:"proposal_params"` +} + +type QueryMsg_Cw20TokenList struct { + Limit *int `json:"limit,omitempty"` + StartAfter *string `json:"start_after,omitempty"` +} + +type QueryMsg_PauseInfo struct{} + +type WasmMsg_UpdateAdmin struct { + ContractAddr string `json:"contract_addr"` + Admin string `json:"admin"` +} + +type pause_info_Paused struct { + Expiration Expiration `json:"expiration"` +} + +type IbcMsg_CloseChannel struct { + ChannelId string `json:"channel_id"` +} +type CosmosMsg_for_Empty_Distribution DistributionMsg + +type WasmMsg_Execute struct { + ContractAddr string `json:"contract_addr"` + Funds []Coin `json:"funds"` + // msg is the json-encoded ExecuteMsg struct (as raw Binary) + Msg Binary `json:"msg"` +} + +type PauseInfoResponse_Paused struct { + Expiration Expiration `json:"expiration"` +} +type CosmosMsg_for_Empty_Staking StakingMsg +type CosmosMsg_for_Empty_Ibc IbcMsg + +type PreProposeInfo_AnyoneMayPropose struct{} + +type Expiration_Never struct{} + +type Admin_Address struct { + Addr string `json:"addr"` +} + +type BankMsg_Burn struct { + Amount []Coin `json:"amount"` +} + +type Duration_Height int + +type Expiration_AtHeight int + +type Admin_CoreModule struct{} +type CosmosMsg_for_Empty_Wasm WasmMsg + +type Duration_Time int + +type WasmMsg_Migrate struct { + ContractAddr string `json:"contract_addr"` + // msg is the json-encoded MigrateMsg struct that will be passed to the new code + Msg Binary `json:"msg"` + // the code_id of the new logic to place in the given contract + NewCodeId int `json:"new_code_id"` +} + +type DistributionMsg_SetWithdrawAddress struct { + // The `withdraw_address` + Address string `json:"address"` +} + +type StakingMsg_Delegate struct { + Amount Coin `json:"amount"` + Validator string `json:"validator"` +} + +type BankMsg_Send struct { + Amount []Coin `json:"amount"` + ToAddress string `json:"to_address"` +} + +type IbcMsg_Transfer struct { + // existing channel to send the tokens over + ChannelId string `json:"channel_id"` + // when packet times out, measured on remote chain + Timeout IbcTimeout `json:"timeout"` + // address on the remote chain to receive these tokens + ToAddress string `json:"to_address"` + // packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20 + Amount Coin `json:"amount"` +} +type CosmosMsg_for_Empty_Custom Empty + +type StakingMsg_Undelegate struct { + Amount Coin `json:"amount"` + Validator string `json:"validator"` +} + +type PreProposeInfo_ModuleMayPropose struct { + Info ModuleInstantiateInfo `json:"info"` +} + +type IbcMsg_SendPacket struct { + ChannelId string `json:"channel_id"` + Data Binary `json:"data"` + // when packet times out, measured on remote chain + Timeout IbcTimeout `json:"timeout"` +} + +type PauseInfoResponse_Unpaused struct{} + +type pause_info_Unpaused struct{} + +type StakingMsg_Redelegate struct { + SrcValidator string `json:"src_validator"` + Amount Coin `json:"amount"` + DstValidator string `json:"dst_validator"` +} + +type WasmMsg_ClearAdmin struct { + ContractAddr string `json:"contract_addr"` +} + +type WasmMsg_Instantiate struct { + /* + A human-readable label for the contract. + + Valid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace + */ + Label string `json:"label"` + // msg is the JSON-encoded InstantiateMsg struct (as raw Binary) + Msg Binary `json:"msg"` + Admin *string `json:"admin,omitempty"` + CodeId int `json:"code_id"` + Funds []Coin `json:"funds"` +} +type CosmosMsg_for_Empty_Bank BankMsg +type CosmosMsg_for_Empty_Gov GovMsg +type Expiration_AtTime Timestamp + +type GovMsg_Vote struct { + /* + The vote option. + + This should be called "option" for consistency with Cosmos SDK. Sorry for that. See . + */ + Vote VoteOption `json:"vote"` + ProposalId int `json:"proposal_id"` +} + +type CosmosMsg_for_Empty_Stargate struct { + TypeUrl string `json:"type_url"` + Value Binary `json:"value"` +} + +type DistributionMsg_WithdrawDelegatorReward struct { + // The `validator_address` + Validator string `json:"validator"` +} diff --git a/examples/cosmwasm/external_contracts/polytone_test.go b/examples/cosmwasm/external_contracts/polytone_test.go new file mode 100644 index 000000000..06a00659c --- /dev/null +++ b/examples/cosmwasm/external_contracts/polytone_test.go @@ -0,0 +1,203 @@ +package polytone_test + +import ( + "context" + "fmt" + "log" + "testing" + "time" + + "cosmossdk.io/math" + "github.com/strangelove-ventures/interchaintest/v8" + "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos/wasm" + "github.com/strangelove-ventures/interchaintest/v8/ibc" + "github.com/strangelove-ventures/interchaintest/v8/testreporter" + "github.com/strangelove-ventures/interchaintest/v8/testutil" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" +) + +func TestPolytoneDeployment(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + + ctx := context.Background() + + // Chain Factory + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + {Name: "juno", ChainName: "juno1", Version: "latest", ChainConfig: ibc.ChainConfig{ + GasPrices: "0.00ujuno", + EncodingConfig: wasm.WasmEncoding(), + }}, + {Name: "juno", ChainName: "juno2", Version: "latest", ChainConfig: ibc.ChainConfig{ + GasPrices: "0.00ujuno", + EncodingConfig: wasm.WasmEncoding(), + }}, + }) + + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + juno1, juno2 := chains[0], chains[1] + + // Relayer Factory + client, network := interchaintest.DockerSetup(t) + r := interchaintest.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t)).Build( + t, client, network) + + // Prep Interchain + const ibcPath = "wasmpath" + ic := interchaintest.NewInterchain(). + AddChain(juno1). + AddChain(juno2). + AddRelayer(r, "relayer"). + AddLink(interchaintest.InterchainLink{ + Chain1: juno1, + Chain2: juno2, + Relayer: r, + Path: ibcPath, + }) + + // Log location + f, err := interchaintest.CreateLogFile(fmt.Sprintf("polytone_deployment_%d.json", time.Now().Unix())) + require.NoError(t, err) + // Reporter/logs + rep := testreporter.NewReporter(f) + eRep := rep.RelayerExecReporter(t) + + // Build interchain + require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + SkipPathCreation: false, + })) + t.Cleanup(func() { + _ = ic.Close() + }) + + // Create and Fund User Wallets + initBal := math.NewInt(100_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", initBal, juno1, juno2) + juno1User := users[0] + juno2User := users[1] + + err = testutil.WaitForBlocks(ctx, 2, juno1, juno2) + require.NoError(t, err) + + juno1UserBalInitial, err := juno1.GetBalance(ctx, juno1User.FormattedAddress(), juno1.Config().Denom) + require.NoError(t, err) + require.True(t, juno1UserBalInitial.Equal(initBal)) + + juno2UserBalInitial, err := juno2.GetBalance(ctx, juno2User.FormattedAddress(), juno2.Config().Denom) + require.NoError(t, err) + require.True(t, juno2UserBalInitial.Equal(initBal)) + + // Start the relayer + err = r.StartRelayer(ctx, eRep, ibcPath) + require.NoError(t, err) + + t.Cleanup( + func() { + err := r.StopRelayer(ctx, eRep) + if err != nil { + t.Logf("an error occurred while stopping the relayer: %s", err) + } + }, + ) + + juno1Chain := juno1.(*cosmos.CosmosChain) + juno2Chain := juno2.(*cosmos.CosmosChain) + + // Deploy polytone contracts + polytoneContracts, err := juno1Chain.SetupPolytone( + ctx, + r, + eRep, + ibcPath, + juno1User.KeyName(), + juno2Chain, + juno2User.KeyName(), + ) + require.NoError(t, err) + require.NotEmpty(t, polytoneContracts) + + // Wait for the channel to get set up + err = testutil.WaitForBlocks(ctx, 2, juno1, juno2) + require.NoError(t, err) + + // Upload and instantiate polytone_tester contract + testerContract, err := juno1Chain.UploadAndInstantiateContract(ctx, juno1User.KeyName(), "../../../external_contracts/polytone/v1.0.0/polytone_tester.wasm", "{}", "polytone_tester", true) + require.NoError(t, err) + require.NotEmpty(t, testerContract) + + log.Println("Querying contract on Juno1 for remote address (populated via ibc) ", polytoneContracts.ChannelID) + + roundtripExec, err := juno1Chain.ExecuteContract(ctx, + juno1User.KeyName(), + polytoneContracts.Note.Address, + fmt.Sprintf(`{"execute": {"msgs": [], "timeout_seconds": "100", "callback": {"receiver": "%s", "msg": "aGVsbG8K"}}}`, + testerContract.Address)) + require.NoError(t, err) + require.Equal(t, uint32(0), roundtripExec.Code) + + // Wait for the packet to be relayed + err = testutil.WaitForBlocks(ctx, 2, juno1, juno2) + require.NoError(t, err) + + var activeChannelResponse NoteRemoteAddressResponse + err = juno1Chain.NullableQueryContract(ctx, polytoneContracts.Note.Address, + fmt.Sprintf(`{"remote_address": {"local_address": "%v"}}`, juno1User.FormattedAddress()), activeChannelResponse) + require.NoError(t, err) + log.Printf("activeChannelResponse: %v", activeChannelResponse) + // require.NotEmpty(t, activeChannelResponse.Data) + + // var pairResponse NotePairResponse + // err = juno1Chain.NullableQueryContract(ctx, polytoneContracts.Note.Address, fmt.Sprintf(`{"pair":{}}`), &pairResponse) + // require.NoError(t, err) + // log.Printf("pairResponse: %v", pairResponse) + // require.NotEmpty(t, pairResponse.Data) + + // // Query ibc_reflect_send contract on Juno1 for remote address (populated via ibc) + // var ibcReflectSendResponse IbcReflectSendResponseData + // err = juno1Chain.QueryContract(ctx, ibcReflectSendContractAddr, queryMsg, &ibcReflectSendResponse) + // require.NoError(t, err) + // require.NotEmpty(t, ibcReflectSendResponse.Data.RemoteAddr) + + // // Query ibc_reflect contract on Juno2 for local account address + // var ibcReflectResponse IbcReflectResponseData + // err = juno2Chain.QueryContract(ctx, ibcReflectContractAddr, queryMsg, &ibcReflectResponse) + // require.NoError(t, err) + // require.NotEmpty(t, ibcReflectResponse.Data.Account) + + // // Verify that these addresses match, a match is a successful test run + // // - ibc_reflect_send contract (Juno1) remote address (retrieved via ibc) + // // - ibc_reflect contract (Juno2) account address populated locally + // require.Equal(t, ibcReflectSendResponse.Data.RemoteAddr, ibcReflectResponse.Data.Account) +} + +type Coin struct { + Denom string `json:"denom"` // type, eg. "ATOM" + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" +} + +type Coins []Coin + +type NoteActiveChannelResponse struct { + Data string `json:"data"` +} + +type NotePairResponse struct { + Data struct { + Pair struct { + ConnectionID string `json:"connection_id"` + RemotePort string `json:"remote_port"` + } `json:"pair"` + } `json:"data",omitempty` +} + +type NoteRemoteAddressResponse struct { + Data string `json:"data",omimtempty` +} diff --git a/external_contracts/daodao/v2.4.2/checksums.txt b/external_contracts/daodao/v2.4.2/checksums.txt new file mode 100644 index 000000000..18a4d4ee3 --- /dev/null +++ b/external_contracts/daodao/v2.4.2/checksums.txt @@ -0,0 +1,28 @@ +c2f5d9fdef714254d21e37b2839e3c0feb295778377b386af5c234a8d8dab479 cw20_stake.wasm +d2eb08132736a1a2c6f777d0a23d83c109908a2e40292f6dd4d7f0b97ba61e00 cw20_stake_external_rewards.wasm +50acc0cf65354512ad87795b163be3b048b799134047a69dd3852adbcf6aba9d cw20_stake_reward_distributor.wasm +20dc188d1e6019fe3861ee156619a894b8f32f8a7539addd1098647bad88244c cw721_roles.wasm +d102bacd86e40273bd1e5b1a4d7640307dfc60ab1b67e69ba88034835cd828d4 cw_admin_factory.wasm +68daa2c44dac5e523b235d4b22bda4aae83b3946f59d2e3ba764d78d1533f5ec cw_fund_distributor.wasm +44affb4b34007c9f8f27b01c6cebe95cf6f8c65284bcb3d9737234f07313f925 cw_payroll_factory.wasm +7bb0526fe0223b4e67b11abb69eab1611e4274a8cbf20a93574bb660b5151841 cw_token_swap.wasm +5a30d84a9555a19a790f530f1734759227c5b4d7771742a3d7cd2936ab249cde cw_tokenfactory_issuer.wasm +5be86088bddcc6e7bc382244fb71d2dc2609274f5744fc94da7d55d402bd189c cw_vesting.wasm +4c9e5711e922cd78c6681d269d8e79b0d8b90ec986f6a52a2dec91cee6bdcebe dao_dao_core.wasm +0841ec799dbf564c9f07a628c59fbf15d0fd994ae7294d2b4f907b58a0329530 dao_migrator.wasm +f6597f9be7974f467ef88fd3231c2255e8ecd3357700efb2ee7651640d26e6de dao_pre_propose_approval_single.wasm +acdeceff008e30b359eb2f0f1dd64d45727d6322220a9573a3fb9cb07d3b454f dao_pre_propose_approver.wasm +b9ec083ee62529bd6ab7c894bfffa608d6073b3fe6f458114b4606c56ab238b7 dao_pre_propose_multiple.wasm +0a1c821898dc0a4e2dae3d62b0ea835e20676fca7da3ea01b8c053f609eed4f0 dao_pre_propose_single.wasm +5f5c2c4b8fda6a372353dca960b418ced7586bf53b152a5e492a4a3617e4251d dao_proposal_condorcet.wasm +8610a497e09e66dd032293e1416b5d4d8a7e1660fcbb625ccdb596093ea85920 dao_proposal_hook_counter.wasm +64f2eb08fee4759ab76712026ca63534d2642095d00b55c3103a5455c0cca1d7 dao_proposal_multiple.wasm +ccd1ee680e371c4c9c95a14dbb506cae0d1ba568468c824369997af92495e3d5 dao_proposal_single.wasm +eac94fcbc7950e2f0692133aa92eca94a910359c0f934b7aaaba5457d445b300 dao_proposal_sudo.wasm +d8ed01aa4ec8398de79606c9f7a3095213b18cac730c54c38bebb77ec4d28a45 dao_test_custom_factory.wasm +0419d8c8ba7f72218484a4b4245fd973443d64c0b59ccf02f9791b48c2fcf9fa dao_voting_cw20_balance.wasm +011b437929b243ac972be327141775f3430770690eb393ec9bfd1585567ac21b dao_voting_cw20_staked.wasm +73706d1df4dc9c9e2c8647f593a09c466a55a3779d714706c388d423a3bdfd02 dao_voting_cw4.wasm +9d77bee992dbd55305213a7a6e727446e2294c29f64e946b8d174f35da634df7 dao_voting_cw721_roles.wasm +a683d0bfac63bb509f6e503307d9cab3c96b7ee6262aed1f62825f1808c97375 dao_voting_cw721_staked.wasm +1f9537722fea62e68ebda39e793625b0127fae99572feec32e99e1356f75c0fa dao_voting_token_staked.wasm diff --git a/external_contracts/daodao/v2.4.2/cw20_stake_external_rewards.wasm b/external_contracts/daodao/v2.4.2/cw20_stake_external_rewards.wasm new file mode 100644 index 000000000..e3cec7f85 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw20_stake_external_rewards.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw20_stake_reward_distributor.wasm b/external_contracts/daodao/v2.4.2/cw20_stake_reward_distributor.wasm new file mode 100644 index 000000000..5b5755748 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw20_stake_reward_distributor.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw721_roles.wasm b/external_contracts/daodao/v2.4.2/cw721_roles.wasm new file mode 100644 index 000000000..b95507cde Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw721_roles.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw_admin_factory.wasm b/external_contracts/daodao/v2.4.2/cw_admin_factory.wasm new file mode 100644 index 000000000..69d0c3b87 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw_admin_factory.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw_fund_distributor.wasm b/external_contracts/daodao/v2.4.2/cw_fund_distributor.wasm new file mode 100644 index 000000000..4afad8b5c Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw_fund_distributor.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw_payroll_factory.wasm b/external_contracts/daodao/v2.4.2/cw_payroll_factory.wasm new file mode 100644 index 000000000..7fbb11d9d Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw_payroll_factory.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw_token_swap.wasm b/external_contracts/daodao/v2.4.2/cw_token_swap.wasm new file mode 100644 index 000000000..6f41312d5 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw_token_swap.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw_tokenfactory_issuer.wasm b/external_contracts/daodao/v2.4.2/cw_tokenfactory_issuer.wasm new file mode 100644 index 000000000..31d41dfc6 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw_tokenfactory_issuer.wasm differ diff --git a/external_contracts/daodao/v2.4.2/cw_vesting.wasm b/external_contracts/daodao/v2.4.2/cw_vesting.wasm new file mode 100644 index 000000000..a79ac041f Binary files /dev/null and b/external_contracts/daodao/v2.4.2/cw_vesting.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_dao_core.wasm b/external_contracts/daodao/v2.4.2/dao_dao_core.wasm new file mode 100644 index 000000000..ab1ab11c5 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_dao_core.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_migrator.wasm b/external_contracts/daodao/v2.4.2/dao_migrator.wasm new file mode 100644 index 000000000..6307a335c Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_migrator.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_pre_propose_approval_single.wasm b/external_contracts/daodao/v2.4.2/dao_pre_propose_approval_single.wasm new file mode 100644 index 000000000..eb38e6bf9 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_pre_propose_approval_single.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_pre_propose_approver.wasm b/external_contracts/daodao/v2.4.2/dao_pre_propose_approver.wasm new file mode 100644 index 000000000..d790c4b95 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_pre_propose_approver.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_pre_propose_multiple.wasm b/external_contracts/daodao/v2.4.2/dao_pre_propose_multiple.wasm new file mode 100644 index 000000000..ba0ccf48c Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_pre_propose_multiple.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_pre_propose_single.wasm b/external_contracts/daodao/v2.4.2/dao_pre_propose_single.wasm new file mode 100644 index 000000000..88e1447dc Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_pre_propose_single.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_proposal_condorcet.wasm b/external_contracts/daodao/v2.4.2/dao_proposal_condorcet.wasm new file mode 100644 index 000000000..c3561383b Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_proposal_condorcet.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_proposal_hook_counter.wasm b/external_contracts/daodao/v2.4.2/dao_proposal_hook_counter.wasm new file mode 100644 index 000000000..e772c202b Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_proposal_hook_counter.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_proposal_multiple.wasm b/external_contracts/daodao/v2.4.2/dao_proposal_multiple.wasm new file mode 100644 index 000000000..3f05a5a38 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_proposal_multiple.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_proposal_single.wasm b/external_contracts/daodao/v2.4.2/dao_proposal_single.wasm new file mode 100644 index 000000000..a1d0ccfd4 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_proposal_single.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_proposal_sudo.wasm b/external_contracts/daodao/v2.4.2/dao_proposal_sudo.wasm new file mode 100644 index 000000000..1710014f9 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_proposal_sudo.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_test_custom_factory.wasm b/external_contracts/daodao/v2.4.2/dao_test_custom_factory.wasm new file mode 100644 index 000000000..d671fb041 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_test_custom_factory.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_voting_cw20_balance.wasm b/external_contracts/daodao/v2.4.2/dao_voting_cw20_balance.wasm new file mode 100644 index 000000000..093dead80 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_voting_cw20_balance.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_voting_cw20_staked.wasm b/external_contracts/daodao/v2.4.2/dao_voting_cw20_staked.wasm new file mode 100644 index 000000000..6a9da4f66 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_voting_cw20_staked.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_voting_cw4.wasm b/external_contracts/daodao/v2.4.2/dao_voting_cw4.wasm new file mode 100644 index 000000000..5097967da Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_voting_cw4.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_voting_cw721_roles.wasm b/external_contracts/daodao/v2.4.2/dao_voting_cw721_roles.wasm new file mode 100644 index 000000000..ac94c18ea Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_voting_cw721_roles.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_voting_cw721_staked.wasm b/external_contracts/daodao/v2.4.2/dao_voting_cw721_staked.wasm new file mode 100644 index 000000000..0ef9033b3 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_voting_cw721_staked.wasm differ diff --git a/external_contracts/daodao/v2.4.2/dao_voting_token_staked.wasm b/external_contracts/daodao/v2.4.2/dao_voting_token_staked.wasm new file mode 100644 index 000000000..6c06bf325 Binary files /dev/null and b/external_contracts/daodao/v2.4.2/dao_voting_token_staked.wasm differ diff --git a/external_contracts/polytone/v1.0.0/checksums.txt b/external_contracts/polytone/v1.0.0/checksums.txt new file mode 100644 index 000000000..50f102033 --- /dev/null +++ b/external_contracts/polytone/v1.0.0/checksums.txt @@ -0,0 +1,5 @@ +3a7e6d942ae50335e6e07b159b44e38b14a10675ff6b6920cefc96bc2676adf8 polytone_listener-aarch64.wasm +6e9bcc7a532a3b1a6a6bb511d11a209c19843791cc1e69f560563f68c6eb92ca polytone_note-aarch64.wasm +ff65a40f51acace79650a2e2c7fdefd86967b27b4b7509c1c1ac57763cae098b polytone_proxy-aarch64.wasm +aac93d2e5c8e4c8b9e4d3dd5dbf253fc970f24bd2a368b841571b781e5585c8f polytone_tester-aarch64.wasm +7c4696fac4440a434015b21af8d7f08264548239b47360f4b673a87363789a59 polytone_voice-aarch64.wasm diff --git a/external_contracts/polytone/v1.0.0/polytone_listener.wasm b/external_contracts/polytone/v1.0.0/polytone_listener.wasm new file mode 100644 index 000000000..acbb97e4d Binary files /dev/null and b/external_contracts/polytone/v1.0.0/polytone_listener.wasm differ diff --git a/external_contracts/polytone/v1.0.0/polytone_note.wasm b/external_contracts/polytone/v1.0.0/polytone_note.wasm new file mode 100644 index 000000000..24a29f77c Binary files /dev/null and b/external_contracts/polytone/v1.0.0/polytone_note.wasm differ diff --git a/external_contracts/polytone/v1.0.0/polytone_proxy.wasm b/external_contracts/polytone/v1.0.0/polytone_proxy.wasm new file mode 100644 index 000000000..c0656f79b Binary files /dev/null and b/external_contracts/polytone/v1.0.0/polytone_proxy.wasm differ diff --git a/external_contracts/polytone/v1.0.0/polytone_tester.wasm b/external_contracts/polytone/v1.0.0/polytone_tester.wasm new file mode 100644 index 000000000..22fb57186 Binary files /dev/null and b/external_contracts/polytone/v1.0.0/polytone_tester.wasm differ diff --git a/external_contracts/polytone/v1.0.0/polytone_voice.wasm b/external_contracts/polytone/v1.0.0/polytone_voice.wasm new file mode 100644 index 000000000..044ec33d7 Binary files /dev/null and b/external_contracts/polytone/v1.0.0/polytone_voice.wasm differ