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

feat: Conditional Splitter ADO #441

Merged
merged 29 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d0966ee
feat: conditional splitter building blocks
joemonem Apr 24, 2024
172852d
refactor: remove Range struct, modify Threshold to use min instead of…
joemonem Apr 24, 2024
7a1f40e
test: execute_send with two thresholds and two recipients
joemonem Apr 24, 2024
2025749
refactor: funds sent refer to overall contract, different percentages…
joemonem Apr 24, 2024
531c2fb
test: execute_send adjusted for previous refactor
joemonem Apr 24, 2024
d53ac11
test: uncommented some unit tests
joemonem Apr 25, 2024
c369c4d
feat: cross from one threshold to the next in one transaction
joemonem Apr 25, 2024
088022a
refactor: add address_percent field to Threshold
joemonem Apr 26, 2024
6920b4a
chore: removed unused code
joemonem Apr 26, 2024
d1adcb4
test: test_validate_thresholds
joemonem Apr 26, 2024
a79c79a
refactor: early exit for total percentage exceeding 100
joemonem Apr 29, 2024
f9c996d
refactor: get next_threshold_recipient_percent after confirming that …
joemonem Apr 29, 2024
d51e6f1
refactor: remove funds_distributed, threshold solely depends on the f…
joemonem Apr 29, 2024
f1133e7
test: conditional splitter integration test
joemonem Apr 29, 2024
024b7df
test: test case for unmet threshold
joemonem Apr 29, 2024
a12c2a7
fix: conditional splitter's schema was using regular splitter's messages
joemonem Apr 29, 2024
ce929d7
refactor: update thresholds execute msg
joemonem Apr 29, 2024
7b7eab2
refactor: simplify lock_time handling in instantiation
joemonem Apr 29, 2024
4023fed
test: update thresholds
joemonem Apr 29, 2024
f84c4ea
refactor: rename lock to lock_time for consistency
joemonem Apr 30, 2024
5446ac7
feat: support the distribution of up to 5 distinct coins at a time
joemonem Apr 30, 2024
89213ed
Merge branch 'development' into joe/conditional-splitter
joemonem May 7, 2024
112aea2
chore: conditional splitter changelog entry
joemonem May 7, 2024
be893fe
refactor: add non-empty check for validate_thresholds, add non-zero c…
joemonem May 13, 2024
e2ccee5
fix: allow owner to update lock anytime, check amount owed to recipie…
joemonem May 14, 2024
7cfc6a7
refactor: use .mul_floor instead of directly multiplying a Uint128 wi…
joemonem May 14, 2024
fd80a39
refactor: check if packet has messages before adding it to msgs
joemonem May 15, 2024
091ecaf
chore: update schema for conditional splitter
joemonem May 16, 2024
ded3b28
chore: bumped conditional splitter version to 1.1.0
joemonem May 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `ADOBaseVersion` query to all ADOs [(#416)](https://github.com/andromedaprotocol/andromeda-core/pull/416)
- Staking: Added ability to remove/replace reward token [(#418)](https://github.com/andromedaprotocol/andromeda-core/pull/418)
- Added Expiry Enum [(#419)](https://github.com/andromedaprotocol/andromeda-core/pull/419)
- Added Conditional Splitter [(#441)](https://github.com/andromedaprotocol/andromeda-core/pull/441)

### Changed

Expand Down
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
2 changes: 2 additions & 0 deletions contracts/finance/andromeda-conditional-splitter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
Cargo.lock
32 changes: 32 additions & 0 deletions contracts/finance/andromeda-conditional-splitter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "andromeda-conditional-splitter"
version = "1.0.0"
edition = "2021"
rust-version = "1.75.0"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []
testing = ["cw-multi-test", "andromeda-testing"]


[dependencies]
cosmwasm-std = { workspace = true }
cosmwasm-schema = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }

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

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }

[dev-dependencies]
andromeda-app = { workspace = true }
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use andromeda_finance::conditional_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,

}
}
Loading
Loading