Skip to content

Commit ae8fab1

Browse files
authored
fix(target_chains/fuel): initialize all storage variables (#1566)
* initialize all storage variables * initialize all storage vars
1 parent 975a9e6 commit ae8fab1

File tree

1 file changed

+6
-1
lines changed
  • target_chains/fuel/contracts/pyth-contract/src

1 file changed

+6
-1
lines changed

target_chains/fuel/contracts/pyth-contract/src/main.sw

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ impl PythInit for Contract {
502502

503503
i += 1;
504504
}
505+
storage.latest_price_feed.write(StorageMap::<PriceFeedId, PriceFeed> {});
505506

506507
storage
507508
.valid_time_period_seconds
@@ -529,8 +530,12 @@ impl PythInit for Contract {
529530

530531
storage.governance_data_source.write(governance_data_source);
531532
storage.wormhole_governance_data_source.write(wormhole_governance_data_source);
532-
533+
storage.governance_data_source_index.write(0);
534+
storage.wormhole_consumed_governance_actions.write(StorageMap::<b256, bool> {});
533535
storage.chain_id.write(chain_id);
536+
storage.last_executed_governance_sequence.write(0);
537+
538+
storage.current_implementation.write(Identity::Address(Address::from(ZERO_B256)));
534539

535540
// This function revokes ownership of the current owner and disallows any new owners. https://github.com/FuelLabs/sway-libs/blob/8045a19e3297599750abdf6300c11e9927a29d40/libs/src/ownership.sw#L89-L99
536541
renounce_ownership();

0 commit comments

Comments
 (0)