Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GetOwner = MakeGetOwner() // default (owner) role - owner getter GetPendingOwner = MakeGetPendingOwner() // default (owner) role - pending owner getter AddressRes = tvm.NewResultDecoder(func(r *ton.ExecutionResult) (*address.Address, error) { ownerSlice, err := r.Slice(0) if err != nil { return nil, err } return ownerSlice.LoadAddr() }) )
View Source
var ExitCodeCodec tvm.ExitCodeCodecInt[ExitCode] = ExitCode(tvm.ExitCode(-1))
View Source
var TLBs = tvm.MustNewTLBMap([]any{ TransferOwnership{}, AcceptOwnership{}, })
Functions ¶
func MakeGetOwner ¶
MakeGetOwner creates a getter for the owner address, for a specified role (prefix).
Types ¶
type AcceptOwnership ¶
type AcceptOwnership struct {
QueryID uint64 `tlb:"## 64"`
// contains filtered or unexported fields
}
AcceptOwnership allows the pending owner to accept ownership of the contract.
type InMessage ¶
type InMessage interface {
TransferOwnership |
AcceptOwnership
}
type Storage ¶
type Storage struct {
Owner *address.Address `tlb:"addr"`
PendingOwner *address.Address `tlb:"addr"`
}
Ownable2Step represents a two-step ownership structure, where an owner can set a pending owner.
Note: PendingOwner uses `tlb:"addr"` (not `tlb:"maybe addr"`) because Tolk's `address?` compiles to LDOPTSTDADDR, which reads raw MsgAddress directly. The 2-bit discriminator (addr_none$00 = null, addr_std$10 = address) already encodes nullability. Using `tlb:"maybe addr"` would add a 1-bit Maybe prefix, causing Tolk to misparse the cell.
type TransferOwnership ¶
type TransferOwnership struct {
QueryID uint64 `tlb:"## 64"`
NewOwner *address.Address `tlb:"addr"`
// contains filtered or unexported fields
}
Sets a new pending owner. Can only be called by the current owner.
Click to show internal directories.
Click to hide internal directories.