//# publish module 0x1.M { import 0x1.vector; struct R has key { v: vector } public publish(s: &signer) { let v: vector; label b0: v = vector.empty(); vector.push_back(&mut v, 100); vector.push_back(&mut v, 200); move_to(move(s), R { v: move(v) }); return; } public borrow_and_modify(addr: address) acquires R { label b0: *vector.borrow_mut(&mut borrow_global_mut(move(addr)).R::v, 0) = 300; return; } public verify_effects(addr: address) acquires R { label b0: assert(*vector.borrow(&borrow_global(move(addr)).R::v, 0) == 300, 1000); return; } } //# run --signers 0x1 import 0x1.M; main(s: signer) { label b0: M.publish(&s); return; } //# run --signers 0x1 import 0x1.M; import 0x1.signer; main(s: signer) { label b0: M.borrow_and_modify(signer.address_of(&s)); return; } //# run --signers 0x1 import 0x1.M; import 0x1.signer; main(s: signer) { label b0: M.verify_effects(signer.address_of(&s)); return; }