Skip to content

Commit

Permalink
fix(target_chains/fuel): initialize all storage variables (#1566)
Browse files Browse the repository at this point in the history
* initialize all storage variables

* initialize all storage vars
  • Loading branch information
cctdaniel authored May 12, 2024
1 parent 975a9e6 commit ae8fab1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion target_chains/fuel/contracts/pyth-contract/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ impl PythInit for Contract {

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

storage
.valid_time_period_seconds
Expand Down Expand Up @@ -529,8 +530,12 @@ 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::<b256, bool> {});
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();
Expand Down

0 comments on commit ae8fab1

Please sign in to comment.