You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ReadonlyTeller is a GRC20 compatible teller that panics for each write operations.
24
+
func (tok *Token) ReadonlyTeller() GRC20 {
25
+
if tok == nil {
23
26
panic("Token cannot be nil")
24
27
}
25
28
26
29
return &fnTeller{
27
-
accountFn: func() std.Address {
28
-
caller := std.CurrentRealm().Addr()
29
-
return caller
30
-
},
31
-
Token: b,
30
+
accountFn: nil,
31
+
Token: tok,
32
32
}
33
33
}
34
34
35
-
func ReadonlyTeller(b *Token) GRC20 {
36
-
if b == nil {
35
+
// RealmTeller returns a GRC20 compatible teller that will store the CurrentRealm caller and then reuse the stored caller for each call.
36
+
// It allows a realm contract to interact with a GRC20 with its own account.
37
+
// The initializer of this teller should usually never share a pointer to its RealmTeller except maybe for advanced delegation flows such as a DAO treasury management.
0 commit comments