github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/x/test_prev/test_prev.gno (about)

     1  package test_prev
     2  
     3  import (
     4  	"std"
     5  
     6  	pusers "gno.land/p/demo/users"
     7  	"gno.land/r/demo/foo20"
     8  )
     9  
    10  func DoSomeWithUserBalance() string {
    11  	caller := std.GetOrigCaller()
    12  	balance := foo20.BalanceOf(pusers.AddressOrName(caller))
    13  
    14  	if balance > 100 {
    15  		return "rich user"
    16  	}
    17  	return "poor user"
    18  }