Skip to content

Commit

Permalink
modify first round so it can start late
Browse files Browse the repository at this point in the history
- for testing purposes, will decide if we keep this logic for prod
- formatting
- new sepolia instances
  • Loading branch information
0xDegenDeveloper committed Oct 17, 2024
1 parent c39f165 commit 319fcbc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
15 changes: 8 additions & 7 deletions sncast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ Copy .starknet_accounts/ex.starknet_open_zeppelin_accounts.json into: .starknet_

`sncast declare -c FossilClient --fee-token eth`

> Class Hash: 0x5b5b7facaf410276e1f15c0093ec172066243e82257e923c710f35b1ca29b4d (1930 UTC oct 13)
> Class Hash: 0x5b5b7facaf410276e1f15c0093ec172066243e82257e923c710f35b1ca29b4d (0400 UTC oct 17)
`sncast declare -c OptionRound --fee-token eth`

> Class Hash: 0x0414e758a0be04c15fde58f7cbfd9f72b05646a3a3ee6f2e708e67c24469adc3 (1930 UTC oct 13)
> Class Hash: 0xc3120f7bdeaa79d89614731abb645e64cb5bc4e05b2807e18ba57179fd6547 (0400 UTC oct 17)
`sncast declare -c Vault --fee-token eth`

> Class Hash: 0x413a8f2c623ab40e5820152018c6a5fb19085c30750641ced024061ff04c923 (1930 UTC oct 13)
> Class Hash: 0x1bf112592e295c5ca2f9a1fc580893305fd9cb84e480e59994d757d60676376 (0400 UTC oct 17)
### Deploying a Fossil Client

1. fossil_processor_address: doesnt matter for now

`sncast deploy --fee-token eth --class-hash 0x5b5b7facaf410276e1f15c0093ec172066243e82257e923c710f35b1ca29b4d --constructor-calldata 0xdeadbeef`

> Fossil Client: 0x698e701e57224d9200409b4516206630174817e038600a0da22386768251fc5 (1930 UTC oct 13)
> Fossil Client: 0x611f705ff76a332f8861cbedaa267ba2ab4b9d5a5929dcb28dbb46b02f5db16 (0400 UTC oct 17)
### Deploying a Vault

Expand All @@ -31,11 +31,12 @@ Copy .starknet_accounts/ex.starknet_open_zeppelin_accounts.json into: .starknet_
1. fossil_client_address
2. eth_contract_address
3. option_round_class_hash
4. vault_type
4. alpha
5. strike_level

`sncast deploy --fee-token eth --class-hash 0x413a8f2c623ab40e5820152018c6a5fb19085c30750641ced024061ff04c923 --constructor-calldata 0x698e701e57224d9200409b4516206630174817e038600a0da22386768251fc5 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 0x0414e758a0be04c15fde58f7cbfd9f72b05646a3a3ee6f2e708e67c24469adc3 0x1`
`sncast deploy --fee-token eth --class-hash 0x1bf112592e295c5ca2f9a1fc580893305fd9cb84e480e59994d757d60676376 --constructor-calldata 0x611f705ff76a332f8861cbedaa267ba2ab4b9d5a5929dcb28dbb46b02f5db16 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 0xc3120f7bdeaa79d89614731abb645e64cb5bc4e05b2807e18ba57179fd6547 5555 0`

> Vault: 0x7da35131106358927568c32faaee3eb2063b154578be6be2e3a2582db39fc56 (1930 UTC oct 13)
> Vault: 0x115736e919f6825a64431760d228a937680ebae18a672f03b2c996fe1405a68 (0400 UTC oct 17)
### Allowing a Vault or OptionRound to spend tokens

Expand Down
18 changes: 3 additions & 15 deletions src/tests/vault/state_transition/option_settle_tests.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,7 @@ fn test_null_round_settling() {
options_available, reserve_price, option_buyer, Errors::NoOptionsToBidFor
);

accelerate_to_running_custom(
ref vault,
array![].span(),
array![].span(),
array![].span()
);
accelerate_to_running_custom(ref vault, array![].span(), array![].span(), array![].span());

accelerate_to_settled(ref vault, 2 * current_round.get_strike_price());
}
Expand All @@ -412,16 +407,9 @@ fn test_null_round_settling() {
fn test_no_buyers_round_settling() {
let (mut vault, _) = setup_facade();
let mut current_round = vault.get_current_round();
accelerate_to_auctioning(
ref vault
);
accelerate_to_auctioning(ref vault);

accelerate_to_running_custom(
ref vault,
array![].span(),
array![].span(),
array![].span()
);
accelerate_to_running_custom(ref vault, array![].span(), array![].span(), array![].span());

accelerate_to_settled(ref vault, 2 * current_round.get_strike_price());
}
Expand Down
8 changes: 4 additions & 4 deletions src/vault/contract.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,10 @@ mod Vault {
self.l1_data.entry(current_round_id).write(l1_data);
} // @dev If the first round is Open, the result is being used to set the pricing data for its auction to start
else {
// @dev Ensure now < auction start date
let now = get_block_timestamp();
let auction_start_date = current_round.get_auction_start_date();
assert(now < auction_start_date, Errors::L1DataNotAcceptedNow);
// // @dev Ensure now < auction start date
// let now = get_block_timestamp();
// let auction_start_date = current_round.get_auction_start_date();
// assert(now < auction_start_date, Errors::L1DataNotAcceptedNow);

// @dev Ensure the job request's timestamp is for the round's deployment date
let deployment_date = current_round.get_deployment_date();
Expand Down

0 comments on commit 319fcbc

Please sign in to comment.