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

[1.0.rc-1] Crowdfund End Sale #324

Merged
merged 3 commits into from
Mar 14, 2024
Merged

[1.0.rc-1] Crowdfund End Sale #324

merged 3 commits into from
Mar 14, 2024

Conversation

joemonem
Copy link
Contributor

Motivation

Reaching the minimum tokens sold threshold wasn't considered in allowing the ending of a sale in the Crowdfund ADO.

Implementation

Alongside checking the expiration and if the number of tokens available is zero, I added a check to see if the minimum tokens sold threshold is met AND that the contract owner is the one calling the function.
The function doesn't check who's calling it, and that wasn't a problem while we only checked for expiration or zero tokens. But with minimum tokens sold, there's a real decision to be made i.e: the sale could continue and still sell more tokens.
Only the owner should be able to make that decision, otherwise if one of the two original conditions are met, anyone can end the sale.

Testing

Added two unit tests that check for authorization, unmet thresholds, and working conditions.

Notes

We could create new ContractErrors to be more precise in the owner-minimum tokens sold situation.

Copy link
Contributor

@crnbarr93 crnbarr93 left a comment

Choose a reason for hiding this comment

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

One small change

@@ -568,9 +568,15 @@ fn execute_end_sale(ctx: ExecuteContext, limit: Option<u32>) -> Result<Response,
ensure!(state.is_some(), ContractError::NoOngoingSale {});
let state = state.unwrap();
let number_of_tokens_available = NUMBER_OF_TOKENS_AVAILABLE.load(deps.storage)?;
// In case the minimum sold tokens threshold is met, it has to be the owner who calls the function
let contract = ADOContract::default();
let minimum_and_owner = state.min_tokens_sold <= state.amount_sold
Copy link
Contributor

Choose a reason for hiding this comment

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

I think for readability we should separate these

Suggested change
let minimum_and_owner = state.min_tokens_sold <= state.amount_sold
let has_minimum_sold = state.min_tokens_sold <= state.amount_sold;
let is_owner = contract.is_contract_owner(deps. storage, info.sender.as_str())?;

@crnbarr93 crnbarr93 merged commit 0dd0696 into 1.0.rc-1 Mar 14, 2024
3 of 4 checks passed
@crnbarr93 crnbarr93 deleted the joe/crowdfund-end-sale branch March 14, 2024 11:45
crnbarr93 added a commit that referenced this pull request Apr 22, 2024
* Removed unused directory

* [RES-16] Added update kernel message

* [RES-01] Added some module checks

* [RES-02] Added check that a module is an ADO on registration

* [RES-03] Removed remainder from amount sent to seller in exchange

* [RES-08] Added address validatin for app update_address

* [RES-11] Added token address authorisation to cw721 auction

* [RES-12] Added denom validation to cw721 auction

* [RES-19] Added check for app component length

* [RES-20] Added check for same token to token exchange

* [RES-21] Clarity for decimal returns in allowed_withdrawal_percent

* [RES-22] Added check for timestamp in past

* Added test for query withdrawal percent in lockdrop

* [RES-05] Removed lockdrop owner restriction on withdrawals

* Removed unused code

* New Ownership Process (#260)

* Updated ownership process

* Added expiring ownership offer

* Linting

* Fixed failing test

* [AND-01] Altered multichain app to use target chain instead of currchain

* [AND-01] Added test and fixed symlink references

* [AND-02] Added ensure check for ownership on restricted permissioning messages

* [AND-03] Removed App/ADO fee payments

* [AND-04] Added ensure check in validate_andr_addresses

* [ANDR-05] Added length check to username regex

* [AND-06] Added handling for case with multiple duplicate denoms in merge/deduct coins

* [AND-07] Improved funds handling in kernel local handling

* [AND-8] updated action fees to be associated to ado type

* [ANDR-09] Altered how paths are resolved

* Added TODO from AND-07/11

* [AND-12] Improved channel/chain two way mapping

* [AND-16] Added error handling for no channel info when sending ibc message

* Save ado_version.get_type() instead of ado_version in store_code_id and removed .clone() from it

* empty funds route to handle_ibc_hooks, funds route to handle_ibc_direct

* revert commit 5d44dde

* [RES-01] Default modules to empty vector on instantiation

* [RES-05] Removed deprecating withdrawal amount from lockdrop

* [RES-13] Added message to update token contract

* [RES-13] Added test for finding 13

* [RES-22] In marketplace user must provide exact payment

* Fixed failing test from [RES-22]

* [RES-22] Ensure provided amount is exact

* Linting

* component name can't be '.' AND-34

* usernames that are a valid CosmWasm address must be the same as info.sender's address + unit tests AND-41

* added underflow check for consume_use in permissioning AND-37

* removed tilde symbol check from resolve_lib_path

* ado type can no longer be empty or made of only spaces AND-32

* PATH_REGEX now includes paths that start with './'  + unit tests AND-31

* [AND-21] Added limit to path parts length

* [AND-22] Added validation on fee string

* Linting

* [AND-25] Inverted boolean check in handle ibc direct

* [AND-27] Added version checking in adodb publish

* [AND-17] Added asset validation method to ActionFee

* [AND-29] Fixed issue with vfs removing incorrect username

* [AND-30] Added check if username taken

* owner_or_operator checks for add_withdrawable_token and remove_withdrawable_token, and added documentation for them AND-39

* reply function for economics contract, exact behavior tbd AND-33

* [AND-23] Restricted AddParentPath to app contract and renamed it

* test_claim_ownership_all() now passes, execute_claim tests were already passing, cw20_staking replace unwrap() with ? AND-38

* [AND-27] Rewrote vfs path resolving to prevent loops

* updated test_reply_assign_app AND-38

* check if funds are empty before creating SubMsg in handle_local AND-38

* findings concerning vault balance check for test_crowdfund_app

* removed dated todos and unnecesssary check AND-38

* removed commented out todo from kernel execute.rs AND-38

* only verified ADOs can access the kernel's amp_receive AND-42

* test_handle_ibc_direct adjustment AND-42

* Linting

* replaced most addition operations of Uint128 with checked_add() AND-37

* replaced all subtraction operations with checked_sub() AND-37

* Unpublish function for ADODB with unit test and schema update AND-35

* linting

* additional safe math implementations AND-37

* additional checks in kernel integration test to see if Send is working as expected

* Added alphanumeric check to component name

* check for AMPReceive's verify address in the kernel

* linting

* adodb saves unpublished code ids, prevents republishing of unpublished code ids, includes unit test

* linting

* adodb keeps track of unpublished versions of corresponding ADO types, prevents their republishing. With unit test

* unpublished code ids and versions are now stored in a Map

* no longer overwriting the response in the kernel's amp_receive

* linting

* disabled cross chain components in the kernel's handler. Addresses #283

* Revert "disabled cross chain components in the kernel's handler. Addresses #283"

This reverts commit a769989.

* ibc_create_ado always errors and kernel's create() errors if a chain is provided. Addresses #283

* ADODB Unpublish changes and testing

* Fixed error passing for amp_receive

* Kernel Direct Send (#285)

* Added direct sending from kernel

* Linting

* Added check for funds in kernel routing

* Added a fix for dispersed coins in "has coins" check

* Linting

* Linting

* Linting

* Crate version update

* 268 cw20 exchange extended options in startsale struct (#272)

* added optional start time and duration + unit tests + schema update

* Addresses #269 added start_time in Sale for cw20-exchange

* linting

* save start_time as current block time + 1 instead of setting it as Never in case it isn't provided

* linting and comment adjustment

* Addresses #267 refund original token instead of sale token when cancelling sale

* changed claim ownership's new_owner field from Option<Addr> to Option<AndrAddr> with schema update

* removed unused commented code

* 270 marketplace021 extended options in startsale struct (#273)

* added start time and expiration for sale in marketplace with test adjustments

* linting

* added unit tests for start_time and duration, removed pending status

* guard against start times that are more than a second behind current block time

* Added attributes for execute_cancel and added more comments

* removed commented test. This branch addresses issue #270

* updated marketplace schema

* removed SaleNotStarted error, using SaleNotOpen instead

* prefixed test names with test_

* Bump version and updated schema

* Uncommented economics reply method code

* Paginated get_subdir query

* when unpublishing the latest version of an ADO type, its previous version(if available) will be set as the latest version

* test case where we're removing the only version of an ADO type

* linting

* check for is_none instead of is_error in unpublish unit test

* Fixed generics for execute_amp_receive

* combined ReplyIds, started using replyid::payfee instead of 9999 directly

* remove old direct and isc20 channels when new ones are provided for the same chain. AND-12

* fixed unit tests

* Altered ado_type_getter

* VFS uses smart query

* Added check for ':' in get_asset_string

* Added to_lowercase check on vfs

* Reverted ADO version change to use full version type

* All usernames/paths in VFS to lower case

* Removed unused code

* Adjusted ado types query limit

* renamed new_owner to potential_owner, OwernshipRequest query that returns potential owner's address. Resolves #306

* OS Base Queries (audit merge) (#308)

* added base queries to os contracts

* removed version from ADOContract and its related method

* started using ADOContract's methods directly for base queries in OS contracts, removed os_querrier.rs

* replaced unwrap() with ?

* added OwnershipRequest to andr_query, ContractPotentialOwnerResponse struct for OwnershipRequest. #306

* Resolved linting problems

* Removed IBC tests

* Fixed imports

* added permission attribute to execute_authorize_token_contract

* test allocated rewards with start time in the future, added check on the first staker's rewards

* [1.0.rc-1] os ownership messages, lockdrop fix, and marketplace query (#320)

* added ownership execute msg to OS contracts

* resolved issue #316

* added start_time and end_time to SaleStateResponse. Resolves #319

* [1.0.rc-1] Operators Removal (#318)

* removed operators from contracts

* linting

* [1.0.rc-1] Crowdfund End Sale (#324)

* allow ending of sale if the minimum tokens sold is met, but only the owner can end it in that case

* linting

* separated minimum sold and is owner into two variables for clarity

* [1.0.rc-1] Withdraw Feature Removal (#321)

* removed Withdraw and Deposit from Andromeda message, applied them to the vault contract's ExecuteMsg

* removed withdrawable_tokens from ADOContract, removed the withdraw feature, commented out withdraw.rs in ado_contract

* deleted withdraw.rs in ado_contract

* linting

* [RES-04] Made init timestamp non-optional

* Added test for RES-04 changes

* [1.0.rc-1] Cw721 extension removal (#327)

* removed CW721's Extenstion ExecuteMsg

* removed Cw721's Extension QueryMsg

* removed Extention from QueryMsg

* fixed spacing in BaseInstantiateMsg

* removed commented code

* Reinstated cw20-staking integration test

* Updated integration test for delayed allocation for staking

* VFS Regex Upgrades (#312)

* create AppContractResponse, added AppContract query to andr_query and AndromedaQuery (#332)

* Fixed typing errors

* added UpdateChainName and GetChainName methods (#334)

* added UpdateChainName and GetChainName methods

* update: updated GetChainName to ChainName & added custom response type to the query

* renamed get_chain_name function to chain_name function

* [1.0.rc-1] Unique Recipients for Splitter (#340)

* splitter validate returns () instead of bool since the bool was never used. validate now also checks for duplicate recipients

* linting

* fixed test and added case for duplicate recipients

* linting

* check percent_sum in every iteration of the loop

* Bump rc version (#344)

* [1.0.rc-1] Added call_action to Non-OS ADOs (#341)

* call_action function, implemented to Splitter

* implemented call_action to the contracts mentioned in #233

* linting

* added test case for duplicate recipients

* Revert "added test case for duplicate recipients"

This reverts commit f8161d0.

* added test for permissioning in auction integration test

* appended call_action's response to handle_execute's response. Made the corresponding unit test changes

* moved generate_economics_message to economics_msg file in andromeda-testing to reduce redundancy

* call set_conctract_version after cw20_instantiate since that function was overwriting the verison (#348)

* [1.0.rc-1] Time Standardization (#335)

* Basic milliseconds type

* Added Milliseconds to Crowdfund

* Added milliseconds to splitter

* Removed unused code

* Added Milliseconds to lockdrop

* Added milliseconds to timelock

* Added Milliseconds to Rate Limiting Withdrawals

* Added Milliseconds to cw20-staking

* Schema updates

* Added subtract seconds function

* Schema generation

* [1.0.rc-1] CosmWasm 1.5 Upgrade (#342)

* upgraded to cosmwasm 1.5, made the necessary adjustments

* upgraded cw20 and cw20-base, fmt fix

* uncommented denom validation, enabled cosmwasm 1.3 feature for auction to access query_denom_metadata

* updated cw-multi-test to 1.0.0, fixed auction integration test denom validation

* auction mock_querier adjustment

* linting after resolving merge conflicts

* took DenomMetadataResponse struct from cosmwasm_std and defined it locally

* minor adjustment to kernel integration test

* App schema changes

* [1.0.rc-1] Suspend Register User in VFS (#355)

* disabled RegisterUsername, adjusted unit tests, created TemporarilyDisabled ContractError

* linting

* adjusted mock.rs in andromeda-testing, crowdfund and kernel intergration tests

* linting

* used #[cfg(not(test))] for the TemoirarilyDisabled error, reverted unit test changes

* commented out AddressAndKey option, commented out unreachable code in instantiation (#361)

* [1.0.rc-1] VFS SubDir Query Change to Struct from Tuple (#362)

* replaced tuple with struct for VFS's SubDir

* renamed struct, updated schema

* removed Timestamp query from CW20-Staking (#366)

* [1.0.rc-1] WithdrawableBalance Removal from AndromedaQuery (#367)

* removed WithdrawableBalance query from AndromedaQuery, created PermissionedActionsResponse for Permissioned Actions query, temporarily disabled query_balance with startegy in Vault contract

* test fixes

* linting

* Instantiate2 and App ADO Creation Automation (#354)

* Added instantiate 2 [WIP]

* Added instantiate2 and fixed tests

* Added automation for app contract instantiated ADOs

* Fixed contract name and cw2 references

* Disabled Instantiate2 for non-new app components

* Do not register hidden app components

* Register symlinks before instantiation

* Updated handle add app component

* Change local reference resolution format

* Added Instantiate2 ContractError

* Added component event generation

* Improved instantiate attribute returns

* Fixed failing tests

* Fixed ado type in storage

* Fix prev commit

* Added temporary ADODB query

* ADODB uses string for ado type

* Fixed failing test

* Swapped VFS to use raw query

* Removed unused query

* Fixed contract name for addresslist and auction

* [1.0.rc-1] Optional Start Time for Sale in Crowdfund & Auction (#331)

* added optional start time for crowdund, changed expiration to duration for consistency

* fixed rate limiting withdrawals schema

* made start time optional in auction's start and update sale

* set start time when not provided as current time + 1 instead of current time like in cw20 exchange

* created get_and_validate_start_time to make the functions that use start_time more concise

* start_time defaults to current_time + 1, and duration has to be above 0 across cw20 exchange, auction, crowdfund and marketplace

* forwarded time in markeplace integration test to start sale

* used block time variable for current_time in assert_auction_created()

* replaced duration with expiration

* replaced duration with expiration in crowdfund integration test

* renamed expiration to end_time in State struct and StartSale msg

* generated schemas

* implemented Milliseconds to cw20-exchange, auction, crowdfund, and marketplace

* Removed balance query (#379)

* Albert/get addresses with names for symlink (#376)

* fixed app contract's add component function to update ado addresses when component is added with symlink

* add: added unit test with component add usecase

* updated integration test with valid symlink

* lint fixed

* updated integration test to refer app name with init msg result

* fixed lint

* [RC] Ownership Request Query Response Object (#380)

* Changed response object for ownership request query

* Added expiration to ownership request query response

* Schema generation

* [1.0.rc-1] Denom Validation Fix (#384)

* validate denom now returns the actual error instead of our ContractError

* validate_denom now uses query_supply instead of query_denom_metadata

* linting

* added match statement for BankQueries in mock_querier, removed commented code

* [1.0.rc-1] AndrAddr Recipient for SendNft in CW721 (#375)

* made contract_addr's type in execute_send_nft an AndrAddr

* get raw address of contract_addr before calling send_nft

* implemented AndrAddr for execute_send's contract in CW20

* use local vfs path instead of address in auction integration test

* Lint fix and schema build

* [1.0.rc-1] Crowdfund & Auction Adjustments (#386)

* Albert/make open auction an option and add a query (#364)

* adjusted auction contract to accept unauthorized cw721 based on the authorized_token_addresses provided by the instantiate msg

* addded query to get the authorized addressses for an auction

* added pagination to permissioned actors query

* fixed lint err

* removed unused state from storage

* resolved conflict with rc branch

* updated permission system pagination

* Fixed query permissioned actors

* Linting

---------

Co-authored-by: Connor Barr <[email protected]>

* STD + Macro version bump

* Version bump

* fixed add app component error (#389)

* fix cosmwasm_1_3 error in auction (#393)

* [Fix]: Local AMP Message Recipient (#396)

* Added local resolution to Recipient struct

* Added Recipient validation

* Fixed message validate logic order for splitter

* Update lockdrop incentive token (#390)

* updated lockdrop to use Addr for incentive token

* fixed linting err

* saved incentive token's AndrAddr directly instead of resolving it

* fixed bug in lockdrop contracT

* used base migrate function in all contracts (#394)

* used base migrate function in all contracts

* updated base migrate function logic for saving contract name

* fixed linting err:

* [1.0.rc-1] AndrAddr for Some CW20 & CW721 Messages (#398)

* implemented AndrAddr to recipient in Transfer, TransferFrom, and SendFrom in CW20

* implemented AndrAddr to TransferNft's recipient in cw721

* used some vfs paths instead of raw addresses in cw20 staking integration test

* replaced all instances of env: ExecuteContext with ctx: ExecuteContext

* Integration Test Improvements (#388)

* Added instantiate 2 [WIP]

* Added instantiate2 and fixed tests

* Added automation for app contract instantiated ADOs

* Fixed contract name and cw2 references

* Disabled Instantiate2 for non-new app components

* Do not register hidden app components

* Register symlinks before instantiation

* Updated handle add app component

* Change local reference resolution format

* Integration Testing Restructure (#264)

* Mock updates

* Linting

* Added STD version to root cargo file

* Updated auction to new testing setup

* Linting

* Updated crate versions

* Fixed failing test

* Linting

* Updated OS to use new structure in integration testing

* Linting

* Added message generics to mock structs for better type safety

* Removed testing feature

* Updated final tests to new integration test standard

* Create README.md

* Update README.md

* Update README.md

* Fixed tests

* Added Instantiate2 ContractError

* Added component event generation

* Improved instantiate attribute returns

* Fixed integration tests

* Fixed failing tests

* [WIP] Mock builder

* Upgraded unit-test scaffolding

* Fixed tests

* Fixed app test

* Updated testing readme

* Improved app integration test

* Fixed tests and removed cw2 dependencies

* Fixed imports

* Lock sha256 version

* Update auction and marketplace contracts

* Fixed module permissioning

* [RC]: Marketplace and Auction Recipients (#399)

* Added recipient field to auction

* Updated marketplace for recipient

* Fixed auction recipient

* Fixed failing tests

* Improved auction test

* Version bumps

* Fix version issues from previous commit

* Remove submodule

* Schema fixes

* [1.0.rc-1] MillisecondsDuration and MillisecondsExpiration types (#403)

* replaced Milliseconds with either MillisecondsDuration or MillisecondsExpiration

* Splitter struct's lock comment improvement and change to MillisecondsExpiration

* Test

* feat: Added git hooks

* fix: added conventional commits config

* [1.0.rc-1] CW20 Support for the Auction & Marketplace ADOs (#391)

* added valid_cw20_contract in auction's state, adjusted validate_denom to accept the valid cw20 contract

* execute_place_bid_cw20 for auction

* added support for cw20 in auction's execute_claim

* returned the original order of messages in the response

* cw20 support for claim, adjusted validate_denom, use permissioning system to set valid cw20

* added unit tests for cw20 support

* renamed cw20hookmsg's purchase to PlaceBid

* updated auction's schema

* changed ReceiveCw20 to Receive, integration test for auction with cw20

* updated auction's schema

* additional checks for auction_cw20 integration test

* improved error message for InvalidFunds

* unit test adjustment for new error message

* moved denom_validation to denom file in the common folder for easier implementation for other contracts

* added uses_cw20 in auction state

* cw20 support for marketplace ADO

* added unit tests for cw20 support in Marketplace

* added integration test for cw20-enabled marketplace, adjusted tax payments when buying with cw20

* stopped sending 0 funds when tax recipient and amount are None in Marketplace

* improved some error messages

* added denom validation for crowdfund

* changed whitelist to in AuctionState to a bool, validate whitelist in auction using permissioning system, whitelist is set per individual auction

* implemented new whitelist system to update_auction

* adjustments to denom.rs, auction, marketpalce, splitter and crowdfund

* fixed cw20 tax payments in auction, same implementation as marketplace

* fmt fix

* added recipient's address support for cw20 auction

* removed check that prevented open auctions

* added conditional statement for after tax payment in marketplace

* resolves #402

* added recipient address support for cw20 sales in Marketpalce

* added recipient to cw20 auction integration test

* added whitelist testing in auction integration test

* implemented genereate_msg_cw20 in marketplace and auction

* refactor: remove unncessary checks, improve error message, add same check for denom validation in update auction as in start auction

* added fund limit to the create batch (#404)

* added lower fund limit to the create batch

* added validation for maximum funds for batch creation

* fixed linting err

* fixed validation process error

* updated test case

* feat: Added MockVestingContract struct to Vesting Contract

* fix: Removed unused file

---------

Co-authored-by: Connor Barr <[email protected]>

* [RC]: Removed Expiration from Permissioning and UpdateOwner messages (#408)

* fix: Replaced Expiration with MillisecondsExpiration in UpdateOwner

Old messages will be incompatible with this change if they have an expiration field

* fix: Replaced Expiration with MillisecondsExpiration in permissioning messages

Old permissioning messages will be incompatible if they contained an expiration

* fix: Fixes cw20 validation in marketplace

* chore: ✅ Bumped all contract versions to 1.0.0

* chore: 📦️ Fixed crate version references for publishing

* chore: 🔧 Added descriptions for all contract packages

* fix: 🔧 Added license to Andromeda Ecosystem crate

* test: 🐛 Fixed failing cw20 staking integration test

* chore: resolve merge conflict issues

* test: ✅ Fixed failing test

* build: ⏪ Reverted rust version to 1.69.0 and removed unused code

* build: ⏪ Changed rust version to 1.75.0

* ci: Set binaryen version in CI

* ci: Added apt update to build CI

* feat: add ability to removereplace reward tokens to cw20 staking contract (#418)

* feat: allowed owner to remove reward token

* feat: allowed owner to replace reward token

* fix: fixed reward token operation to handle pending rewards

* fix: fixed claim reward logic to remove inactive reward token logic

* fix: improved readability & added additional attribute to remove token response to notify number of reward tokens after the operation

* fix: generated schema

* fix: optimized execute_add_reward_token->reward token validation logic

* feat: ADOBaseVersion Query for AndromedaQuery (#416)

* feat: add ADOBase Version query to AndromedaQuery

* refactor: update schemas

* feat: added binaryen install script to ci

* ci: 🎨 moved binaryen install order

---------

Co-authored-by: Joe Monem <[email protected]>
Co-authored-by: Anshudhar Kumar Singh <[email protected]>
Co-authored-by: Joe Monem <[email protected]>
Co-authored-by: Speed Demon <[email protected]>
Co-authored-by: Anshudhar Kumar Singh <[email protected]>
crnbarr93 added a commit that referenced this pull request Apr 23, 2024
…415)

* Removed unused directory

* [RES-16] Added update kernel message

* [RES-01] Added some module checks

* [RES-02] Added check that a module is an ADO on registration

* [RES-03] Removed remainder from amount sent to seller in exchange

* [RES-08] Added address validatin for app update_address

* [RES-11] Added token address authorisation to cw721 auction

* [RES-12] Added denom validation to cw721 auction

* [RES-19] Added check for app component length

* [RES-20] Added check for same token to token exchange

* [RES-21] Clarity for decimal returns in allowed_withdrawal_percent

* [RES-22] Added check for timestamp in past

* Added test for query withdrawal percent in lockdrop

* [RES-05] Removed lockdrop owner restriction on withdrawals

* Removed unused code

* New Ownership Process (#260)

* Updated ownership process

* Added expiring ownership offer

* Linting

* Fixed failing test

* [AND-01] Altered multichain app to use target chain instead of currchain

* [AND-01] Added test and fixed symlink references

* [AND-02] Added ensure check for ownership on restricted permissioning messages

* [AND-03] Removed App/ADO fee payments

* [AND-04] Added ensure check in validate_andr_addresses

* [ANDR-05] Added length check to username regex

* [AND-06] Added handling for case with multiple duplicate denoms in merge/deduct coins

* [AND-07] Improved funds handling in kernel local handling

* [AND-8] updated action fees to be associated to ado type

* [ANDR-09] Altered how paths are resolved

* Added TODO from AND-07/11

* [AND-12] Improved channel/chain two way mapping

* [AND-16] Added error handling for no channel info when sending ibc message

* Save ado_version.get_type() instead of ado_version in store_code_id and removed .clone() from it

* empty funds route to handle_ibc_hooks, funds route to handle_ibc_direct

* revert commit 5d44dde

* [RES-01] Default modules to empty vector on instantiation

* [RES-05] Removed deprecating withdrawal amount from lockdrop

* [RES-13] Added message to update token contract

* [RES-13] Added test for finding 13

* [RES-22] In marketplace user must provide exact payment

* Fixed failing test from [RES-22]

* [RES-22] Ensure provided amount is exact

* Linting

* component name can't be '.' AND-34

* usernames that are a valid CosmWasm address must be the same as info.sender's address + unit tests AND-41

* added underflow check for consume_use in permissioning AND-37

* removed tilde symbol check from resolve_lib_path

* ado type can no longer be empty or made of only spaces AND-32

* PATH_REGEX now includes paths that start with './'  + unit tests AND-31

* [AND-21] Added limit to path parts length

* [AND-22] Added validation on fee string

* Linting

* [AND-25] Inverted boolean check in handle ibc direct

* [AND-27] Added version checking in adodb publish

* [AND-17] Added asset validation method to ActionFee

* [AND-29] Fixed issue with vfs removing incorrect username

* [AND-30] Added check if username taken

* owner_or_operator checks for add_withdrawable_token and remove_withdrawable_token, and added documentation for them AND-39

* reply function for economics contract, exact behavior tbd AND-33

* [AND-23] Restricted AddParentPath to app contract and renamed it

* test_claim_ownership_all() now passes, execute_claim tests were already passing, cw20_staking replace unwrap() with ? AND-38

* [AND-27] Rewrote vfs path resolving to prevent loops

* updated test_reply_assign_app AND-38

* check if funds are empty before creating SubMsg in handle_local AND-38

* findings concerning vault balance check for test_crowdfund_app

* removed dated todos and unnecesssary check AND-38

* removed commented out todo from kernel execute.rs AND-38

* only verified ADOs can access the kernel's amp_receive AND-42

* test_handle_ibc_direct adjustment AND-42

* Linting

* replaced most addition operations of Uint128 with checked_add() AND-37

* replaced all subtraction operations with checked_sub() AND-37

* Unpublish function for ADODB with unit test and schema update AND-35

* linting

* additional safe math implementations AND-37

* additional checks in kernel integration test to see if Send is working as expected

* Added alphanumeric check to component name

* check for AMPReceive's verify address in the kernel

* linting

* adodb saves unpublished code ids, prevents republishing of unpublished code ids, includes unit test

* linting

* adodb keeps track of unpublished versions of corresponding ADO types, prevents their republishing. With unit test

* unpublished code ids and versions are now stored in a Map

* no longer overwriting the response in the kernel's amp_receive

* linting

* disabled cross chain components in the kernel's handler. Addresses #283

* Revert "disabled cross chain components in the kernel's handler. Addresses #283"

This reverts commit a769989.

* ibc_create_ado always errors and kernel's create() errors if a chain is provided. Addresses #283

* ADODB Unpublish changes and testing

* Fixed error passing for amp_receive

* Kernel Direct Send (#285)

* Added direct sending from kernel

* Linting

* Added check for funds in kernel routing

* Added a fix for dispersed coins in "has coins" check

* Linting

* Linting

* Linting

* Crate version update

* 268 cw20 exchange extended options in startsale struct (#272)

* added optional start time and duration + unit tests + schema update

* Addresses #269 added start_time in Sale for cw20-exchange

* linting

* save start_time as current block time + 1 instead of setting it as Never in case it isn't provided

* linting and comment adjustment

* Addresses #267 refund original token instead of sale token when cancelling sale

* changed claim ownership's new_owner field from Option<Addr> to Option<AndrAddr> with schema update

* removed unused commented code

* 270 marketplace021 extended options in startsale struct (#273)

* added start time and expiration for sale in marketplace with test adjustments

* linting

* added unit tests for start_time and duration, removed pending status

* guard against start times that are more than a second behind current block time

* Added attributes for execute_cancel and added more comments

* removed commented test. This branch addresses issue #270

* updated marketplace schema

* removed SaleNotStarted error, using SaleNotOpen instead

* prefixed test names with test_

* Bump version and updated schema

* Uncommented economics reply method code

* Paginated get_subdir query

* when unpublishing the latest version of an ADO type, its previous version(if available) will be set as the latest version

* test case where we're removing the only version of an ADO type

* linting

* check for is_none instead of is_error in unpublish unit test

* Fixed generics for execute_amp_receive

* combined ReplyIds, started using replyid::payfee instead of 9999 directly

* remove old direct and isc20 channels when new ones are provided for the same chain. AND-12

* fixed unit tests

* Altered ado_type_getter

* VFS uses smart query

* Added check for ':' in get_asset_string

* Added to_lowercase check on vfs

* Reverted ADO version change to use full version type

* All usernames/paths in VFS to lower case

* Removed unused code

* Adjusted ado types query limit

* renamed new_owner to potential_owner, OwernshipRequest query that returns potential owner's address. Resolves #306

* OS Base Queries (audit merge) (#308)

* added base queries to os contracts

* removed version from ADOContract and its related method

* started using ADOContract's methods directly for base queries in OS contracts, removed os_querrier.rs

* replaced unwrap() with ?

* added OwnershipRequest to andr_query, ContractPotentialOwnerResponse struct for OwnershipRequest. #306

* Resolved linting problems

* Removed IBC tests

* Fixed imports

* added permission attribute to execute_authorize_token_contract

* test allocated rewards with start time in the future, added check on the first staker's rewards

* [1.0.rc-1] os ownership messages, lockdrop fix, and marketplace query (#320)

* added ownership execute msg to OS contracts

* resolved issue #316

* added start_time and end_time to SaleStateResponse. Resolves #319

* [1.0.rc-1] Operators Removal (#318)

* removed operators from contracts

* linting

* [1.0.rc-1] Crowdfund End Sale (#324)

* allow ending of sale if the minimum tokens sold is met, but only the owner can end it in that case

* linting

* separated minimum sold and is owner into two variables for clarity

* [1.0.rc-1] Withdraw Feature Removal (#321)

* removed Withdraw and Deposit from Andromeda message, applied them to the vault contract's ExecuteMsg

* removed withdrawable_tokens from ADOContract, removed the withdraw feature, commented out withdraw.rs in ado_contract

* deleted withdraw.rs in ado_contract

* linting

* [RES-04] Made init timestamp non-optional

* Added test for RES-04 changes

* [1.0.rc-1] Cw721 extension removal (#327)

* removed CW721's Extenstion ExecuteMsg

* removed Cw721's Extension QueryMsg

* removed Extention from QueryMsg

* fixed spacing in BaseInstantiateMsg

* removed commented code

* Reinstated cw20-staking integration test

* Updated integration test for delayed allocation for staking

* VFS Regex Upgrades (#312)

* create AppContractResponse, added AppContract query to andr_query and AndromedaQuery (#332)

* Fixed typing errors

* added UpdateChainName and GetChainName methods (#334)

* added UpdateChainName and GetChainName methods

* update: updated GetChainName to ChainName & added custom response type to the query

* renamed get_chain_name function to chain_name function

* [1.0.rc-1] Unique Recipients for Splitter (#340)

* splitter validate returns () instead of bool since the bool was never used. validate now also checks for duplicate recipients

* linting

* fixed test and added case for duplicate recipients

* linting

* check percent_sum in every iteration of the loop

* Bump rc version (#344)

* [1.0.rc-1] Added call_action to Non-OS ADOs (#341)

* call_action function, implemented to Splitter

* implemented call_action to the contracts mentioned in #233

* linting

* added test case for duplicate recipients

* Revert "added test case for duplicate recipients"

This reverts commit f8161d0.

* added test for permissioning in auction integration test

* appended call_action's response to handle_execute's response. Made the corresponding unit test changes

* moved generate_economics_message to economics_msg file in andromeda-testing to reduce redundancy

* call set_conctract_version after cw20_instantiate since that function was overwriting the verison (#348)

* [1.0.rc-1] Time Standardization (#335)

* Basic milliseconds type

* Added Milliseconds to Crowdfund

* Added milliseconds to splitter

* Removed unused code

* Added Milliseconds to lockdrop

* Added milliseconds to timelock

* Added Milliseconds to Rate Limiting Withdrawals

* Added Milliseconds to cw20-staking

* Schema updates

* Added subtract seconds function

* Schema generation

* [1.0.rc-1] CosmWasm 1.5 Upgrade (#342)

* upgraded to cosmwasm 1.5, made the necessary adjustments

* upgraded cw20 and cw20-base, fmt fix

* uncommented denom validation, enabled cosmwasm 1.3 feature for auction to access query_denom_metadata

* updated cw-multi-test to 1.0.0, fixed auction integration test denom validation

* auction mock_querier adjustment

* linting after resolving merge conflicts

* took DenomMetadataResponse struct from cosmwasm_std and defined it locally

* minor adjustment to kernel integration test

* App schema changes

* [1.0.rc-1] Suspend Register User in VFS (#355)

* disabled RegisterUsername, adjusted unit tests, created TemporarilyDisabled ContractError

* linting

* adjusted mock.rs in andromeda-testing, crowdfund and kernel intergration tests

* linting

* used #[cfg(not(test))] for the TemoirarilyDisabled error, reverted unit test changes

* commented out AddressAndKey option, commented out unreachable code in instantiation (#361)

* [1.0.rc-1] VFS SubDir Query Change to Struct from Tuple (#362)

* replaced tuple with struct for VFS's SubDir

* renamed struct, updated schema

* removed Timestamp query from CW20-Staking (#366)

* [1.0.rc-1] WithdrawableBalance Removal from AndromedaQuery (#367)

* removed WithdrawableBalance query from AndromedaQuery, created PermissionedActionsResponse for Permissioned Actions query, temporarily disabled query_balance with startegy in Vault contract

* test fixes

* linting

* Instantiate2 and App ADO Creation Automation (#354)

* Added instantiate 2 [WIP]

* Added instantiate2 and fixed tests

* Added automation for app contract instantiated ADOs

* Fixed contract name and cw2 references

* Disabled Instantiate2 for non-new app components

* Do not register hidden app components

* Register symlinks before instantiation

* Updated handle add app component

* Change local reference resolution format

* Added Instantiate2 ContractError

* Added component event generation

* Improved instantiate attribute returns

* Fixed failing tests

* Fixed ado type in storage

* Fix prev commit

* Added temporary ADODB query

* ADODB uses string for ado type

* Fixed failing test

* Swapped VFS to use raw query

* Removed unused query

* Fixed contract name for addresslist and auction

* [1.0.rc-1] Optional Start Time for Sale in Crowdfund & Auction (#331)

* added optional start time for crowdund, changed expiration to duration for consistency

* fixed rate limiting withdrawals schema

* made start time optional in auction's start and update sale

* set start time when not provided as current time + 1 instead of current time like in cw20 exchange

* created get_and_validate_start_time to make the functions that use start_time more concise

* start_time defaults to current_time + 1, and duration has to be above 0 across cw20 exchange, auction, crowdfund and marketplace

* forwarded time in markeplace integration test to start sale

* used block time variable for current_time in assert_auction_created()

* replaced duration with expiration

* replaced duration with expiration in crowdfund integration test

* renamed expiration to end_time in State struct and StartSale msg

* generated schemas

* implemented Milliseconds to cw20-exchange, auction, crowdfund, and marketplace

* Removed balance query (#379)

* Albert/get addresses with names for symlink (#376)

* fixed app contract's add component function to update ado addresses when component is added with symlink

* add: added unit test with component add usecase

* updated integration test with valid symlink

* lint fixed

* updated integration test to refer app name with init msg result

* fixed lint

* [RC] Ownership Request Query Response Object (#380)

* Changed response object for ownership request query

* Added expiration to ownership request query response

* Schema generation

* [1.0.rc-1] Denom Validation Fix (#384)

* validate denom now returns the actual error instead of our ContractError

* validate_denom now uses query_supply instead of query_denom_metadata

* linting

* added match statement for BankQueries in mock_querier, removed commented code

* [1.0.rc-1] AndrAddr Recipient for SendNft in CW721 (#375)

* made contract_addr's type in execute_send_nft an AndrAddr

* get raw address of contract_addr before calling send_nft

* implemented AndrAddr for execute_send's contract in CW20

* use local vfs path instead of address in auction integration test

* Lint fix and schema build

* [1.0.rc-1] Crowdfund & Auction Adjustments (#386)

* Albert/make open auction an option and add a query (#364)

* adjusted auction contract to accept unauthorized cw721 based on the authorized_token_addresses provided by the instantiate msg

* addded query to get the authorized addressses for an auction

* added pagination to permissioned actors query

* fixed lint err

* removed unused state from storage

* resolved conflict with rc branch

* updated permission system pagination

* Fixed query permissioned actors

* Linting

---------

Co-authored-by: Connor Barr <[email protected]>

* STD + Macro version bump

* Version bump

* fixed add app component error (#389)

* fix cosmwasm_1_3 error in auction (#393)

* [Fix]: Local AMP Message Recipient (#396)

* Added local resolution to Recipient struct

* Added Recipient validation

* Fixed message validate logic order for splitter

* Update lockdrop incentive token (#390)

* updated lockdrop to use Addr for incentive token

* fixed linting err

* saved incentive token's AndrAddr directly instead of resolving it

* fixed bug in lockdrop contracT

* used base migrate function in all contracts (#394)

* used base migrate function in all contracts

* updated base migrate function logic for saving contract name

* fixed linting err:

* [1.0.rc-1] AndrAddr for Some CW20 & CW721 Messages (#398)

* implemented AndrAddr to recipient in Transfer, TransferFrom, and SendFrom in CW20

* implemented AndrAddr to TransferNft's recipient in cw721

* used some vfs paths instead of raw addresses in cw20 staking integration test

* replaced all instances of env: ExecuteContext with ctx: ExecuteContext

* Integration Test Improvements (#388)

* Added instantiate 2 [WIP]

* Added instantiate2 and fixed tests

* Added automation for app contract instantiated ADOs

* Fixed contract name and cw2 references

* Disabled Instantiate2 for non-new app components

* Do not register hidden app components

* Register symlinks before instantiation

* Updated handle add app component

* Change local reference resolution format

* Integration Testing Restructure (#264)

* Mock updates

* Linting

* Added STD version to root cargo file

* Updated auction to new testing setup

* Linting

* Updated crate versions

* Fixed failing test

* Linting

* Updated OS to use new structure in integration testing

* Linting

* Added message generics to mock structs for better type safety

* Removed testing feature

* Updated final tests to new integration test standard

* Create README.md

* Update README.md

* Update README.md

* Fixed tests

* Added Instantiate2 ContractError

* Added component event generation

* Improved instantiate attribute returns

* Fixed integration tests

* Fixed failing tests

* [WIP] Mock builder

* Upgraded unit-test scaffolding

* Fixed tests

* Fixed app test

* Updated testing readme

* Improved app integration test

* Fixed tests and removed cw2 dependencies

* Fixed imports

* Lock sha256 version

* Update auction and marketplace contracts

* Fixed module permissioning

* [RC]: Marketplace and Auction Recipients (#399)

* Added recipient field to auction

* Updated marketplace for recipient

* Fixed auction recipient

* Fixed failing tests

* Improved auction test

* Version bumps

* Fix version issues from previous commit

* Remove submodule

* Schema fixes

* [1.0.rc-1] MillisecondsDuration and MillisecondsExpiration types (#403)

* replaced Milliseconds with either MillisecondsDuration or MillisecondsExpiration

* Splitter struct's lock comment improvement and change to MillisecondsExpiration

* Test

* feat: Added git hooks

* fix: added conventional commits config

* [1.0.rc-1] CW20 Support for the Auction & Marketplace ADOs (#391)

* added valid_cw20_contract in auction's state, adjusted validate_denom to accept the valid cw20 contract

* execute_place_bid_cw20 for auction

* added support for cw20 in auction's execute_claim

* returned the original order of messages in the response

* cw20 support for claim, adjusted validate_denom, use permissioning system to set valid cw20

* added unit tests for cw20 support

* renamed cw20hookmsg's purchase to PlaceBid

* updated auction's schema

* changed ReceiveCw20 to Receive, integration test for auction with cw20

* updated auction's schema

* additional checks for auction_cw20 integration test

* improved error message for InvalidFunds

* unit test adjustment for new error message

* moved denom_validation to denom file in the common folder for easier implementation for other contracts

* added uses_cw20 in auction state

* cw20 support for marketplace ADO

* added unit tests for cw20 support in Marketplace

* added integration test for cw20-enabled marketplace, adjusted tax payments when buying with cw20

* stopped sending 0 funds when tax recipient and amount are None in Marketplace

* improved some error messages

* added denom validation for crowdfund

* changed whitelist to in AuctionState to a bool, validate whitelist in auction using permissioning system, whitelist is set per individual auction

* implemented new whitelist system to update_auction

* adjustments to denom.rs, auction, marketpalce, splitter and crowdfund

* fixed cw20 tax payments in auction, same implementation as marketplace

* fmt fix

* added recipient's address support for cw20 auction

* removed check that prevented open auctions

* added conditional statement for after tax payment in marketplace

* resolves #402

* added recipient address support for cw20 sales in Marketpalce

* added recipient to cw20 auction integration test

* added whitelist testing in auction integration test

* implemented genereate_msg_cw20 in marketplace and auction

* refactor: remove unncessary checks, improve error message, add same check for denom validation in update auction as in start auction

* test: unrestricted cw20 auction

* test: InvalidFunds check in restricted cw20 auction

* refactor: apply improved InvalidFunds error message to update_auction

* refactor & test: allow open cw20 sales in marketplace, restricted and unrestricted cw20 sales marketplace integration tets

* added fund limit to the create batch (#404)

* added lower fund limit to the create batch

* added validation for maximum funds for batch creation

* fixed linting err

* fixed validation process error

* updated test case

* feat: Added MockVestingContract struct to Vesting Contract

* fix: Removed unused file

---------

Co-authored-by: Connor Barr <[email protected]>

* [RC]: Removed Expiration from Permissioning and UpdateOwner messages (#408)

* fix: Replaced Expiration with MillisecondsExpiration in UpdateOwner

Old messages will be incompatible with this change if they have an expiration field

* fix: Replaced Expiration with MillisecondsExpiration in permissioning messages

Old permissioning messages will be incompatible if they contained an expiration

* fix: Fixes cw20 validation in marketplace

* chore: ✅ Bumped all contract versions to 1.0.0

* chore: 📦️ Fixed crate version references for publishing

* chore: 🔧 Added descriptions for all contract packages

* fix: 🔧 Added license to Andromeda Ecosystem crate

* test: 🐛 Fixed failing cw20 staking integration test

* test: implement new methods for cw20 sales integeration tests

* test: implement latest integration test methods in restricted cw20 auction integration test

* test: implement latest integration test methods to unrestriced cw20 auction

* feature: add Asset enum for coin_denom, add get_verified_asset method for Asset

* refactor: uses_cw20 is now automatically set

* chore: resolve merge conflict issues

* test: ✅ Fixed failing test

* build: ⏪ Reverted rust version to 1.69.0 and removed unused code

* build: ⏪ Changed rust version to 1.75.0

* ci: Set binaryen version in CI

* ci: Added apt update to build CI

* fix: missing imports

* build: 🔧 added target build for mock files

* ci: merge from development

* chore: removed unused zip file

* feat: query TokenInfo in get_verified_asset

* refactor: Replace Expiration by MillisecondsExpiration in RegisterMerkleRoot (#417)

* refactor: stage exipiration is now in Option<MillisecondsExpiration>

* refactor: MillisecondsExpiration bid's timestamp in auction

* refactor: update schemas for merkle airdrop and auction

* refactor: check for stage expiration only when it's available

* fix: 🩹 improved millisecond accuracy to use nanos from block rather than seconds and fixed tests

* ci: 🎨 linting

---------

Co-authored-by: Connor Barr <[email protected]>

* feat: Expiry Enum (#419)

* feat: add Expiry enum

* refactor: Use Expiry::FromNow instead of AtTime in appropriate instances

* feat: implement Default and Display for Expiry, implement expiry to update_owner and the Permission enum

* refactor: implement Expiry to lockdrop

* refactor: add Expiry to cw20-staking

* refactor: add Expiry to splitter

* feat: add ability to removereplace reward tokens to cw20 staking contract (#418)

* feat: allowed owner to remove reward token

* feat: allowed owner to replace reward token

* fix: fixed reward token operation to handle pending rewards

* fix: fixed claim reward logic to remove inactive reward token logic

* fix: improved readability & added additional attribute to remove token response to notify number of reward tokens after the operation

* fix: generated schema

* fix: optimized execute_add_reward_token->reward token validation logic

* feat: ADOBaseVersion Query for AndromedaQuery (#416)

* feat: add ADOBase Version query to AndromedaQuery

* refactor: update schemas

* feat: added binaryen install script to ci

* chore: add block_info for update_global_index

* chore: fix merge errors

* chore: fmt fix

* chore: fixed import

* fix: fixed import

* refactor: added spacing for Expiry

* test: added test for expiry from now

* test: fixed failing tests

* test: fixed failing integration tests

* fix: added Expiry to merkle root

---------

Co-authored-by: Speed Demon <[email protected]>
Co-authored-by: Connor Barr <[email protected]>

---------

Co-authored-by: Connor Barr <[email protected]>
Co-authored-by: Anshudhar Kumar Singh <[email protected]>
Co-authored-by: Speed Demon <[email protected]>
Co-authored-by: Anshudhar Kumar Singh <[email protected]>
crnbarr93 added a commit that referenced this pull request Jun 28, 2024
* Removed unused directory

* [RES-16] Added update kernel message

* [RES-01] Added some module checks

* [RES-02] Added check that a module is an ADO on registration

* [RES-03] Removed remainder from amount sent to seller in exchange

* [RES-08] Added address validatin for app update_address

* [RES-11] Added token address authorisation to cw721 auction

* [RES-12] Added denom validation to cw721 auction

* [RES-19] Added check for app component length

* [RES-20] Added check for same token to token exchange

* [RES-21] Clarity for decimal returns in allowed_withdrawal_percent

* [RES-22] Added check for timestamp in past

* Added test for query withdrawal percent in lockdrop

* [RES-05] Removed lockdrop owner restriction on withdrawals

* Removed unused code

* New Ownership Process (#260)

* Updated ownership process

* Added expiring ownership offer

* Linting

* Fixed failing test

* [AND-01] Altered multichain app to use target chain instead of currchain

* [AND-01] Added test and fixed symlink references

* [AND-02] Added ensure check for ownership on restricted permissioning messages

* [AND-03] Removed App/ADO fee payments

* [AND-04] Added ensure check in validate_andr_addresses

* [ANDR-05] Added length check to username regex

* [AND-06] Added handling for case with multiple duplicate denoms in merge/deduct coins

* [AND-07] Improved funds handling in kernel local handling

* [AND-8] updated action fees to be associated to ado type

* [ANDR-09] Altered how paths are resolved

* Added TODO from AND-07/11

* [AND-12] Improved channel/chain two way mapping

* [AND-16] Added error handling for no channel info when sending ibc message

* Save ado_version.get_type() instead of ado_version in store_code_id and removed .clone() from it

* empty funds route to handle_ibc_hooks, funds route to handle_ibc_direct

* revert commit 5d44dde

* [RES-01] Default modules to empty vector on instantiation

* [RES-05] Removed deprecating withdrawal amount from lockdrop

* [RES-13] Added message to update token contract

* [RES-13] Added test for finding 13

* [RES-22] In marketplace user must provide exact payment

* Fixed failing test from [RES-22]

* [RES-22] Ensure provided amount is exact

* Linting

* component name can't be '.' AND-34

* usernames that are a valid CosmWasm address must be the same as info.sender's address + unit tests AND-41

* added underflow check for consume_use in permissioning AND-37

* removed tilde symbol check from resolve_lib_path

* ado type can no longer be empty or made of only spaces AND-32

* PATH_REGEX now includes paths that start with './'  + unit tests AND-31

* [AND-21] Added limit to path parts length

* [AND-22] Added validation on fee string

* Linting

* [AND-25] Inverted boolean check in handle ibc direct

* [AND-27] Added version checking in adodb publish

* [AND-17] Added asset validation method to ActionFee

* [AND-29] Fixed issue with vfs removing incorrect username

* [AND-30] Added check if username taken

* owner_or_operator checks for add_withdrawable_token and remove_withdrawable_token, and added documentation for them AND-39

* reply function for economics contract, exact behavior tbd AND-33

* [AND-23] Restricted AddParentPath to app contract and renamed it

* test_claim_ownership_all() now passes, execute_claim tests were already passing, cw20_staking replace unwrap() with ? AND-38

* [AND-27] Rewrote vfs path resolving to prevent loops

* updated test_reply_assign_app AND-38

* check if funds are empty before creating SubMsg in handle_local AND-38

* findings concerning vault balance check for test_crowdfund_app

* removed dated todos and unnecesssary check AND-38

* removed commented out todo from kernel execute.rs AND-38

* only verified ADOs can access the kernel's amp_receive AND-42

* test_handle_ibc_direct adjustment AND-42

* Linting

* replaced most addition operations of Uint128 with checked_add() AND-37

* replaced all subtraction operations with checked_sub() AND-37

* Unpublish function for ADODB with unit test and schema update AND-35

* linting

* additional safe math implementations AND-37

* additional checks in kernel integration test to see if Send is working as expected

* Added alphanumeric check to component name

* check for AMPReceive's verify address in the kernel

* linting

* adodb saves unpublished code ids, prevents republishing of unpublished code ids, includes unit test

* linting

* adodb keeps track of unpublished versions of corresponding ADO types, prevents their republishing. With unit test

* unpublished code ids and versions are now stored in a Map

* no longer overwriting the response in the kernel's amp_receive

* linting

* disabled cross chain components in the kernel's handler. Addresses #283

* Revert "disabled cross chain components in the kernel's handler. Addresses #283"

This reverts commit a769989.

* ibc_create_ado always errors and kernel's create() errors if a chain is provided. Addresses #283

* ADODB Unpublish changes and testing

* Fixed error passing for amp_receive

* Kernel Direct Send (#285)

* Added direct sending from kernel

* Linting

* Added check for funds in kernel routing

* Added a fix for dispersed coins in "has coins" check

* Linting

* Linting

* Linting

* Crate version update

* 268 cw20 exchange extended options in startsale struct (#272)

* added optional start time and duration + unit tests + schema update

* Addresses #269 added start_time in Sale for cw20-exchange

* linting

* save start_time as current block time + 1 instead of setting it as Never in case it isn't provided

* linting and comment adjustment

* Addresses #267 refund original token instead of sale token when cancelling sale

* changed claim ownership's new_owner field from Option<Addr> to Option<AndrAddr> with schema update

* removed unused commented code

* 270 marketplace021 extended options in startsale struct (#273)

* added start time and expiration for sale in marketplace with test adjustments

* linting

* added unit tests for start_time and duration, removed pending status

* guard against start times that are more than a second behind current block time

* Added attributes for execute_cancel and added more comments

* removed commented test. This branch addresses issue #270

* updated marketplace schema

* removed SaleNotStarted error, using SaleNotOpen instead

* prefixed test names with test_

* Bump version and updated schema

* Uncommented economics reply method code

* Paginated get_subdir query

* when unpublishing the latest version of an ADO type, its previous version(if available) will be set as the latest version

* test case where we're removing the only version of an ADO type

* linting

* check for is_none instead of is_error in unpublish unit test

* Fixed generics for execute_amp_receive

* combined ReplyIds, started using replyid::payfee instead of 9999 directly

* remove old direct and isc20 channels when new ones are provided for the same chain. AND-12

* fixed unit tests

* Altered ado_type_getter

* VFS uses smart query

* Added check for ':' in get_asset_string

* Added to_lowercase check on vfs

* Reverted ADO version change to use full version type

* All usernames/paths in VFS to lower case

* Removed unused code

* Adjusted ado types query limit

* renamed new_owner to potential_owner, OwernshipRequest query that returns potential owner's address. Resolves #306

* OS Base Queries (audit merge) (#308)

* added base queries to os contracts

* removed version from ADOContract and its related method

* started using ADOContract's methods directly for base queries in OS contracts, removed os_querrier.rs

* replaced unwrap() with ?

* added OwnershipRequest to andr_query, ContractPotentialOwnerResponse struct for OwnershipRequest. #306

* Resolved linting problems

* Removed IBC tests

* Fixed imports

* added permission attribute to execute_authorize_token_contract

* test allocated rewards with start time in the future, added check on the first staker's rewards

* [1.0.rc-1] os ownership messages, lockdrop fix, and marketplace query (#320)

* added ownership execute msg to OS contracts

* resolved issue #316

* added start_time and end_time to SaleStateResponse. Resolves #319

* [1.0.rc-1] Operators Removal (#318)

* removed operators from contracts

* linting

* [1.0.rc-1] Crowdfund End Sale (#324)

* allow ending of sale if the minimum tokens sold is met, but only the owner can end it in that case

* linting

* separated minimum sold and is owner into two variables for clarity

* [1.0.rc-1] Withdraw Feature Removal (#321)

* removed Withdraw and Deposit from Andromeda message, applied them to the vault contract's ExecuteMsg

* removed withdrawable_tokens from ADOContract, removed the withdraw feature, commented out withdraw.rs in ado_contract

* deleted withdraw.rs in ado_contract

* linting

* [RES-04] Made init timestamp non-optional

* Added test for RES-04 changes

* [1.0.rc-1] Cw721 extension removal (#327)

* removed CW721's Extenstion ExecuteMsg

* removed Cw721's Extension QueryMsg

* removed Extention from QueryMsg

* fixed spacing in BaseInstantiateMsg

* removed commented code

* Reinstated cw20-staking integration test

* Updated integration test for delayed allocation for staking

* VFS Regex Upgrades (#312)

* create AppContractResponse, added AppContract query to andr_query and AndromedaQuery (#332)

* Fixed typing errors

* added UpdateChainName and GetChainName methods (#334)

* added UpdateChainName and GetChainName methods

* update: updated GetChainName to ChainName & added custom response type to the query

* renamed get_chain_name function to chain_name function

* [1.0.rc-1] Unique Recipients for Splitter (#340)

* splitter validate returns () instead of bool since the bool was never used. validate now also checks for duplicate recipients

* linting

* fixed test and added case for duplicate recipients

* linting

* check percent_sum in every iteration of the loop

* Bump rc version (#344)

* [1.0.rc-1] Added call_action to Non-OS ADOs (#341)

* call_action function, implemented to Splitter

* implemented call_action to the contracts mentioned in #233

* linting

* added test case for duplicate recipients

* Revert "added test case for duplicate recipients"

This reverts commit f8161d0.

* added test for permissioning in auction integration test

* appended call_action's response to handle_execute's response. Made the corresponding unit test changes

* moved generate_economics_message to economics_msg file in andromeda-testing to reduce redundancy

* call set_conctract_version after cw20_instantiate since that function was overwriting the verison (#348)

* [1.0.rc-1] Time Standardization (#335)

* Basic milliseconds type

* Added Milliseconds to Crowdfund

* Added milliseconds to splitter

* Removed unused code

* Added Milliseconds to lockdrop

* Added milliseconds to timelock

* Added Milliseconds to Rate Limiting Withdrawals

* Added Milliseconds to cw20-staking

* Schema updates

* Added subtract seconds function

* Schema generation

* [1.0.rc-1] CosmWasm 1.5 Upgrade (#342)

* upgraded to cosmwasm 1.5, made the necessary adjustments

* upgraded cw20 and cw20-base, fmt fix

* uncommented denom validation, enabled cosmwasm 1.3 feature for auction to access query_denom_metadata

* updated cw-multi-test to 1.0.0, fixed auction integration test denom validation

* auction mock_querier adjustment

* linting after resolving merge conflicts

* took DenomMetadataResponse struct from cosmwasm_std and defined it locally

* minor adjustment to kernel integration test

* App schema changes

* [1.0.rc-1] Suspend Register User in VFS (#355)

* disabled RegisterUsername, adjusted unit tests, created TemporarilyDisabled ContractError

* linting

* adjusted mock.rs in andromeda-testing, crowdfund and kernel intergration tests

* linting

* used #[cfg(not(test))] for the TemoirarilyDisabled error, reverted unit test changes

* commented out AddressAndKey option, commented out unreachable code in instantiation (#361)

* [1.0.rc-1] VFS SubDir Query Change to Struct from Tuple (#362)

* replaced tuple with struct for VFS's SubDir

* renamed struct, updated schema

* removed Timestamp query from CW20-Staking (#366)

* [1.0.rc-1] WithdrawableBalance Removal from AndromedaQuery (#367)

* removed WithdrawableBalance query from AndromedaQuery, created PermissionedActionsResponse for Permissioned Actions query, temporarily disabled query_balance with startegy in Vault contract

* test fixes

* linting

* Instantiate2 and App ADO Creation Automation (#354)

* Added instantiate 2 [WIP]

* Added instantiate2 and fixed tests

* Added automation for app contract instantiated ADOs

* Fixed contract name and cw2 references

* Disabled Instantiate2 for non-new app components

* Do not register hidden app components

* Register symlinks before instantiation

* Updated handle add app component

* Change local reference resolution format

* Added Instantiate2 ContractError

* Added component event generation

* Improved instantiate attribute returns

* Fixed failing tests

* Fixed ado type in storage

* Fix prev commit

* Added temporary ADODB query

* ADODB uses string for ado type

* Fixed failing test

* Swapped VFS to use raw query

* Removed unused query

* Fixed contract name for addresslist and auction

* [1.0.rc-1] Optional Start Time for Sale in Crowdfund & Auction (#331)

* added optional start time for crowdund, changed expiration to duration for consistency

* fixed rate limiting withdrawals schema

* made start time optional in auction's start and update sale

* set start time when not provided as current time + 1 instead of current time like in cw20 exchange

* created get_and_validate_start_time to make the functions that use start_time more concise

* start_time defaults to current_time + 1, and duration has to be above 0 across cw20 exchange, auction, crowdfund and marketplace

* forwarded time in markeplace integration test to start sale

* used block time variable for current_time in assert_auction_created()

* replaced duration with expiration

* replaced duration with expiration in crowdfund integration test

* renamed expiration to end_time in State struct and StartSale msg

* generated schemas

* implemented Milliseconds to cw20-exchange, auction, crowdfund, and marketplace

* Removed balance query (#379)

* Albert/get addresses with names for symlink (#376)

* fixed app contract's add component function to update ado addresses when component is added with symlink

* add: added unit test with component add usecase

* updated integration test with valid symlink

* lint fixed

* updated integration test to refer app name with init msg result

* fixed lint

* [RC] Ownership Request Query Response Object (#380)

* Changed response object for ownership request query

* Added expiration to ownership request query response

* Schema generation

* [1.0.rc-1] Denom Validation Fix (#384)

* validate denom now returns the actual error instead of our ContractError

* validate_denom now uses query_supply instead of query_denom_metadata

* linting

* added match statement for BankQueries in mock_querier, removed commented code

* [1.0.rc-1] AndrAddr Recipient for SendNft in CW721 (#375)

* made contract_addr's type in execute_send_nft an AndrAddr

* get raw address of contract_addr before calling send_nft

* implemented AndrAddr for execute_send's contract in CW20

* use local vfs path instead of address in auction integration test

* Lint fix and schema build

* [1.0.rc-1] Crowdfund & Auction Adjustments (#386)

* Albert/make open auction an option and add a query (#364)

* adjusted auction contract to accept unauthorized cw721 based on the authorized_token_addresses provided by the instantiate msg

* addded query to get the authorized addressses for an auction

* added pagination to permissioned actors query

* fixed lint err

* removed unused state from storage

* resolved conflict with rc branch

* updated permission system pagination

* Fixed query permissioned actors

* Linting

---------

Co-authored-by: Connor Barr <[email protected]>

* STD + Macro version bump

* Version bump

* fixed add app component error (#389)

* fix cosmwasm_1_3 error in auction (#393)

* [Fix]: Local AMP Message Recipient (#396)

* Added local resolution to Recipient struct

* Added Recipient validation

* Fixed message validate logic order for splitter

* Update lockdrop incentive token (#390)

* updated lockdrop to use Addr for incentive token

* fixed linting err

* saved incentive token's AndrAddr directly instead of resolving it

* fixed bug in lockdrop contracT

* used base migrate function in all contracts (#394)

* used base migrate function in all contracts

* updated base migrate function logic for saving contract name

* fixed linting err:

* [1.0.rc-1] AndrAddr for Some CW20 & CW721 Messages (#398)

* implemented AndrAddr to recipient in Transfer, TransferFrom, and SendFrom in CW20

* implemented AndrAddr to TransferNft's recipient in cw721

* used some vfs paths instead of raw addresses in cw20 staking integration test

* replaced all instances of env: ExecuteContext with ctx: ExecuteContext

* Integration Test Improvements (#388)

* Added instantiate 2 [WIP]

* Added instantiate2 and fixed tests

* Added automation for app contract instantiated ADOs

* Fixed contract name and cw2 references

* Disabled Instantiate2 for non-new app components

* Do not register hidden app components

* Register symlinks before instantiation

* Updated handle add app component

* Change local reference resolution format

* Integration Testing Restructure (#264)

* Mock updates

* Linting

* Added STD version to root cargo file

* Updated auction to new testing setup

* Linting

* Updated crate versions

* Fixed failing test

* Linting

* Updated OS to use new structure in integration testing

* Linting

* Added message generics to mock structs for better type safety

* Removed testing feature

* Updated final tests to new integration test standard

* Create README.md

* Update README.md

* Update README.md

* Fixed tests

* Added Instantiate2 ContractError

* Added component event generation

* Improved instantiate attribute returns

* Fixed integration tests

* Fixed failing tests

* [WIP] Mock builder

* Upgraded unit-test scaffolding

* Fixed tests

* Fixed app test

* Updated testing readme

* Improved app integration test

* Fixed tests and removed cw2 dependencies

* Fixed imports

* Lock sha256 version

* Update auction and marketplace contracts

* Fixed module permissioning

* [RC]: Marketplace and Auction Recipients (#399)

* Added recipient field to auction

* Updated marketplace for recipient

* Fixed auction recipient

* Fixed failing tests

* Improved auction test

* Version bumps

* Fix version issues from previous commit

* Remove submodule

* Schema fixes

* make changes to readme

* fix photo link

* Update README.md

* Update README.md

fix sentence

* Update README.md

add link to andr.js repo

* [1.0.rc-1] MillisecondsDuration and MillisecondsExpiration types (#403)

* replaced Milliseconds with either MillisecondsDuration or MillisecondsExpiration

* Splitter struct's lock comment improvement and change to MillisecondsExpiration

* Test

* feat: Added git hooks

* fix: added conventional commits config

* [1.0.rc-1] CW20 Support for the Auction & Marketplace ADOs (#391)

* added valid_cw20_contract in auction's state, adjusted validate_denom to accept the valid cw20 contract

* execute_place_bid_cw20 for auction

* added support for cw20 in auction's execute_claim

* returned the original order of messages in the response

* cw20 support for claim, adjusted validate_denom, use permissioning system to set valid cw20

* added unit tests for cw20 support

* renamed cw20hookmsg's purchase to PlaceBid

* updated auction's schema

* changed ReceiveCw20 to Receive, integration test for auction with cw20

* updated auction's schema

* additional checks for auction_cw20 integration test

* improved error message for InvalidFunds

* unit test adjustment for new error message

* moved denom_validation to denom file in the common folder for easier implementation for other contracts

* added uses_cw20 in auction state

* cw20 support for marketplace ADO

* added unit tests for cw20 support in Marketplace

* added integration test for cw20-enabled marketplace, adjusted tax payments when buying with cw20

* stopped sending 0 funds when tax recipient and amount are None in Marketplace

* improved some error messages

* added denom validation for crowdfund

* changed whitelist to in AuctionState to a bool, validate whitelist in auction using permissioning system, whitelist is set per individual auction

* implemented new whitelist system to update_auction

* adjustments to denom.rs, auction, marketpalce, splitter and crowdfund

* fixed cw20 tax payments in auction, same implementation as marketplace

* fmt fix

* added recipient's address support for cw20 auction

* removed check that prevented open auctions

* added conditional statement for after tax payment in marketplace

* resolves #402

* added recipient address support for cw20 sales in Marketpalce

* added recipient to cw20 auction integration test

* added whitelist testing in auction integration test

* implemented genereate_msg_cw20 in marketplace and auction

* refactor: remove unncessary checks, improve error message, add same check for denom validation in update auction as in start auction

* added fund limit to the create batch (#404)

* added lower fund limit to the create batch

* added validation for maximum funds for batch creation

* fixed linting err

* fixed validation process error

* updated test case

* feat: Added MockVestingContract struct to Vesting Contract

* fix: Removed unused file

---------

Co-authored-by: Connor Barr <[email protected]>

* [RC]: Removed Expiration from Permissioning and UpdateOwner messages (#408)

* fix: Replaced Expiration with MillisecondsExpiration in UpdateOwner

Old messages will be incompatible with this change if they have an expiration field

* fix: Replaced Expiration with MillisecondsExpiration in permissioning messages

Old permissioning messages will be incompatible if they contained an expiration

* fix: Fixes cw20 validation in marketplace

* chore: ✅ Bumped all contract versions to 1.0.0

* chore: 📦️ Fixed crate version references for publishing

* chore: 🔧 Added descriptions for all contract packages

* fix: 🔧 Added license to Andromeda Ecosystem crate

* test: 🐛 Fixed failing cw20 staking integration test

* Update README.md

fix link and change pic reference to the PR branch

* Fix: Instantiate 2 address length (#467)

* fix: instantiate2 injective error

* Bump version for app-contract and app-package

* chore: remove all schema files

* chore: resolved compiler errors

---------

Co-authored-by: Joe Monem <[email protected]>
Co-authored-by: Anshudhar Kumar Singh <[email protected]>
Co-authored-by: Joe Monem <[email protected]>
Co-authored-by: Speed Demon <[email protected]>
Co-authored-by: Anshudhar Kumar Singh <[email protected]>
Co-authored-by: daniel <[email protected]>
Co-authored-by: daniel-wehbe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants