Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ workflows in `frontend/src/app/version-control/page.tsx`.
`frontend/src/lib/version-control/engine.ts`.
- Core attestation creation and verification logic lives in
`frontend/src/lib/open-source-trainer/identity.ts`.
>>>>>>> origin/main

## 🤝 Contributing

Expand Down
58 changes: 49 additions & 9 deletions contracts/Cargo.lock

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

53 changes: 22 additions & 31 deletions contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
[package]
name = "soroban-certificate-contract"
version = "0.0.0"
edition = "2021"

[workspace]
members = [
".",
"proxy",
"implementation_v1",
"implementation_v2",
"smart_vault",
"payment_streaming",
"payment_gateway",
"auth_checker",
"automated_testing_suite",
"cicd_pipeline",
"commit_reveal_rng",
"quadratic_funding",
"multisig_wallet_timelock",
"did_registry",
"content_management_system",
"continuous_bonding_curve",
"course_proxy",
"auth_checker",
"cross_chain_client",
"dao_governance",
"did_registry",
"fractional_nft_vault",
"freelance-platform",
"pr_simulation",
"hackathon-team-matching",
"content_management_system",
"hello_world",
"implementation_v1",
"implementation_v2",
"lending_pool",
"multisig_wallet_timelock",
"parametric_insurance",
"payment_gateway",
"payment_streaming",
"pr_simulation",
"proxy",
"quadratic_funding",
"smart_vault",
"testnet_faucet_integration",
"automated_testing_suite",
"cicd_pipeline"
"zk_proof_verifier",
]

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

[dependencies]
soroban-sdk = "22.0.0"

[dev-dependencies]
soroban-sdk = { version = "22.0.0", features = ["testutils"] }
rand = { version = "0.8", features = ["small_rng"] }
ed25519-dalek = { version = "2", default-features = false, features = ["std", "rand_core"] }
resolver = "2"
2 changes: 0 additions & 2 deletions contracts/continuous_bonding_curve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name = "continuous-bonding-curve"
version = "0.1.0"
edition = "2021"

[workspace]

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

Expand Down
28 changes: 21 additions & 7 deletions contracts/continuous_bonding_curve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ impl ContinuousBondingCurveContract {
admin.require_auth();
env.storage().instance().set(&DataKey::Admin, &admin);
env.storage().instance().set(&DataKey::Slope, &slope);
env.storage().instance().set(&DataKey::BasePrice, &base_price);
env.storage()
.instance()
.set(&DataKey::BasePrice, &base_price);
env.storage().instance().set(&DataKey::Supply, &0i128);
env.storage().instance().set(&DataKey::Reserve, &0i128);
}
Expand Down Expand Up @@ -70,9 +72,13 @@ impl ContinuousBondingCurveContract {
panic_with_error!(&env, CurveError::SlippageExceeded);
}

env.storage().instance().set(&DataKey::Supply, &(supply + tokens_out));
env.storage()
.instance()
.set(&DataKey::Supply, &(supply + tokens_out));
let reserve = read_i128(&env, DataKey::Reserve);
env.storage().instance().set(&DataKey::Reserve, &(reserve + cost));
env.storage()
.instance()
.set(&DataKey::Reserve, &(reserve + cost));
cost
}

Expand Down Expand Up @@ -108,8 +114,12 @@ impl ContinuousBondingCurveContract {
panic_with_error!(&env, CurveError::InvalidAmount);
}

env.storage().instance().set(&DataKey::Supply, &(supply - tokens_in));
env.storage().instance().set(&DataKey::Reserve, &(reserve - payout));
env.storage()
.instance()
.set(&DataKey::Supply, &(supply - tokens_in));
env.storage()
.instance()
.set(&DataKey::Reserve, &(reserve - payout));
payout
}

Expand All @@ -135,7 +145,10 @@ impl ContinuousBondingCurveContract {
}

pub fn state(env: Env) -> (i128, i128) {
(read_i128(&env, DataKey::Supply), read_i128(&env, DataKey::Reserve))
(
read_i128(&env, DataKey::Supply),
read_i128(&env, DataKey::Reserve),
)
}
}

Expand Down Expand Up @@ -195,7 +208,8 @@ mod tests {

client.initialize(&admin, &2, &100);

let buy_cost = client.buy_exact_tokens(&user, &100, &30_000, &(env.ledger().timestamp() + 100));
let buy_cost =
client.buy_exact_tokens(&user, &100, &30_000, &(env.ledger().timestamp() + 100));
assert!(buy_cost > 0);

let (supply, reserve) = client.state();
Expand Down
2 changes: 0 additions & 2 deletions contracts/dao_governance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name = "dao-governance"
version = "0.1.0"
edition = "2021"

[workspace]

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

Expand Down
Loading
Loading