module Token { resource T { } public new(): R#Self.T { return T{ }; } public has(addr: address): bool { let yes: bool; yes = exists(move(addr)); return move(yes); } public publish(t: R#Self.T) { move_to_sender(move(t)); return; } } //! new-transaction import {{default}}.Token; main() { let z: R#Token.T; let sender: address; let exists1: bool; let addr1: address; let exists2: bool; z = Token.new(); Token.publish(move(z)); sender = get_txn_sender(); exists1 = Token.has(copy(sender)); assert(copy(exists1), 42); addr1 = 0x0111111111111111111111111111111111111111111111111111111111111110; exists2 = Token.has(copy(addr1)); assert(!copy(exists2), 42); return; }