diff --git a/contracts/external/cw-abc/README.md b/contracts/external/cw-abc/README.md index a21a96c83..fefe2b859 100644 --- a/contracts/external/cw-abc/README.md +++ b/contracts/external/cw-abc/README.md @@ -18,8 +18,8 @@ Each bonding curve has a pricing function, also known as the price curve (or `cu With bonding curves, we will always know what the price of an asset will be based on supply! More on benefits later. This contract implements two methods: -- `Buy {}` is called with sending along some reserve curency (such as $USDC, or whatever the bonding curve is backed by). The reserve currency is stored by the bonding curve contract, and new tokens are minted and sent to the user. -- `Sell {}` is called along with sending some supply currency (the token minted by the bonding curve). The supply tokens are burned, and reserve curency is returned. +- `Buy {}` is called with sending along some reserve currency (such as $USDC, or whatever the bonding curve is backed by). The reserve currency is stored by the bonding curve contract, and new tokens are minted and sent to the user. +- `Sell {}` is called along with sending some supply currency (the token minted by the bonding curve). The supply tokens are burned, and reserve currency is returned. It is possible to use this contact as a basic bonding curve, without any of the augmented features. @@ -64,7 +64,7 @@ Augmented Bonding Curves are nothing new, some articles that inspired this imple - https://medium.com/commonsstack/deep-dive-augmented-bonding-curves-b5ca4fad4436 - https://tokeneconomy.co/token-bonding-curves-in-practice-3eb904720cb8 -At a high level, augmented bonding curves extend bonding curves with new funcationality: +At a high level, augmented bonding curves extend bonding curves with new functionality: - Entry and exit fees - Different phases representing the life cycles of projects @@ -74,7 +74,7 @@ Example Instantiation message: ``` json { - "fees_recipient": "address that recieves fees", + "fees_recipient": "address that receives fees", "token_issuer_code_id": 0, "supply": { "subdenom": "utokenname", @@ -120,9 +120,9 @@ Example Instantiation message: } ``` -- `fees_recipient`: the address that will recieve fees (usually a DAO). +- `fees_recipient`: the address that will receive fees (usually a DAO). - `token_issuer_code_id`: the CosmWasm code ID for a `cw-tokenfactory_issuer` contract. -- `supply`: infor about the token that will be minted by the curve. This is the token that is created by the bonding curve. +- `supply`: info about the token that will be minted by the curve. This is the token that is created by the bonding curve. - `reserve`: this is the token that is used to mint the supply token. - `curve_type`: information about the pricing curve. - `phase_config`: configuration for the different phase of the augmented bonding curve. diff --git a/contracts/external/cw-abc/schema/cw-abc.json b/contracts/external/cw-abc/schema/cw-abc.json index 624b72d3a..0c30881fa 100644 --- a/contracts/external/cw-abc/schema/cw-abc.json +++ b/contracts/external/cw-abc/schema/cw-abc.json @@ -8,7 +8,6 @@ "type": "object", "required": [ "curve_type", - "fees_recipient", "phase_config", "reserve", "supply" @@ -22,9 +21,12 @@ } ] }, - "fees_recipient": { - "description": "The recipient for any fees collected from bonding curve operation", - "type": "string" + "funding_pool_forwarding": { + "description": "An optional address for automatically forwarding funding pool gains", + "type": [ + "string", + "null" + ] }, "hatcher_allowlist": { "description": "TODO different ways of doing this, for example DAO members? Using a whitelist contract? Merkle tree? Hatcher allowlist", @@ -563,7 +565,7 @@ "additionalProperties": false }, { - "description": "Donate will add reserve tokens to the funding pool", + "description": "Donate will donate tokens to the funding pool. You must send only reserve tokens.", "type": "object", "required": [ "donate" @@ -576,6 +578,33 @@ }, "additionalProperties": false }, + { + "description": "Withdraw will withdraw tokens from the funding pool.", + "type": "object", + "required": [ + "withdraw" + ], + "properties": { + "withdraw": { + "type": "object", + "properties": { + "amount": { + "description": "The amount to withdraw (defaults to full amount).", + "anyOf": [ + { + "$ref": "#/definitions/Uint128" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Sets (or unsets if set to None) the maximum supply", "type": "object", @@ -626,7 +655,7 @@ "additionalProperties": false }, { - "description": "Update the hatch phase allowlist. This can only be called by the owner.", + "description": "Update the hatch phase allowlist. Only callable by owner.", "type": "object", "required": [ "update_hatch_allowlist" @@ -659,6 +688,29 @@ }, "additionalProperties": false }, + { + "description": "Update the funding pool forwarding. Only callable by owner.", + "type": "object", + "required": [ + "update_funding_pool_forwarding" + ], + "properties": { + "update_funding_pool_forwarding": { + "type": "object", + "properties": { + "address": { + "description": "The address to receive the funding pool forwarding. Set to None to stop forwarding.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Update the configuration of a certain phase. This can only be called by the owner.", "type": "object", @@ -1114,13 +1166,13 @@ "additionalProperties": false }, { - "description": "Returns the Fee Recipient for the contract. This is the address that receives any fees collected from bonding curve operation", + "description": "Returns the funding pool forwarding config for the contract. This is the address that receives any fees collected from bonding curve operation and donations", "type": "object", "required": [ - "fees_recipient" + "funding_pool_forwarding" ], "properties": { - "fees_recipient": { + "funding_pool_forwarding": { "type": "object", "additionalProperties": false } @@ -1471,11 +1523,23 @@ } } }, - "fees_recipient": { + "funding_pool_forwarding": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Addr", - "description": "A human readable address.\n\nIn 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.\n\nThis 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.\n\nThis 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": "string" + "title": "Nullable_Addr", + "anyOf": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "null" + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn 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.\n\nThis 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.\n\nThis 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": "string" + } + } }, "hatcher_allowlist": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/contracts/external/cw-abc/src/commands.rs b/contracts/external/cw-abc/src/commands.rs index 1dd1d5ced..f75d712ea 100644 --- a/contracts/external/cw-abc/src/commands.rs +++ b/contracts/external/cw-abc/src/commands.rs @@ -9,8 +9,8 @@ use std::ops::Deref; use crate::abc::{CommonsPhase, CurveType}; use crate::msg::UpdatePhaseConfigMsg; use crate::state::{ - CURVE_STATE, CURVE_TYPE, DONATIONS, FEES_RECIPIENT, HATCHERS, HATCHER_ALLOWLIST, MAX_SUPPLY, - PHASE, PHASE_CONFIG, SUPPLY_DENOM, TOKEN_ISSUER_CONTRACT, + CURVE_STATE, CURVE_TYPE, DONATIONS, FUNDING_POOL_FORWARDING, HATCHERS, HATCHER_ALLOWLIST, + MAX_SUPPLY, PHASE, PHASE_CONFIG, SUPPLY_DENOM, TOKEN_ISSUER_CONTRACT, }; use crate::ContractError; @@ -67,7 +67,6 @@ pub fn execute_buy(deps: DepsMut, _env: Env, info: MessageInfo) -> Result Result = vec![CosmosMsg::Wasm(WasmMsg::Execute { @@ -99,16 +94,23 @@ pub fn execute_buy(deps: DepsMut, _env: Env, info: MessageInfo) -> Result Uint128::zero() { - let fees_recipient = FEES_RECIPIENT.load(deps.storage)?; - msgs.push(CosmosMsg::Bank(BankMsg::Send { - to_address: fees_recipient.to_string(), - amount: vec![Coin { - amount: funded, - denom: curve_state.reserve_denom, - }], - })) + if let Some(funding_pool_forwarding) = FUNDING_POOL_FORWARDING.may_load(deps.storage)? { + msgs.push(CosmosMsg::Bank(BankMsg::Send { + to_address: funding_pool_forwarding.to_string(), + amount: vec![Coin { + amount: funded, + denom: curve_state.reserve_denom.clone(), + }], + })) + } else { + curve_state.funding += funded; + } }; + // Save the new curve state + curve_state.supply = new_supply; + CURVE_STATE.save(deps.storage, &curve_state)?; + Ok(Response::new() .add_messages(msgs) .add_attribute("action", "buy") @@ -203,8 +205,6 @@ pub fn execute_sell( // Update the curve state curve_state.reserve = new_reserve; - curve_state.funding += taxed_amount; - CURVE_STATE.save(deps.storage, &curve_state)?; // Calculate the amount of tokens to send to the sender // Subtract the taxed amount from the released amount @@ -223,16 +223,22 @@ pub fn execute_sell( // Send exit fees to the to the fee recipient if taxed_amount > Uint128::zero() { - let fees_recipient = FEES_RECIPIENT.load(deps.storage)?; - send_msgs.push(CosmosMsg::Bank(BankMsg::Send { - to_address: fees_recipient.to_string(), - amount: vec![Coin { - amount: taxed_amount, - denom: curve_state.reserve_denom, - }], - })) + if let Some(funding_pool_forwarding) = FUNDING_POOL_FORWARDING.may_load(deps.storage)? { + send_msgs.push(CosmosMsg::Bank(BankMsg::Send { + to_address: funding_pool_forwarding.to_string(), + amount: vec![Coin { + amount: taxed_amount, + denom: curve_state.reserve_denom.clone(), + }], + })) + } else { + curve_state.funding += taxed_amount; + } } + // Save the curve state + CURVE_STATE.save(deps.storage, &curve_state)?; + Ok(Response::new() .add_messages(burn_msgs) .add_messages(send_msgs) @@ -288,8 +294,18 @@ pub fn execute_donate( let mut curve_state = CURVE_STATE.load(deps.storage)?; let payment = must_pay(&info, &curve_state.reserve_denom)?; - curve_state.funding += payment; - CURVE_STATE.save(deps.storage, &curve_state)?; + + let mut msgs = vec![]; + if let Some(funding_pool_forwarding) = FUNDING_POOL_FORWARDING.may_load(deps.storage)? { + msgs.push(CosmosMsg::Bank(BankMsg::Send { + to_address: funding_pool_forwarding.to_string(), + amount: info.funds, + })); + } else { + curve_state.funding += payment; + + CURVE_STATE.save(deps.storage, &curve_state)?; + } // No minting of tokens is necessary, the supply stays the same DONATIONS.save(deps.storage, &info.sender, &payment)?; @@ -297,7 +313,69 @@ pub fn execute_donate( Ok(Response::new() .add_attribute("action", "donate") .add_attribute("donor", info.sender) - .add_attribute("amount", payment)) + .add_attribute("amount", payment) + .add_messages(msgs)) +} + +/// Withdraw funds from the funding pool (only callable by owner) +pub fn execute_withdraw( + deps: DepsMut, + _env: Env, + info: MessageInfo, + amount: Option, +) -> Result { + // Validate ownership + cw_ownable::assert_owner(deps.storage, &info.sender)?; + + let mut curve_state = CURVE_STATE.load(deps.storage)?; + + // Get amount to withdraw + let amount = amount.unwrap_or(curve_state.funding); + + // Construct the withdraw message + let msg = CosmosMsg::Bank(BankMsg::Send { + to_address: info.sender.to_string(), + amount: vec![Coin { + denom: curve_state.reserve_denom.clone(), + amount, + }], + }); + + // Update the curve state + curve_state.funding = curve_state + .funding + .checked_sub(amount) + .map_err(StdError::overflow)?; + CURVE_STATE.save(deps.storage, &curve_state)?; + + Ok(Response::new() + .add_attribute("action", "withdraw") + .add_attribute("withdrawer", info.sender) + .add_attribute("amount", amount) + .add_message(msg)) +} + +/// Updates the funding pool forwarding (only callable by owner) +pub fn execute_update_funding_pool_forwarding( + deps: DepsMut, + _env: Env, + info: MessageInfo, + address: Option, +) -> Result { + // Validate ownership + cw_ownable::assert_owner(deps.storage, &info.sender)?; + + // Update the funding pool forwarding + match &address { + Some(address) => { + FUNDING_POOL_FORWARDING.save(deps.storage, &deps.api.addr_validate(address)?)?; + } + None => FUNDING_POOL_FORWARDING.remove(deps.storage), + }; + + Ok(Response::new() + .add_attribute("action", "update_funding_pool_forwarding") + .add_attribute("address", address.unwrap_or_default())) } /// Check if the sender is allowlisted for the hatch phase @@ -478,7 +556,7 @@ mod tests { mod donate { use super::*; use crate::abc::CurveType; - use crate::testing::mock_init; + use crate::testing::{mock_init, TEST_CREATOR}; use cosmwasm_std::coin; use cw_utils::PaymentError; @@ -535,7 +613,7 @@ mod tests { } #[test] - fn should_add_to_funding_pool() -> Result<(), ContractError> { + fn should_add_to_funding_pool_and_withdraw() -> Result<(), ContractError> { let mut deps = mock_dependencies(); // this matches `linear_curve` test case from curves.rs let curve_type = CurveType::SquareRoot { @@ -556,6 +634,45 @@ mod tests { let donation = DONATIONS.load(&deps.storage, &Addr::unchecked(TEST_DONOR))?; assert_that!(donation).is_equal_to(Uint128::new(donation_amount)); + // check that the owner can withdraw + execute_withdraw( + deps.as_mut(), + mock_env(), + mock_info(TEST_CREATOR, &[]), + None, + )?; + + // check that a random can't withdraw + let res = execute_withdraw(deps.as_mut(), mock_env(), mock_info("random", &[]), None); + assert!(res.is_err()); + + Ok(()) + } + + #[test] + fn should_send_to_funding_pool_forwarding() -> Result<(), ContractError> { + let mut deps = mock_dependencies(); + // this matches `linear_curve` test case from curves.rs + let curve_type = CurveType::SquareRoot { + slope: Uint128::new(1), + scale: 1, + }; + let mut init_msg = default_instantiate_msg(2, 8, curve_type); + init_msg.funding_pool_forwarding = Some(TEST_CREATOR.to_string()); + mock_init(deps.as_mut(), init_msg)?; + + let donation_amount = 5; + let _res = exec_donate(deps.as_mut(), donation_amount)?; + + // Check that the funding pool did not increase, because it was sent to the funding pool forwarding + // NOTE: the balance cannot be checked with mock_dependencies + let curve_state = CURVE_STATE.load(&deps.storage)?; + assert_that!(curve_state.funding).is_equal_to(Uint128::zero()); + + // check that the donor is in the donations map + let donation = DONATIONS.load(&deps.storage, &Addr::unchecked(TEST_DONOR))?; + assert_that!(donation).is_equal_to(Uint128::new(donation_amount)); + Ok(()) } } diff --git a/contracts/external/cw-abc/src/contract.rs b/contracts/external/cw-abc/src/contract.rs index edba2d055..d595f6443 100644 --- a/contracts/external/cw-abc/src/contract.rs +++ b/contracts/external/cw-abc/src/contract.rs @@ -16,7 +16,7 @@ use crate::curves::DecimalPlaces; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; use crate::state::{ - CurveState, CURVE_STATE, CURVE_TYPE, FEES_RECIPIENT, HATCHER_ALLOWLIST, MAX_SUPPLY, + CurveState, CURVE_STATE, CURVE_TYPE, FUNDING_POOL_FORWARDING, HATCHER_ALLOWLIST, MAX_SUPPLY, NEW_TOKEN_INFO, PHASE, PHASE_CONFIG, SUPPLY_DENOM, TOKEN_ISSUER_CONTRACT, }; use crate::{commands, queries}; @@ -37,7 +37,7 @@ pub fn instantiate( set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; let InstantiateMsg { - fees_recipient, + funding_pool_forwarding, supply, reserve, curve_type, @@ -47,8 +47,13 @@ pub fn instantiate( phase_config.validate()?; - // Validate and store the fees recipient - FEES_RECIPIENT.save(deps.storage, &deps.api.addr_validate(&fees_recipient)?)?; + // Validate and store the funding pool forwarding + if let Some(funding_pool_forwarding) = funding_pool_forwarding { + FUNDING_POOL_FORWARDING.save( + deps.storage, + &deps.api.addr_validate(&funding_pool_forwarding)?, + )?; + } if let TokenInfo::New(new_token_info) = &supply.token_info { if new_token_info.subdenom.is_empty() { @@ -163,6 +168,10 @@ pub fn execute( ExecuteMsg::Sell {} => commands::execute_sell(deps, env, info), ExecuteMsg::Close {} => commands::execute_close(deps, info), ExecuteMsg::Donate {} => commands::execute_donate(deps, env, info), + ExecuteMsg::Withdraw { amount } => commands::execute_withdraw(deps, env, info, amount), + ExecuteMsg::UpdateFundingPoolForwarding { address } => { + commands::execute_update_funding_pool_forwarding(deps, env, info, address) + } ExecuteMsg::UpdateMaxSupply { max_supply } => { commands::update_max_supply(deps, info, max_supply) } @@ -200,7 +209,9 @@ pub fn do_query(deps: Deps, _env: Env, msg: QueryMsg, curve_fn: CurveFn) -> StdR QueryMsg::Donations { start_after, limit } => { to_json_binary(&queries::query_donations(deps, start_after, limit)?) } - QueryMsg::FeesRecipient {} => to_json_binary(&FEES_RECIPIENT.load(deps.storage)?), + QueryMsg::FundingPoolForwarding {} => { + to_json_binary(&FUNDING_POOL_FORWARDING.may_load(deps.storage)?) + } QueryMsg::Hatchers { start_after, limit } => { to_json_binary(&queries::query_hatchers(deps, start_after, limit)?) } @@ -343,17 +354,36 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result StdResult<_> { + curve_state.funding = initial_dao_balance; + + Ok(curve_state) + }, + )?; + msgs.push(WasmMsg::Execute { + contract_addr: issuer_addr.clone(), + msg: to_json_binary(&IssuerExecuteMsg::Mint { + to_address: env.contract.address.to_string(), + amount: initial_dao_balance, + })?, + funds: vec![], + }); + } } } diff --git a/contracts/external/cw-abc/src/msg.rs b/contracts/external/cw-abc/src/msg.rs index efcafd630..dd70886fd 100644 --- a/contracts/external/cw-abc/src/msg.rs +++ b/contracts/external/cw-abc/src/msg.rs @@ -5,8 +5,8 @@ use crate::abc::{CommonsPhase, CommonsPhaseConfig, CurveType, MinMax, ReserveTok #[cw_serde] pub struct InstantiateMsg { - /// The recipient for any fees collected from bonding curve operation - pub fees_recipient: String, + /// An optional address for automatically forwarding funding pool gains + pub funding_pool_forwarding: Option, /// Supply token information pub supply: SupplyToken, @@ -57,8 +57,14 @@ pub enum ExecuteMsg { /// Sell burns supply tokens in return for the reserve token. /// You must send only supply tokens. Sell {}, - /// Donate will add reserve tokens to the funding pool + /// Donate will donate tokens to the funding pool. + /// You must send only reserve tokens. Donate {}, + /// Withdraw will withdraw tokens from the funding pool. + Withdraw { + /// The amount to withdraw (defaults to full amount). + amount: Option, + }, /// Sets (or unsets if set to None) the maximum supply UpdateMaxSupply { /// The maximum supply able to be minted. @@ -69,13 +75,20 @@ pub enum ExecuteMsg { /// TODO think about other potential limitations on this. UpdateCurve { curve_type: CurveType }, /// Update the hatch phase allowlist. - /// This can only be called by the owner. + /// Only callable by owner. UpdateHatchAllowlist { /// Addresses to be added. to_add: Vec, /// Addresses to be removed. to_remove: Vec, }, + /// Update the funding pool forwarding. + /// Only callable by owner. + UpdateFundingPoolForwarding { + /// The address to receive the funding pool forwarding. + /// Set to None to stop forwarding. + address: Option, + }, /// Update the configuration of a certain phase. /// This can only be called by the owner. UpdatePhaseConfig(UpdatePhaseConfigMsg), @@ -106,10 +119,10 @@ pub enum QueryMsg { start_after: Option, limit: Option, }, - /// Returns the Fee Recipient for the contract. This is the address that - /// receives any fees collected from bonding curve operation - #[returns(::cosmwasm_std::Addr)] - FeesRecipient {}, + /// Returns the funding pool forwarding config for the contract. This is the address that + /// receives any fees collected from bonding curve operation and donations + #[returns(Option<::cosmwasm_std::Addr>)] + FundingPoolForwarding {}, /// List the hatchers and their contributions /// Returns [`HatchersResponse`] #[returns(HatchersResponse)] diff --git a/contracts/external/cw-abc/src/state.rs b/contracts/external/cw-abc/src/state.rs index 048fa9258..5ccc2f55b 100644 --- a/contracts/external/cw-abc/src/state.rs +++ b/contracts/external/cw-abc/src/state.rs @@ -40,8 +40,8 @@ pub const CURVE_STATE: Item = Item::new("curve_state"); pub const CURVE_TYPE: Item = Item::new("curve_type"); -/// The recipient for fees generated from bonding curve operation -pub const FEES_RECIPIENT: Item = Item::new("fees_recipient"); +/// The address for automatically forwarding funding pool gains +pub const FUNDING_POOL_FORWARDING: Item = Item::new("funding_pool_forwarding"); /// The denom used for the supply token pub const SUPPLY_DENOM: Item = Item::new("denom"); diff --git a/contracts/external/cw-abc/src/test_tube/integration_tests.rs b/contracts/external/cw-abc/src/test_tube/integration_tests.rs index 1b43bb9ca..55a15c85d 100644 --- a/contracts/external/cw-abc/src/test_tube/integration_tests.rs +++ b/contracts/external/cw-abc/src/test_tube/integration_tests.rs @@ -281,7 +281,7 @@ fn test_allowlist() { let app = OsmosisTestApp::new(); let builder = TestEnvBuilder::new(); let instantiate_msg = InstantiateMsg { - fees_recipient: "replaced to accounts[0]".to_string(), + funding_pool_forwarding: Some("replaced to accounts[0]".to_string()), supply: SupplyToken { token_info: TokenInfo::New(NewTokenInfo { token_issuer_code_id: 0, @@ -527,7 +527,7 @@ fn test_existing_token_failures() { // The tokenfactory token does not exist - fails in supply query let mut instantiate_msg = InstantiateMsg { - fees_recipient: "replaced to accounts[0]".to_string(), + funding_pool_forwarding: Some("replaced to accounts[0]".to_string()), supply: SupplyToken { token_info: TokenInfo::Existing { denom: "factory/address/nonexistent".to_string(), @@ -592,7 +592,7 @@ fn test_existing_token() { let result = builder.setup_with_token( &app, InstantiateMsg { - fees_recipient: "replaced to accounts[0]".to_string(), + funding_pool_forwarding: Some("replaced to accounts[0]".to_string()), supply: SupplyToken { token_info: TokenInfo::Existing { denom: "replaced".to_string(), diff --git a/contracts/external/cw-abc/src/test_tube/test_env.rs b/contracts/external/cw-abc/src/test_tube/test_env.rs index b0eb95b67..865c20357 100644 --- a/contracts/external/cw-abc/src/test_tube/test_env.rs +++ b/contracts/external/cw-abc/src/test_tube/test_env.rs @@ -106,7 +106,7 @@ impl TestEnvBuilder { let abc = CwAbc::deploy( app, &InstantiateMsg { - fees_recipient: accounts[0].address(), + funding_pool_forwarding: Some(accounts[0].address()), supply: SupplyToken { token_info: TokenInfo::New(NewTokenInfo { token_issuer_code_id: issuer_id, @@ -179,7 +179,7 @@ impl TestEnvBuilder { new_token_info.token_issuer_code_id = issuer_id; } - msg.fees_recipient = accounts[0].address(); + msg.funding_pool_forwarding = Some(accounts[0].address()); let abc = CwAbc::deploy(app, &msg, &accounts[0])?; @@ -212,7 +212,7 @@ impl TestEnvBuilder { &accounts[0], )?; - msg.fees_recipient = accounts[0].address(); + msg.funding_pool_forwarding = Some(accounts[0].address()); msg.supply.token_info = TokenInfo::Existing { denom: format!("factory/{}/{}", tf_issuer.contract_addr, "subdenom"), diff --git a/contracts/external/cw-abc/src/testing.rs b/contracts/external/cw-abc/src/testing.rs index 29adc1bfd..ff204ae9a 100644 --- a/contracts/external/cw-abc/src/testing.rs +++ b/contracts/external/cw-abc/src/testing.rs @@ -42,7 +42,7 @@ pub fn default_instantiate_msg( curve_type: CurveType, ) -> InstantiateMsg { InstantiateMsg { - fees_recipient: TEST_CREATOR.to_string(), + funding_pool_forwarding: None, supply: SupplyToken { token_info: TokenInfo::New(NewTokenInfo { token_issuer_code_id: 1, diff --git a/contracts/external/dao-abc-factory/src/test_tube/test_env.rs b/contracts/external/dao-abc-factory/src/test_tube/test_env.rs index 03fe3fa9c..88dd27655 100644 --- a/contracts/external/dao-abc-factory/src/test_tube/test_env.rs +++ b/contracts/external/dao-abc-factory/src/test_tube/test_env.rs @@ -136,7 +136,7 @@ impl TestEnvBuilder { contract_addr: dao_abc_factory.contract_addr.clone(), msg: to_json_binary(&ExecuteMsg::AbcFactory { instantiate_msg: cw_abc::msg::InstantiateMsg { - fees_recipient: accounts[0].address(), + funding_pool_forwarding: Some(accounts[0].address()), supply: SupplyToken { token_info: TokenInfo::New(NewTokenInfo { @@ -254,7 +254,7 @@ impl TestEnvBuilder { contract_addr: dao_abc_factory.contract_addr.clone(), msg: to_json_binary(&ExecuteMsg::AbcFactory { instantiate_msg: cw_abc::msg::InstantiateMsg { - fees_recipient: accounts[0].address(), + funding_pool_forwarding: Some(accounts[0].address()), supply: SupplyToken { token_info: TokenInfo::New(NewTokenInfo { token_issuer_code_id: issuer_id,