//# publish module 0x1.M { struct R has key { v: vector } public publish(s: &signer) { let v: vector; label b0: v = vec_pack_1(100); vec_push_back(&mut v, 200); move_to(move(s), R { v: move(v) }); return; } public borrow_and_modify(addr: address) acquires R { let r: &mut Self.R; let v: &mut vector; label b0: r = borrow_global_mut(move(addr)); v = &mut move(r).R::v; *vec_mut_borrow(move(v), 0) = 300; return; } public verify_effects(addr: address) acquires R { let r: &Self.R; let v: &vector; label b0: r = borrow_global(move(addr)); v = &move(r).R::v; assert(*vec_imm_borrow(move(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; }