Feature Request
Area: Smart Contract
File: contracts/solar_grid/src/lib.rs
Description
Meters are permanently tied to the original owner. There is no way to transfer ownership when a household sells their solar setup or a provider reassigns a meter to a new customer.
Implementation Guide
Add to lib.rs:
pub fn transfer_ownership(env: Env, meter_id: Symbol, new_owner: Address) {
let key = DataKey::Meter(meter_id);
let mut meter: Meter = env.storage().persistent().get(&key).expect("meter not found");
meter.owner.require_auth(); // current owner must sign
meter.owner = new_owner;
env.storage().persistent().set(&key, &meter);
}
Ensure the new_owner address is a valid Stellar account before storing.
Definition of Done
Feature Request
Area: Smart Contract
File: contracts/solar_grid/src/lib.rs
Description
Meters are permanently tied to the original owner. There is no way to transfer ownership when a household sells their solar setup or a provider reassigns a meter to a new customer.
Implementation Guide
Add to lib.rs:
Ensure the new_owner address is a valid Stellar account before storing.
Definition of Done