Skip to content

Commit

Permalink
chore: update dojo-defi to 2.2.0 (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l authored Sep 13, 2023
1 parent 825b9dc commit f0ba21b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
6 changes: 2 additions & 4 deletions crates/dojo-defi/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[package]
cairo-version = "2.1.1"
cairo-version = "2.2.0"
description = "Implementations of a defi primitives for the Dojo framework"
name = "dojo_defi"
version = "0.2.1"

[lib]

[dependencies]
# Next lines to be reverted once Cubit repo is updated.
# cubit = { git = "https://github.com/influenceth/cubit" }
cubit = {git = "https://github.com/ametel01/cubit.git"}
cubit = { git = "https://github.com/influenceth/cubit" }

dojo = { path = "../dojo-core" }

Expand Down
15 changes: 8 additions & 7 deletions crates/dojo-defi/src/market/components.cairo
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use option::OptionTrait;
use starknet::ContractAddress;
use traits::{Into, TryInto};

use dojo::component::StorageSize;

use dojo::StorageSize;

// Cubit fixed point math library
use cubit::f128::types::fixed::Fixed;
Expand All @@ -12,8 +8,13 @@ const SCALING_FACTOR: u128 = 10000;

impl StorageSizeFixed of StorageSize<Fixed> {
#[inline(always)]
fn len() -> usize {
2
fn unpacked_size() -> usize {
1
}

#[inline(always)]
fn packed_size() -> usize {
129
}
}

Expand Down
4 changes: 0 additions & 4 deletions crates/dojo-defi/src/market/constant_product_market.cairo
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use traits::{Into, TryInto};
use option::OptionTrait;
use starknet::ContractAddress;

use dojo_defi::market::components::Market;

use cubit::f128::types::fixed::{Fixed, FixedTrait};

const SCALING_FACTOR: u128 = 10000;
Expand Down
8 changes: 0 additions & 8 deletions crates/dojo-defi/src/market/systems.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#[system]
mod Buy {
use traits::Into;
use array::ArrayTrait;
use dojo_defi::market::components::{Item, Cash, Market};
use dojo_defi::market::constant_product_market::MarketTrait;
use dojo::world::Context;
Expand Down Expand Up @@ -40,8 +38,6 @@ mod Buy {

#[system]
mod Sell {
use traits::Into;
use array::ArrayTrait;
use dojo_defi::market::components::{Item, Cash, Market};
use dojo_defi::market::constant_product_market::MarketTrait;
use dojo::world::Context;
Expand Down Expand Up @@ -81,8 +77,6 @@ mod Sell {

#[system]
mod AddLiquidity {
use traits::Into;
use array::ArrayTrait;
use dojo_defi::market::components::{Item, Cash, Market, Liquidity};
use dojo_defi::market::constant_product_market::MarketTrait;
use dojo::world::Context;
Expand Down Expand Up @@ -132,8 +126,6 @@ mod AddLiquidity {

#[system]
mod RemoveLiquidity {
use traits::Into;
use array::ArrayTrait;
use dojo_defi::market::components::{Item, Cash, Market, Liquidity};
use dojo_defi::market::constant_product_market::MarketTrait;
use dojo::world::Context;
Expand Down

0 comments on commit f0ba21b

Please sign in to comment.