-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b47a238
commit 223c11e
Showing
40 changed files
with
273 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"creator":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","deposit":""} | ||
{"creator":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","deposit":"1ugnot"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
test3.gno.land/extracted/r/bluehoneybadger/person/person.gno
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"creator":"g1sycj68ur0n7xytglx0me3f207ktudm80aqpysm","deposit":""} | ||
{"creator":"g1098kpwkwv3r08cat9ssucrq4mznxyv855jgqvx","deposit":""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"creator":"g1j8jwsce3vcry6s8qmmkxuwuhzww0j8396n3rgm","deposit":""} | ||
{"creator":"g10y2y4l4g7cx23tkl9jy5u638lw5aykvx7upqaz","deposit":"1ugnot"} |
Oops, something went wrong.