Skip to content

Commit

Permalink
chore: update test3.gno.land backup
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton authored and github-actions[bot] committed Jun 22, 2024
1 parent c3b0a51 commit 78f65f0
Show file tree
Hide file tree
Showing 36 changed files with 151 additions and 222 deletions.
6 changes: 4 additions & 2 deletions test3.gno.land/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## TXs
```
8874
8880
```

## addpkgs
Expand All @@ -23,11 +23,11 @@
8 "gno.land/p/duysygame/gamedemo"
7 "gno.land/r/test1/tictacgno"
7 "gno.land/r/test/test"
7 "gno.land/r/test/hello"
7 "gno.land/r/demo/GemCoin"
7 "gno.land/p/test/test"
7 "gno.land/p/demo5/premier"
7 "gno.land/p/GRXToken/GRX"
6 "gno.land/r/test/hello"
6 "gno.land/r/grc20token/mytoken"
6 "gno.land/r/demo/kazainft"
6 "gno.land/r/bluehoneybadger/person"
Expand Down Expand Up @@ -470,6 +470,7 @@
1 "gno.land/r/sdm/feedback/v2"
1 "gno.land/r/sdm/feedback/v1"
1 "gno.land/r/sdm/echo"
1 "gno.land/r/sanbor/hello"
1 "gno.land/r/sad/greeting"
1 "gno.land/r/ruslank/dragon"
1 "gno.land/r/rsky/b069"
Expand Down Expand Up @@ -573,6 +574,7 @@
1 "gno.land/r/hello12/v1"
1 "gno.land/r/hello11156/hello11156"
1 "gno.land/r/hello/hellotest"
1 "gno.land/r/hello/demo1"
1 "gno.land/r/hello"
1 "gno.land/r/hehe"
1 "gno.land/r/heeello/h"
Expand Down
6 changes: 6 additions & 0 deletions test3.gno.land/backup_0449288-0450715.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1xyx283r3tfrcnszzhkccwuq7rgjplywvq8653w","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"wksPSidBG0nPbKdBRWpp53m2Jt+2F2PfJRmSS9HHB6pGx0ehaFTRyoaFOKFXs3Pl8PCT5DHdI+SHHrhayEb96w=="}],"memo":""},"blockNum":"449929"}
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1xyx283r3tfrcnszzhkccwuq7rgjplywvq8653w","package":{"Name":"demo1","Path":"gno.land/r/hello/demo1","Files":[{"Name":"package.gno","Body":"package demo1\n\nfunc Render(path string) string {\n return \"Hello World!\"\n}\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"AssW3lOgY+ito4Dl4c0QNyp6SqB5r2NDXzJVQ0JGDEG6"},"signature":"SX2qG+rqNN7J+kPCmSPwLCoXBTWMH0twtydXJsEl46Q6X5cH1/87eG4hXg3y66YnSc6Yl5n66yfZWhpKvVATiw=="}],"memo":"Deployed through play.gno.land"},"blockNum":"449931"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g18cnw0nyv0yn2twwt5yfdu53zdgpesj7gcxshdz","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"rF3OtH7/6yjDkhSyfvk+777ccXDxI6hK1JCOD1Y6xaJicnzssRff3I5S2zyFcI3oaRcqJqkm649Zy9SdJpZzUQ=="}],"memo":""},"blockNum":"450477"}
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g18cnw0nyv0yn2twwt5yfdu53zdgpesj7gcxshdz","package":{"Name":"hello","Path":"gno.land/r/test/hello","Files":[{"Name":"package.gno","Body":"package hello\n\nfunc Render(path string) string {\n return \"Hello World!\"\n}\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"AsjfwZC/yNFtNUv0OpjSZsogpMYydznAInXb5xiyT0cr"},"signature":"Fl0nyRq+gA6IL0V8ST6F01TP3aJHl06HF/F6DkMYpRxAba9rs1p4ITw82qdcBfWYExSA/otlJGAFq1UwYO7uWw=="}],"memo":"Deployed through play.gno.land"},"blockNum":"450479"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g18cnw0nyv0yn2twwt5yfdu53zdgpesj7gcxshdz","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"/AqUV120fezQCAn2IdGj9QgNG3S4JqsfgJLFwg0Ij8UjK7QYuaHvJp7Y4x3pbGyOx3kjcx5h8zU2s3RJBuEkug=="}],"memo":""},"blockNum":"450481"}
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g18cnw0nyv0yn2twwt5yfdu53zdgpesj7gcxshdz","package":{"Name":"hello","Path":"gno.land/r/sanbor/hello","Files":[{"Name":"package.gno","Body":"package hello\n\nfunc Render(path string) string {\n return \"Hello World!\"\n}\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"AsjfwZC/yNFtNUv0OpjSZsogpMYydznAInXb5xiyT0cr"},"signature":"07PQCPUnIDjalh3LgAD9fJl04Bank2kCryrfi+68ohFmiHQnAJw9uYwJ3gEwVeNaDoreZMcpitPYQAQ791zrcA=="}],"memo":"Deployed through play.gno.land"},"blockNum":"450483"}
21 changes: 18 additions & 3 deletions test3.gno.land/extracted/p/stuyk/test/package.gno
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package hello
package userinvokes

func Render(path string) string {
return "Hello World!"
import "fmt"

var user_invokes map[string]int

func Render(name string) string {
if (!user_invokes) {
user_invokes = make(map[string]int)
}


if (!user_invokes[name]) {
user_invokes[name] += 1
} else {
user_invokes = 1
}

return fmt.Println("Total user invokes %d", user_invokes[name])
}
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/p/test/hello/pkg_metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"creator":"g15wmukt79xymnnu6c4de32trnufudqum60yrxu8","deposit":""}
{"creator":"g1fsu3z335h5qngf7t3lmakvpmpwg9ae76tqwh7c","deposit":"1ugnot"}
120 changes: 10 additions & 110 deletions test3.gno.land/extracted/p/test/test/package.gno
Original file line number Diff line number Diff line change
@@ -1,117 +1,17 @@
package mynonfungibletoken
package counter

import (
"std"
"gno.land/p/demo/grc/grc721"
"gno.land/p/demo/users"
"gno.land/p/demo/ufmt"
)
import "fmt"

var (
admin std.Address = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // set admin account
mynonfungibletoken = grc721.NewBasicNFT("mynonfungibletoken", "MNFT")
)
var count int

func init() {
mintNNFT(admin, 10) // @administrator (initial supply = 10 NFTs)
func Increment() {
count++
}

func mintNNFT(owner std.Address, n uint64) {
count := mynonfungibletoken.TokenCount()
for i := count; i < count+n; i++ {
tid := grc721.TokenID(ufmt.Sprintf("%d", i))
mynonfungibletoken.Mint(owner, tid)
}
func Decrement() {
count--
}

// Getters

func BalanceOf(user users.AddressOrName) uint64 {
balance, err := mynonfungibletoken.BalanceOf(user.Resolve())
if err != nil {
panic(err)
}
return balance
}

func OwnerOf(tid grc721.TokenID) std.Address {
owner, err := mynonfungibletoken.OwnerOf(tid)
if err != nil {
panic(err)
}
return owner
}

func IsApprovedForAll(owner, user users.AddressOrName) bool {
return mynonfungibletoken.IsApprovedForAll(owner.Resolve(), user.Resolve())
}

func GetApproved(tid grc721.TokenID) std.Address {
addr, err := mynonfungibletoken.GetApproved(tid)
if err != nil {
panic(err)
}
return addr
}

// Setters

func Approve(user users.AddressOrName, tid grc721.TokenID) {
err := mynonfungibletoken.Approve(user.Resolve(), tid)
if err != nil {
panic(err)
}
}

func SetApprovalForAll(user users.AddressOrName, approved bool) {
err := mynonfungibletoken.SetApprovalForAll(user.Resolve(), approved)
if err != nil {
panic(err)
}
}

func TransferFrom(from, to users.AddressOrName, tid grc721.TokenID) {
err := mynonfungibletoken.TransferFrom(from.Resolve(), to.Resolve(), tid)
if err != nil {
panic(err)
}
}

// Admin

func Mint(to users.AddressOrName, tid grc721.TokenID) {
caller := std.PrevRealm().Addr()
assertIsAdmin(caller)
err := mynonfungibletoken.Mint(to.Resolve(), tid)
if err != nil {
panic(err)
}
}

func Burn(tid grc721.TokenID) {
caller := std.PrevRealm().Addr()
assertIsAdmin(caller)
err := mynonfungibletoken.Burn(tid)
if err != nil {
panic(err)
}
}

// Render

func Render(path string) string {
switch {
case path == "":
return mynonfungibletoken.RenderHome()
default:
return "404\n"
}
}

// Util

func assertIsAdmin(address std.Address) {
if address != admin {
panic("restricted access")
}
}
func Render(_ string) string {
return fmt.Sprintf("Count: %d", count)
}
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/p/test/test/pkg_metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"creator":"g1dnllrdzwfhxv3evyk09y48mgn5phfjvtyrlzm7","deposit":""}
{"creator":"g1ghfakgzr6q77etpg8jtas6llg4uvqnfl8skxxq","deposit":"1ugnot"}
12 changes: 2 additions & 10 deletions test3.gno.land/extracted/p/test2/hello/package.gno
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package hello

var {
hello string
}

func SetHello(msg string){
hello = msg
}

func GetHello() string {
return hello
func Render(path string) string {
return "Hello World!"
}
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/p/test2/hello/pkg_metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"creator":"g1v4e0gv2m6gpqh6mx0auu6x6gmep9yt6cxj6q5f","deposit":""}
{"creator":"g100xslzk674xuv3s0q8yp44cr63l26z2y4n7ycg","deposit":""}
12 changes: 9 additions & 3 deletions test3.gno.land/extracted/r/bluehoneybadger/person/person.gno
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package person

// Importing `strconv` to be able to cast the age to string so it can be concatenated
import "strconv"

var (
myName = "John Smith"
myAge = 42
myAddress = "123 Main Street"
)

function Render(path string) string {
return "My name is: " + myName "my Age is: " + myAge "& my Address is: " myAddress
func Render(path string) string {
// You could also use "gno.land/p/demo/ufmt" package, check `ufmt.Sprintf()`
// See: https://test3.gno.land/p/demo/ufmt/ufmt.gno
// It works like standard Go's "Sprintf" but it only support "%s" and "%d" it think
return "My name is: " + myName + "my Age is: " + strconv.Itoa(myAge) + "& my Address is: " + myAddress
}

function UpdateAdddress(NewAddress string) string {
func updateAddress(NewAddress string) string {
myAddress = NewAddress
return "Your address has been updated"
}
4 changes: 2 additions & 2 deletions test3.gno.land/extracted/r/demo/apple/GRC20.gno
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (

var (
apple *grc20.AdminToken
admin std.Address = "g1c4pdj3lx0t8n9k5yay2gnw2ewkxxdxhnknnvqz"
admin std.Address = "g1sycj68ur0n7xytglx0me3f207ktudm80aqpysm"
)

func init() {
apple = grc20.NewAdminToken("Apple", "APPLE", 6)
apple = grc20.NewAdminToken("appleToken", "apple", 6)
apple.Mint(admin, 1000000000) // @administrator
}

Expand Down
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/r/demo/apple/pkg_metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"creator":"g1c4pdj3lx0t8n9k5yay2gnw2ewkxxdxhnknnvqz","deposit":""}
{"creator":"g1sycj68ur0n7xytglx0me3f207ktudm80aqpysm","deposit":""}
30 changes: 15 additions & 15 deletions test3.gno.land/extracted/r/demo/demo/GRC20.gno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package frenchie
package pup

import (
"std"
Expand All @@ -10,13 +10,13 @@ import (
)

var (
frenchie *grc20.AdminToken
admin std.Address = "g1m6cdxuuesrgdu2krq9m5xrrvhx74f56a0w2y3t"
pup *grc20.AdminToken
admin std.Address = "g1j8jwsce3vcry6s8qmmkxuwuhzww0j8396n3rgm"
)

func init() {
frenchie = grc20.NewAdminToken("frenchieToken", "frenchie", 6)
frenchie.Mint(admin, 1000000000) // @administrator
pup = grc20.NewAdminToken("pupToken", "pup", 6)
pup.Mint(admin, 1000000000) // @administrator
}

// method proxies as public functions.
Expand All @@ -25,19 +25,19 @@ func init() {
// getters.

func TotalSupply() uint64 {
return frenchie.TotalSupply()
return pup.TotalSupply()
}

func BalanceOf(owner users.AddressOrName) uint64 {
balance, err := frenchie.BalanceOf(owner.Resolve())
balance, err := pup.BalanceOf(owner.Resolve())
if err != nil {
panic(err)
}
return balance
}

func Allowance(owner, spender users.AddressOrName) uint64 {
allowance, err := frenchie.Allowance(owner.Resolve(), spender.Resolve())
allowance, err := pup.Allowance(owner.Resolve(), spender.Resolve())
if err != nil {
panic(err)
}
Expand All @@ -48,31 +48,31 @@ func Allowance(owner, spender users.AddressOrName) uint64 {

func Transfer(to users.AddressOrName, amount uint64) {
caller := std.GetOrigCaller()
frenchie.Transfer(caller, to.Resolve(), amount)
pup.Transfer(caller, to.Resolve(), amount)
}

func Approve(spender users.AddressOrName, amount uint64) {
caller := std.GetOrigCaller()
frenchie.Approve(caller, spender.Resolve(), amount)
pup.Approve(caller, spender.Resolve(), amount)
}

func TransferFrom(from, to users.AddressOrName, amount uint64) {
caller := std.GetOrigCaller()
frenchie.TransferFrom(caller, from.Resolve(), to.Resolve(), amount)
pup.TransferFrom(caller, from.Resolve(), to.Resolve(), amount)
}

// administration.

func Mint(address users.AddressOrName, amount uint64) {
caller := std.GetOrigCaller()
assertIsAdmin(caller)
frenchie.Mint(address.Resolve(), amount)
pup.Mint(address.Resolve(), amount)
}

func Burn(address users.AddressOrName, amount uint64) {
caller := std.GetOrigCaller()
assertIsAdmin(caller)
frenchie.Burn(address.Resolve(), amount)
pup.Burn(address.Resolve(), amount)
}

// render.
Expand All @@ -84,10 +84,10 @@ func Render(path string) string {

switch {
case path == "":
return frenchie.RenderHome()
return pup.RenderHome()
case c == 2 && parts[0] == "balance":
owner := users.AddressOrName(parts[1])
balance, _ := frenchie.BalanceOf(owner.Resolve())
balance, _ := pup.BalanceOf(owner.Resolve())
return ufmt.Sprintf("%d\n", balance)
default:
return "404\n"
Expand Down
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/r/demo/demo/pkg_metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"creator":"g10y2y4l4g7cx23tkl9jy5u638lw5aykvx7upqaz","deposit":"1ugnot"}
{"creator":"g1j8jwsce3vcry6s8qmmkxuwuhzww0j8396n3rgm","deposit":""}
Loading

0 comments on commit 78f65f0

Please sign in to comment.