diff --git a/contracts/tokenomics/staking/src/contract.rs b/contracts/tokenomics/staking/src/contract.rs index 503afa85..19a3776a 100644 --- a/contracts/tokenomics/staking/src/contract.rs +++ b/contracts/tokenomics/staking/src/contract.rs @@ -13,7 +13,7 @@ use osmosis_std::types::osmosis::tokenfactory::v1beta1::{ }; use astroport::staking::{ - Config, ExecuteMsg, InstantiateMsg, QueryMsg, StakingResponse, TrackerData, HOOK_GAS_LIMIT, + Config, ExecuteMsg, InstantiateMsg, QueryMsg, StakingResponse, TrackerData, }; use crate::error::ContractError; @@ -130,14 +130,11 @@ pub fn execute( contract_address, msg, } => execute_enter(deps, env, info).map(|(resp, minted_coins)| { - resp.add_submessage( - SubMsg::new(WasmMsg::Execute { - contract_addr: contract_address.clone(), - msg, - funds: vec![minted_coins], - }) - .with_gas_limit(HOOK_GAS_LIMIT), - ) + resp.add_message(WasmMsg::Execute { + contract_addr: contract_address.clone(), + msg, + funds: vec![minted_coins], + }) .add_attributes([ ("action", "enter_with_hook"), ("next_contract", &contract_address), diff --git a/packages/astroport/src/staking.rs b/packages/astroport/src/staking.rs index d7fad603..cde70ea2 100644 --- a/packages/astroport/src/staking.rs +++ b/packages/astroport/src/staking.rs @@ -1,9 +1,6 @@ use cosmwasm_schema::{cw_serde, QueryResponses}; use cosmwasm_std::{Binary, Uint128}; -/// Enforces gas limit for contracts used in ExecuteMsg::EnterWithHook. -pub const HOOK_GAS_LIMIT: u64 = 1_000_000; - /// This structure describes the parameters used for creating a contract. #[cw_serde] pub struct InstantiateMsg { @@ -25,7 +22,6 @@ pub enum ExecuteMsg { Enter { receiver: Option }, /// Deposits ASTRO in exchange for xASTRO /// and passes **all resulting xASTRO** to defined contract along with an executable message. - /// Note that the next message will be executed with limited gas (see HOOK_GAS_LIMIT). EnterWithHook { contract_address: String, msg: Binary, diff --git a/schemas/astroport-staking/astroport-staking.json b/schemas/astroport-staking/astroport-staking.json index 691010f1..684ae294 100644 --- a/schemas/astroport-staking/astroport-staking.json +++ b/schemas/astroport-staking/astroport-staking.json @@ -1,6 +1,6 @@ { "contract_name": "astroport-staking", - "contract_version": "2.1.0", + "contract_version": "2.2.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", @@ -27,6 +27,7 @@ "type": "string" }, "tracking_code_id": { + "description": "The Code ID of contract used to track the TokenFactory token balances", "type": "integer", "format": "uint64", "minimum": 0.0 @@ -61,6 +62,32 @@ }, "additionalProperties": false }, + { + "description": "Deposits ASTRO in exchange for xASTRO and passes **all resulting xASTRO** to defined contract along with an executable message.", + "type": "object", + "required": [ + "enter_with_hook" + ], + "properties": { + "enter_with_hook": { + "type": "object", + "required": [ + "contract_address", + "msg" + ], + "properties": { + "contract_address": { + "type": "string" + }, + "msg": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Burns xASTRO in exchange for ASTRO", "type": "object", @@ -75,7 +102,13 @@ }, "additionalProperties": false } - ] + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + } + } }, "query": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/schemas/astroport-staking/raw/execute.json b/schemas/astroport-staking/raw/execute.json index 94308306..19ab48c2 100644 --- a/schemas/astroport-staking/raw/execute.json +++ b/schemas/astroport-staking/raw/execute.json @@ -25,6 +25,32 @@ }, "additionalProperties": false }, + { + "description": "Deposits ASTRO in exchange for xASTRO and passes **all resulting xASTRO** to defined contract along with an executable message.", + "type": "object", + "required": [ + "enter_with_hook" + ], + "properties": { + "enter_with_hook": { + "type": "object", + "required": [ + "contract_address", + "msg" + ], + "properties": { + "contract_address": { + "type": "string" + }, + "msg": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Burns xASTRO in exchange for ASTRO", "type": "object", @@ -39,5 +65,11 @@ }, "additionalProperties": false } - ] + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + } + } } diff --git a/schemas/astroport-staking/raw/instantiate.json b/schemas/astroport-staking/raw/instantiate.json index 1e91dc8d..d97ea0a9 100644 --- a/schemas/astroport-staking/raw/instantiate.json +++ b/schemas/astroport-staking/raw/instantiate.json @@ -23,6 +23,7 @@ "type": "string" }, "tracking_code_id": { + "description": "The Code ID of contract used to track the TokenFactory token balances", "type": "integer", "format": "uint64", "minimum": 0.0