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.
24 lines
509 B
24 lines
509 B
import "@stdlib/ownable"; |
|
import "./messages"; |
|
|
|
|
|
contract Linker { |
|
index: Int; |
|
master: Address; |
|
owner: Address?; |
|
neighbor: Address?; |
|
|
|
init(index: Int, owner: Address) { |
|
self.index = index; |
|
self.owner = owner; |
|
|
|
let ctx: Context = context(); |
|
self.master = ctx.sender; |
|
} |
|
|
|
receive(msg: SetLinkerNeighbor) { |
|
let ctx: Context = context(); |
|
require(ctx.sender == self.master, "Invalid sender"); |
|
self.neighbor = msg.neighbor; |
|
} |
|
}
|
|
|