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 Jul 12, 2024
1 parent b47a238 commit 223c11e
Show file tree
Hide file tree
Showing 40 changed files with 273 additions and 267 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
```
9594
9616
```

## addpkgs
Expand Down Expand Up @@ -109,6 +109,7 @@
3 "gno.land/r/michelle22/testpoll"
3 "gno.land/r/michelle22/mood1"
3 "gno.land/r/michelle/mood"
3 "gno.land/r/michelle/hello"
3 "gno.land/r/lolz2/raffle"
3 "gno.land/r/lololabs/llb"
3 "gno.land/r/leon/pollr"
Expand Down Expand Up @@ -560,6 +561,7 @@
1 "gno.land/r/michelle22/valopertest"
1 "gno.land/r/michelle22/moodv2"
1 "gno.land/r/michelle22/main"
1 "gno.land/r/michelle22/hello"
1 "gno.land/r/michelle22/gnosocial"
1 "gno.land/r/michelle/testpoll"
1 "gno.land/r/michelle/mymoodtest"
Expand Down Expand Up @@ -1542,10 +1544,10 @@
37 "gno.land/r/hello144/hello"
34 "gno.land/r/jeronimoalbi/poll_v1"
26 "gno.land/r/demo/foo20"
23 "gno.land/r/sdm/somedudefeedbacktest_8"
22 "gno.land/r/gnostudio/feedback_v1"
21 "gno.land/r/duysygame/test19"
20 "gno.land/r/duysyland/erc20"
19 "gno.land/r/sdm/somedudefeedbacktest_8"
19 "gno.land/r/position"
19 "gno.land/r/demo/foo"
16 "gno.land/r/demo/gnoph"
Expand Down
22 changes: 22 additions & 0 deletions test3.gno.land/backup_0478747-0480197.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"hello","Path":"gno.land/r/michelle22/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":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"dOMUROPz1oWKOCft12E5J98GT/jhY6L1Y541p+UuNgseBiF2dQ2Vmvo2NRpbfAc79Y+PejHD+yC0rEoClH6wrw=="}],"memo":"Deployed through play.gno.land"},"blockNum":"479237"}
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"hello","Path":"gno.land/r/michelle/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":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"ZGeTduj51oTfhUycTopHX8G6mHbdYXlf7Q6q7Pn6dxlt7BjJjfIKHBpPPdVxKw6VwFSZ1KZA73MCs7eS4g6prg=="}],"memo":"Deployed through play.gno.land"},"blockNum":"479251"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"w/86MH/meaQ5L3kX/0RBB/auVg3f/LaBSH9Uf4bBh8FO4aFZ9eUUrTrcxPk/xRasLwB52PGpEXqbGtj4xJvYDg=="}],"memo":""},"blockNum":"479253"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"iyu3bDBe+1YyKbo6mP0uV+0pACiPW7QkKA1QNPn9uvwGT7mV0WivbGchbAdQRVby5dAnx6QpW6WII/koNH0gtA=="}],"memo":""},"blockNum":"479255"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"nxDSmtRBlIuh3LcuRuEuYrJtEoSrsHtugGo9WrFxYSlQ0YW8Ht4lH+fiRVo3K3ZXXGPWfc8xkZ4R8k26lgA9qQ=="}],"memo":""},"blockNum":"479257"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"7aCRTQY9KM5SGln4wwGfW51fCTFSbYrwQdgscjiy7IJ1bZJzMnmt61HfNLWGOCok1M/pNyXiR8UVfjJLFTz3aw=="}],"memo":""},"blockNum":"479259"}
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"hello","Path":"gno.land/r/michelle/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":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"0R27hOx2Bbqvqq0LlMjy1lY1hWeUyxesHh9NprPuMWBn8ZvlcmSJY6V4B2l8hcoSD2NqIRfDKi5bismZN/Wv7Q=="}],"memo":"Deployed through play.gno.land"},"blockNum":"479261"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"A6yW1XHO5gC71+h/hyo8x6Bo+Z9ZoIF/b/FcjNb07WtvGbFxVE49uwNEVQ4MjZm1vJ3UIw8KwkixCaCC5Qtv2w=="}],"memo":""},"blockNum":"479264"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"gHN2Nq6kqEvMb+VskMr251KXhiCI5eOYUSQjmxb8hSpxpG21lO/x52m92SOObPtsoBoOzRLIxR/35ERiy6Wzig=="}],"memo":""},"blockNum":"479332"}
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"hello","Path":"gno.land/r/michelle/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":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"KNDI/nc7LlKIiIb0EPjw1tlmKrtHRLThSrwyzOcj5ol2dMbXY/Mg4TKbfGY1sYBpGBNoj8ONa6lOfPt7qh67AA=="}],"memo":"Deployed through play.gno.land"},"blockNum":"479335"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"SFAASk5CIpNa6yfFLqFuUZhoG8w/t0dzs1a0KwsJsxYkKIP4F37BIJcvJdFJMpuyOKzMTDe7hVqWma/5dSKJJA=="}],"memo":""},"blockNum":"479343"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"NiiRt8/Jakht6s5fzWpJymKNnaZFmWYkHAHR5OkQpGUND7Brm3om2ooS3gf2zLN9XU21DcAWTfweAoJYQcTeWw=="}],"memo":""},"blockNum":"479345"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"Sln7DgiuQKMoGFNpNfIBXYqwxOdfbsC84S+CsIKOaf1cKhrl5T29iXXUfDpi/my/k80B0gl/45nJ8kqBJd6ikg=="}],"memo":""},"blockNum":"479347"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"LyuN1a0GHUTL7CZoAdzhfw8h06upNr2DphLhEv7M2PgFpVjV3NxXNnU5oGLJAVewPVNjJ95jIfq4iomXWdvPHw=="}],"memo":""},"blockNum":"479349"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"XnEPlvdE782z6cosIh0ye15uT8H25vh4EeWuNo1ywJMS2U+L8msX+BAkJaZ60cPoIbyzwphTKDdjqcVKFV9/5Q=="}],"memo":""},"blockNum":"479352"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"lmsusqdv0kHrio0yeo3El+ME37Qe5QNOxrh/VNNk8VNYCvbjvscoFME21RH4w2NKffQ8acPRtCg+oMOLPPl0GA=="}],"memo":""},"blockNum":"479357"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"2JH8AG7rJYMjNFW9Q9i/zJrat6kjmcwysvsXgyT17k5SbCnsjIMw4kGryHy+cKnv5We6uFVt6sxN/l9qDBD9wA=="}],"memo":""},"blockNum":"479359"}
{"tx":{"msg":[{"@type":"/bank.MsgSend","from_address":"g13d7jc32adhc39erm5me38w5v7ej7lpvlnqjk73","to_address":"g1qgdjh6zvzzc8gv3fzk0mu9mezh6gan9hdpx04h","amount":"20000000ugnot"}],"fee":{"gas_wanted":"2000000","gas_fee":"1ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A/+cjV0/gZkWzMqCul8aP5hC7M3yliIs17uinn/+66uR"},"signature":"hT0i5YdxwQuXnAvGwX07R/L24cLC/iAv9S56dVubpRdIZIorxlj7sLy+8OCNKSVhkXs1K6i1ydd51ljucZAw7A=="}],"memo":""},"blockNum":"479361"}
{"tx":{"msg":[{"@type":"/vm.m_call","caller":"g15ruzptpql4dpuyzej0wkt5rq6r26kw4nxu9fwd","send":"","pkg_path":"gno.land/r/sdm/somedudefeedbacktest_8","func":"GetRole","args":null}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"Ax8dMlyeZTx7/5c7upbCj/sMsgJdjajg4b8kgHZ+d1mV"},"signature":"aQSj/aTl4BvZazzxKJVGnHJMVeMOJk0d1UMvvW++wRB2YsIYco2Ir5sKr90+EE6Y9iYNWgXKt969Hw+Wct0F8w=="}],"memo":"Called through gno.studio"},"blockNum":"479836"}
{"tx":{"msg":[{"@type":"/vm.m_call","caller":"g15ruzptpql4dpuyzej0wkt5rq6r26kw4nxu9fwd","send":"","pkg_path":"gno.land/r/sdm/somedudefeedbacktest_8","func":"GetRole","args":null}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"Ax8dMlyeZTx7/5c7upbCj/sMsgJdjajg4b8kgHZ+d1mV"},"signature":"9VDNjesZ4+92T7L5bO3HBk58M5JJEsZXNV1EhGPhpYoQJCHTmHoR6VJkA6fSLmGvPolrgdNHuqy/aWUD2MqLiA=="}],"memo":"Called through gno.studio"},"blockNum":"479839"}
{"tx":{"msg":[{"@type":"/vm.m_call","caller":"g15ruzptpql4dpuyzej0wkt5rq6r26kw4nxu9fwd","send":"","pkg_path":"gno.land/r/sdm/somedudefeedbacktest_8","func":"GetRole","args":null}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"Ax8dMlyeZTx7/5c7upbCj/sMsgJdjajg4b8kgHZ+d1mV"},"signature":"JchZbmOTVaCQ37p+lfUS15tSUwhYX07p+ZX+RZR7fDEEAW1LX898UwVQggmtyTFKjfw5OAD4CeY4PsFBQJL6eA=="}],"memo":"Called through gno.studio"},"blockNum":"479842"}
{"tx":{"msg":[{"@type":"/vm.m_call","caller":"g15ruzptpql4dpuyzej0wkt5rq6r26kw4nxu9fwd","send":"","pkg_path":"gno.land/r/sdm/somedudefeedbacktest_8","func":"GetRole","args":null}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"Ax8dMlyeZTx7/5c7upbCj/sMsgJdjajg4b8kgHZ+d1mV"},"signature":"S5tjnyv6p2cDFUwz1+qwNBfDH06JAdiVX7nWADqeG4UU+LPuLx+sIClzOXieOX54XdDu8YlAD32TJjLhPjnPHA=="}],"memo":"Called through gno.studio"},"blockNum":"479845"}
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/p/demo/hello/pkg_metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"creator":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","deposit":""}
{"creator":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","deposit":"1ugnot"}
21 changes: 3 additions & 18 deletions test3.gno.land/extracted/p/stuyk/test/package.gno
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
package userinvokes
package hello

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])
func Render(path string) string {
return "Hello World!"
}
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: 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"
}
2 changes: 1 addition & 1 deletion test3.gno.land/extracted/r/demo/apple/GRC20.gno
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

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

func init() {
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":"g1sycj68ur0n7xytglx0me3f207ktudm80aqpysm","deposit":""}
{"creator":"g1098kpwkwv3r08cat9ssucrq4mznxyv855jgqvx","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 pup
package PERL

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

var (
pup *grc20.AdminToken
admin std.Address = "g1j8jwsce3vcry6s8qmmkxuwuhzww0j8396n3rgm"
PERL *grc20.AdminToken
admin std.Address = "g14gde7f5qnku3pdur5te5r78rq4cues86ftxml7"
)

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

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

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

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

func Allowance(owner, spender users.AddressOrName) uint64 {
allowance, err := pup.Allowance(owner.Resolve(), spender.Resolve())
allowance, err := PERL.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()
pup.Transfer(caller, to.Resolve(), amount)
PERL.Transfer(caller, to.Resolve(), amount)
}

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

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

// administration.

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

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

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

switch {
case path == "":
return pup.RenderHome()
return PERL.RenderHome()
case c == 2 && parts[0] == "balance":
owner := users.AddressOrName(parts[1])
balance, _ := pup.BalanceOf(owner.Resolve())
balance, _ := PERL.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":"g1j8jwsce3vcry6s8qmmkxuwuhzww0j8396n3rgm","deposit":""}
{"creator":"g10y2y4l4g7cx23tkl9jy5u638lw5aykvx7upqaz","deposit":"1ugnot"}
Loading

0 comments on commit 223c11e

Please sign in to comment.