From b22ba6325127852e39ed0f55d11edcba90eec6b5 Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Sun, 12 May 2024 18:41:15 +0100 Subject: [PATCH 1/2] initialize all storage variables --- target_chains/fuel/contracts/pyth-contract/src/main.sw | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target_chains/fuel/contracts/pyth-contract/src/main.sw b/target_chains/fuel/contracts/pyth-contract/src/main.sw index 4fd155f9b9..874d11c5e9 100644 --- a/target_chains/fuel/contracts/pyth-contract/src/main.sw +++ b/target_chains/fuel/contracts/pyth-contract/src/main.sw @@ -502,6 +502,7 @@ impl PythInit for Contract { i += 1; } + storage.latest_price_feed.write(StorageMap:: {}); storage .valid_time_period_seconds @@ -529,8 +530,10 @@ impl PythInit for Contract { storage.governance_data_source.write(governance_data_source); storage.wormhole_governance_data_source.write(wormhole_governance_data_source); - + storage.governance_data_source_index.write(0); + storage.wormhole_consumed_governance_actions.write(StorageMap:: {}); storage.chain_id.write(chain_id); + storage.last_executed_governance_sequence.write(0); // 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 renounce_ownership(); From 914ee269d2a8045fa2dbff02a6e0b2e075ac7b51 Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Sun, 12 May 2024 18:42:32 +0100 Subject: [PATCH 2/2] initialize all storage vars --- target_chains/fuel/contracts/pyth-contract/src/main.sw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target_chains/fuel/contracts/pyth-contract/src/main.sw b/target_chains/fuel/contracts/pyth-contract/src/main.sw index 874d11c5e9..07b686ead8 100644 --- a/target_chains/fuel/contracts/pyth-contract/src/main.sw +++ b/target_chains/fuel/contracts/pyth-contract/src/main.sw @@ -535,6 +535,8 @@ impl PythInit for Contract { storage.chain_id.write(chain_id); storage.last_executed_governance_sequence.write(0); + storage.current_implementation.write(Identity::Address(Address::from(ZERO_B256))); + // 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 renounce_ownership();