46 lines
846 B
Plaintext
46 lines
846 B
Plaintext
struct Content {
|
|
content: String;
|
|
}
|
|
|
|
message Notification {}
|
|
|
|
contract Gift {
|
|
owner: Address;
|
|
receiver: Address;
|
|
content: Content;
|
|
|
|
init(
|
|
content: Content,
|
|
receiver: Address
|
|
) {
|
|
self.owner = sender();
|
|
self.receiver = receiver;
|
|
self.content = content;
|
|
nativeReserve(ton("0.001"), ReserveExact);
|
|
self.sendNotify();
|
|
}
|
|
|
|
inline fun sendNotify() {
|
|
message(MessageParameters {
|
|
to: self.receiver,
|
|
value: 0,
|
|
mode: SendRemainingBalance,
|
|
body: Notification {}.toCell(),
|
|
});
|
|
}
|
|
|
|
receive() {}
|
|
|
|
get fun owner(): Address {
|
|
return self.owner;
|
|
}
|
|
|
|
get fun receiver(): Address {
|
|
return self.receiver;
|
|
}
|
|
|
|
get fun content(): Content {
|
|
return self.content;
|
|
}
|
|
|
|
} |