Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flag for cw20 support in dao-core. #571

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Conversation

0xekez
Copy link
Contributor

@0xekez 0xekez commented Dec 13, 2022

This puts cw20 support in the dao-core contract behind a feature flag. The feature is not enabled by default, so for DAOs that want to use cw20s this is a no-op.

As part of this change I have also added lints and tests to CI which run with no default features enabled so we will detect regressions if a future change depends on cw20 support, but does not properly gate itself behind the feature flag.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2022

Codecov Report

Base: 95.06% // Head: 95.06% // No change to project coverage 👍

Coverage data is based on head (3432ddf) compared to base (74bd388).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #571   +/-   ##
=======================================
  Coverage   95.06%   95.06%           
=======================================
  Files          42       42           
  Lines        3808     3808           
=======================================
  Hits         3620     3620           
  Misses        188      188           
Impacted Files Coverage Δ
contracts/dao-core/src/contract.rs 97.55% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

github-actions bot commented Dec 14, 2022

Cosm-Orc Gas Usage

Contract Op Name Gas Used Old Gas Used Gas Diff File
cw721_base Instantiate__instantiate_cw721_base 164837 163837 +0.6104% ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:22
cw721_base Store__Store 3369402 28006860 -87.9694% ci/integration-tests/src/helpers/chain.rs:97
dao_voting_cw721_staked Instantiate__instantiate_dao_voting_cw721_staked 179007 178007 +0.5618% ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:49
dao_voting_cw721_staked Execute__claim_nfts 5710869 8103298 -29.5241% ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:120
dao_voting_cw721_staked Store__Store 3326008 27639680 -87.9665% ci/integration-tests/src/helpers/chain.rs:97
dao_core Store__Store 5628490 47122220 -88.0556% ci/integration-tests/src/helpers/chain.rs:97
multiple_contracts Execute__batch_cw721_stake_max_claims 4196439 43191012 -90.2840% ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:251
cw20_base Store__Store 4141992 34544160 -88.0096% ci/integration-tests/src/helpers/chain.rs:97
cw20_stake Store__Store 3589024 29865200 -87.9826% ci/integration-tests/src/helpers/chain.rs:97
cw4_group Store__Store 2781763 23034530 -87.9235% ci/integration-tests/src/helpers/chain.rs:97
cw_admin_factory Store__Store 2003453 16448830 -87.8201% ci/integration-tests/src/helpers/chain.rs:97
cw_token_swap Store__Store 2371616 19515145 -87.8473% ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_approval_single Store__Store 4903233 40985430 -88.0366% ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_approver Store__Store 3659835 30464370 -87.9865% ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_multiple Store__Store 4233291 35316690 -88.0133% ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_single Store__Store 4154927 34653610 -88.0101% ci/integration-tests/src/helpers/chain.rs:97
dao_proposal_multiple Store__Store 6360962 53320060 -88.0702% ci/integration-tests/src/helpers/chain.rs:97
dao_proposal_single Store__Store 6655269 55810350 -88.0752% ci/integration-tests/src/helpers/chain.rs:97
dao_voting_cw20_staked Store__Store 3621797 30142510 -87.9844% ci/integration-tests/src/helpers/chain.rs:97
dao_voting_cw4 Store__Store 2670847 22096010 -87.9125% ci/integration-tests/src/helpers/chain.rs:97
dao_voting_native_staked Store__Store 2951790 24473220 -87.9387% ci/integration-tests/src/helpers/chain.rs:97
dao_voting_staking_denom_staked Store__Store 2196893 18085630 -87.8528% ci/integration-tests/src/helpers/chain.rs:97
stake_cw20_external_rewards Store__Store 3097923 25709730 -87.9504% ci/integration-tests/src/helpers/chain.rs:97
stake_cw20_reward_distributor Store__Store 2431608 20071680 -87.8854% ci/integration-tests/src/helpers/chain.rs:97
Raw Report for 3432ddf
Contract Op Name Gas Used Gas Wanted File
cw721_base Execute__mint_nft 140542 188097 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:87
cw721_base Execute__stake_nft 234591 329168 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:70
cw721_base Instantiate__instantiate_cw721_base 164837 224540 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:22
cw721_base Store__Store 3369402 5031314 ci/integration-tests/src/helpers/chain.rs:97
dao_voting_cw721_staked Execute__unstake_nfts 230319 322760 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:105
dao_voting_cw721_staked Instantiate__instantiate_dao_voting_cw721_staked 179007 245795 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:49
dao_voting_cw721_staked Execute__claim_nfts 5710869 8543393 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:120
dao_voting_cw721_staked Store__Store 3326008 4966223 ci/integration-tests/src/helpers/chain.rs:97
dao_core Instantiate__inst_dao_no_admin 1207428 1788344 ci/integration-tests/src/helpers/helper.rs:98
dao_core Store__Store 5628490 8419946 ci/integration-tests/src/helpers/chain.rs:97
dao_core Instantiate__inst_admin_create_dao 1208479 1789917 ci/integration-tests/src/helpers/helper.rs:98
dao_core Execute__exc_items_rm 192820 266513 ci/integration-tests/src/tests/cw_core_test.rs:171
dao_core Execute__exc_items_set 194488 269013 ci/integration-tests/src/tests/cw_core_test.rs:136
dao_core Instantiate__exc_items_create_dao 1208479 1789917 ci/integration-tests/src/helpers/helper.rs:98
dao_core Instantiate__exc_stake_create_dao 1207404 1788308 ci/integration-tests/src/helpers/helper.rs:98
dao_core Execute__exc_admin_msgs_pause_dao 194613 269202 ci/integration-tests/src/tests/cw_core_test.rs:76
dao_core Instantiate__exc_admin_msgs_create_dao 1207428 1788344 ci/integration-tests/src/helpers/helper.rs:98
dao_core Instantiate__exc_admin_msgs_create_dao_with_admin 1208479 1789917 ci/integration-tests/src/helpers/helper.rs:98
multiple_contracts Execute__batch_cw721_stake_max_claims 4196439 6254235 ci/integration-tests/src/tests/dao_voting_cw721_staked_test.rs:251
cw20_base Store__Store 4141992 6190199 ci/integration-tests/src/helpers/chain.rs:97
cw20_base Execute__exc_stake_stake_tokens 234798 321347 ci/integration-tests/src/tests/cw20_stake_test.rs:76
cw20_stake Store__Store 3589024 5360747 ci/integration-tests/src/helpers/chain.rs:97
cw4_group Store__Store 2781763 4149855 ci/integration-tests/src/helpers/chain.rs:97
cw_admin_factory Store__Store 2003453 2982390 ci/integration-tests/src/helpers/chain.rs:97
cw_token_swap Store__Store 2371616 3534630 ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_approval_single Store__Store 4903233 7332060 ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_approver Store__Store 3659835 5466963 ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_multiple Store__Store 4233291 6327147 ci/integration-tests/src/helpers/chain.rs:97
dao_pre_propose_single Store__Store 4154927 6209601 ci/integration-tests/src/helpers/chain.rs:97
dao_proposal_multiple Store__Store 6360962 9518654 ci/integration-tests/src/helpers/chain.rs:97
dao_proposal_single Store__Store 6655269 9960114 ci/integration-tests/src/helpers/chain.rs:97
dao_voting_cw20_staked Store__Store 3621797 5409906 ci/integration-tests/src/helpers/chain.rs:97
dao_voting_cw4 Store__Store 2670847 3983481 ci/integration-tests/src/helpers/chain.rs:97
dao_voting_native_staked Store__Store 2951790 4404896 ci/integration-tests/src/helpers/chain.rs:97
dao_voting_staking_denom_staked Store__Store 2196893 3272550 ci/integration-tests/src/helpers/chain.rs:97
stake_cw20_external_rewards Store__Store 3097923 4624095 ci/integration-tests/src/helpers/chain.rs:97
stake_cw20_reward_distributor Store__Store 2431608 3624623 ci/integration-tests/src/helpers/chain.rs:97

Copy link
Member

@JakeHartnell JakeHartnell left a comment

Choose a reason for hiding this comment

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

HELL YEAH. ❤️

@0xekez 0xekez merged commit 9afa125 into main Dec 14, 2022
@0xekez 0xekez deleted the zeke/cw20-flag branch December 14, 2022 21:14
0xekez added a commit that referenced this pull request Dec 16, 2022
JakeHartnell pushed a commit that referenced this pull request Dec 17, 2022
* Revert "Add feature flag for cw20 support in dao-core. (#571)"

This reverts commit 9afa125.

* Add documentation about dao-core treasury management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants