You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
637 B

2 years ago
import "@stdlib/ownable";
import "./messages";
2 years ago
import "./constants";
2 years ago
contract Linker {
index: Int;
master: Address;
2 years ago
owner: Address;
2 years ago
neighbor: Address?;
2 years ago
init(index: Int, owner: Address, master: Address) {
2 years ago
self.index = index;
self.owner = owner;
2 years ago
self.master = master;
2 years ago
}
receive(msg: SetLinkerNeighbor) {
let ctx: Context = context();
require(ctx.sender == self.master, "Invalid sender");
self.neighbor = msg.neighbor;
}
2 years ago
get fun owner(): Address? {
return self.owner;
}
get fun master(): Address {
return self.master;
}
2 years ago
}