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

Test ci #4

Merged
merged 28 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d7f8389
feat: add auction component + get_zone in position
aymericdelab Sep 18, 2023
47a60cb
feat: create_labor_auction
aymericdelab Sep 19, 2023
4716038
feat: create_labor_auction test + dojo_defi linear
aymericdelab Sep 19, 2023
29271c4
feat: use vrgda from dojo_defi + create labor cost
aymericdelab Sep 20, 2023
216f4c2
feat: add labor auction in build_labor
aymericdelab Sep 20, 2023
fa46316
feat: make build_labor tests work
aymericdelab Sep 21, 2023
7124c41
feat: purchase labor
aymericdelab Sep 21, 2023
824ae9c
fix: replace dojo_defi temp fix
aymericdelab Sep 21, 2023
3821b47
feat: use 1000 precision for resources
aymericdelab Sep 22, 2023
298a4b8
feat: new labor costs + fix precision bugs
aymericdelab Sep 22, 2023
215d82d
feat: purchase labor in client + bug fixes + contract optimization
aymericdelab Sep 23, 2023
a4144a1
Merge branch 'refactor-amounts' into labor-vrgda
aymericdelab Sep 23, 2023
6a4d4a2
feat: added realm zone labor price in ui
aymericdelab Sep 23, 2023
6de141f
Merge branch 'main' into labor-vrgda
aymericdelab Sep 23, 2023
0ba132f
fix: test issue
aymericdelab Sep 23, 2023
916a0b7
switch to v0.2.2
aymericdelab Sep 25, 2023
6bc6f5c
refactor: change world address (back to v0.2.2)
aymericdelab Sep 25, 2023
2be6426
fix: fix bug labor contract
aymericdelab Sep 25, 2023
d4e18a6
fix: fix labor build/ harvest client issues
aymericdelab Sep 25, 2023
4a3cac7
fix: dojo version
aymericdelab Sep 25, 2023
a1861df
fix: remove target_price because not used
aymericdelab Sep 26, 2023
1a0852c
fix: dojo version
aymericdelab Sep 26, 2023
fad8dd6
fix: fix labor bugs + refactor
aymericdelab Sep 27, 2023
d46a962
refactor: vrgda
aymericdelab Sep 27, 2023
3e0723d
feat: add time interval for price update
aymericdelab Sep 28, 2023
16ae108
Update test.yml
credence0x Sep 28, 2023
63136f2
Update Scarb.toml
credence0x Sep 28, 2023
f614971
add SerdeLen to ResourceCost
credence0x Sep 28, 2023
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
Prev Previous commit
Next Next commit
refactor: vrgda
  • Loading branch information
aymericdelab committed Sep 27, 2023
commit d46a96286b3ba417b4958713c7d3ec87f9fa9d16
13 changes: 2 additions & 11 deletions contracts/src/components/labor_auction.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ impl LinearVRGDAImpl of LinearVRGDATrait {
- self.get_target_sale_time(sold + FixedTrait::new(1, false)))
)
}

fn get_reverse_vrgda_price(self: @LinearVRGDA, time_since_start: Fixed, sold: Fixed) -> Fixed {
*self.target_price
* exp(
(*self.decay_constant * FixedTrait::new(1, true))
* (time_since_start
- self.get_target_sale_time(sold + FixedTrait::new(1, false)))
)
}
}


Expand Down Expand Up @@ -98,7 +89,7 @@ impl LaborAuctionImpl of LaborAuctionTrait {
)
}

fn sell(ref self: LaborAuction, world: IWorldDispatcher) {
fn sell(ref self: LaborAuction) {
self.sold += 1;
}
}
Expand Down Expand Up @@ -189,7 +180,7 @@ mod tests {
if i > 50 {
break;
}
auction.sell(world);
auction.sell();
i += 1;
};

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/systems/labor/purchase_labor.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mod PurchaseLabor {
index += 1;
};

labor_auction.sell(ctx.world);
labor_auction.sell();
labor_units_remaining -= 1;
};

Expand Down