Skip to content

Commit

Permalink
chore: Merge v1.0.x changes in to development (#494)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
8 people authored Jun 28, 2024
1 parent fbe0197 commit 485a933
Show file tree
Hide file tree
Showing 23 changed files with 245 additions and 135 deletions.
171 changes: 90 additions & 81 deletions Cargo.lock

Large diffs are not rendered by default.

135 changes: 104 additions & 31 deletions README.md

Large diffs are not rendered by default.

Binary file added asset/Andromeda-IBC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion contracts/app/andromeda-app-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "andromeda-app-contract"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
rust-version = "1.75.0"

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion contracts/data-storage/andromeda-primitive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ andromeda-data-storage = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cw-utils = { workspace = true }
cw20 = { workspace = true }


andromeda-std = { workspace = true}
andromeda-std = { workspace = true }
andromeda-finance = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cw20 = { workspace = true }
cw20-base = { workspace = true }
cw-asset = { workspace = true }

andromeda-std = { workspace = true}
andromeda-std = { workspace = true }
andromeda-fungible-tokens = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use cosmwasm_std::{
ensure, from_json, Addr, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Response, Storage,
Uint128,
};

use cw20::Cw20ReceiveMsg;
use cw_asset::{Asset, AssetInfo, AssetInfoUnchecked};

Expand Down Expand Up @@ -131,7 +130,6 @@ pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result<Respon
&ctx.amp_ctx,
msg.as_ref(),
)?;

let res = match msg {
ExecuteMsg::Receive(msg) => receive_cw20(ctx, msg),
ExecuteMsg::AddRewardToken { reward_token } => execute_add_reward_token(ctx, reward_token),
Expand Down
2 changes: 1 addition & 1 deletion contracts/fungible-tokens/andromeda-cw20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cw-utils = { workspace = true }
cw20 = { workspace = true }
cw20-base = { workspace = true }

andromeda-std = { workspace = true, features = ["rates"]}
andromeda-std = { workspace = true, features = ["rates"] }
andromeda-fungible-tokens = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion contracts/fungible-tokens/andromeda-lockdrop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cw-asset = { workspace = true }

cw20 = { workspace = true }

andromeda-std = { workspace = true}
andromeda-std = { workspace = true }
andromeda-fungible-tokens = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion contracts/non-fungible-tokens/andromeda-auction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cw721 = { workspace = true }

cw20 = { workspace = true }

andromeda-std = { workspace = true, features = ["rates"]}
andromeda-std = { workspace = true, features = ["rates"] }
andromeda-non-fungible-tokens = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
21 changes: 20 additions & 1 deletion contracts/non-fungible-tokens/andromeda-auction/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use andromeda_std::{
common::{
actions::call_action,
call_action::get_action_name,
denom::{Asset, SEND_CW20_ACTION},
denom::{validate_denom, Asset, SEND_CW20_ACTION},
encode_binary,
expiration::{expiration_from_milliseconds, get_and_validate_start_time, Expiry},
Funds, Milliseconds, OrderBy,
Expand Down Expand Up @@ -359,6 +359,24 @@ fn execute_update_auction(
nonpayable(&info)?;
let (coin_denom, uses_cw20) = coin_denom.get_verified_asset(deps.branch(), env.clone())?;

if uses_cw20 {
let valid_cw20_auction = ADOContract::default()
.is_permissioned(
deps.branch(),
env.clone(),
SEND_CW20_ACTION,
coin_denom.clone(),
)
.is_ok();
ensure!(
valid_cw20_auction,
ContractError::InvalidFunds {
msg: "Non-permissioned CW20 asset sent".to_string()
}
);
} else {
validate_denom(deps.as_ref(), coin_denom.clone())?;
}
let mut token_auction_state =
get_existing_token_auction_state(deps.storage, &token_id, &token_address)?;
ensure!(
Expand All @@ -369,6 +387,7 @@ fn execute_update_auction(
!token_auction_state.start_time.is_expired(&env.block),
ContractError::AuctionAlreadyStarted {}
);

ensure!(
!end_time.get_time(&env.block).is_zero(),
ContractError::InvalidExpiration {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
mock_dependencies_custom, MOCK_TOKEN_ADDR, MOCK_TOKEN_OWNER, MOCK_UNCLAIMED_TOKEN,
},
};

use andromeda_non_fungible_tokens::{
auction::{
AuctionInfo, AuctionStateResponse, Cw20HookMsg, Cw721HookMsg, ExecuteMsg, InstantiateMsg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cw-utils = { workspace = true }
cw721 = { workspace = true }
cw20 = { workspace = true }

andromeda-std = { workspace = true, features = ["rates"]}
andromeda-std = { workspace = true, features = ["rates"] }
andromeda-non-fungible-tokens = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ fn test_execute_buy_works() {
let mut deps = mock_dependencies_custom(&[]);
let mut env = mock_env();

let _res = init(deps.as_mut(), None);
let _res = init(
deps.as_mut(),
Some(AndrAddr::from_string(MOCK_CW20_CONTRACT)),
);

start_sale(deps.as_mut(), Asset::NativeToken("uusd".to_string()));
assert_sale_created(deps.as_ref(), env.clone(), "uusd".to_string(), false);
Expand Down
3 changes: 0 additions & 3 deletions contracts/os/andromeda-adodb/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/os/andromeda-vfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cosmwasm-schema = { workspace = true }
cw-storage-plus = { workspace = true }
serde = { version = "1.0.127", default-features = false, features = ["derive"] }

andromeda-std = { workspace = true}
andromeda-std = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
Expand Down
1 change: 0 additions & 1 deletion git-conventional-commits.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
convention:
commitTypes:
- feat
Expand Down
1 change: 0 additions & 1 deletion localrelayer
Submodule localrelayer deleted from 43072c
13 changes: 13 additions & 0 deletions packages/andromeda-app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ impl AppComponent {
let creator = api.addr_canonicalize(parent_addr.as_str())?;
let new_addr = instantiate2_address(&checksum, &creator, &salt).unwrap();

// Instantiate 2 impl uses default cannonical address of 32 bytes (SHA 256). But as mentioned here -
// https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/docs/architecture/adr-028-public-key-addresses.md
// chains can use different length for cannonical address, eg, injective uses 20 (eth based).
// Instead of having fallback for each chain we can use parent address, which itself is a contract.
// Slice the default 32 bytes canonical address to size of parent cannonical address

let cannonical_parent_addr = api.addr_canonicalize(parent_addr.as_str())?;
let new_addr = new_addr
.as_slice()
.split_at(cannonical_parent_addr.len())
.0
.into();

Ok(Some(api.addr_humanize(&new_addr)?))
}

Expand Down
3 changes: 1 addition & 2 deletions packages/andromeda-data-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ cosmwasm-schema = { workspace = true }
serde = { version = "1.0.127", default-features = false, features = ["derive"] }
cw-utils = { workspace = true }

andromeda-std = { workspace = true, features=[] }

andromeda-std = { workspace = true, features = [] }
6 changes: 3 additions & 3 deletions packages/std/src/ado_contract/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ impl<'a> ADOContract<'a> {
/// Handles receiving and verifies an AMPPkt from the Kernel before executing the appropriate messages.
///
/// Calls the provided handler with the AMP packet attached within the context.
pub fn execute_amp_receive<E: DeserializeOwned>(
pub fn execute_amp_receive<M: DeserializeOwned>(
&self,
ctx: ExecuteContext,
mut packet: AMPPkt,
handler: ExecuteContextFunction<E>,
handler: ExecuteContextFunction<M>,
) -> Result<Response, ContractError> {
packet.verify_origin(&ctx.info, &ctx.deps.as_ref())?;
let ctx = ctx.with_ctx(packet.clone());
let msg_opt = packet.messages.pop();
if let Some(msg_opt) = msg_opt {
let msg: E = from_json(msg_opt.message)?;
let msg: M = from_json(msg_opt.message)?;
let response = handler(ctx, msg)?;
Ok(response)
} else {
Expand Down

0 comments on commit 485a933

Please sign in to comment.