-
Notifications
You must be signed in to change notification settings - Fork 3
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
495c28a
commit 895b6f0
Showing
44 changed files
with
338 additions
and
122 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,9 @@ | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood","Path":"gno.land/r/michelle22/mood","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfunc render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"/18/5ysrN1oYFsZ5ar4yZpe/wFHcVmkE6lJ+r55Adep2MDVct6+Kv4X7A87MsrH6R5HM4YsBJBbQ+oXZK6l20g=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447498"} | ||
{"tx":{"msg":[{"@type":"/vm.m_call","caller":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","send":"","pkg_path":"gno.land/r/michelle22/mood","func":"ChangeMyMood","args":["Feeling like I am doing my first tutorial "]}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"3Ulsjo/UzfdnJR0rmiJGCpfqQlBw7TeoBH0BVlvfBE8XUBL11tHWU8EXgX4y8A0PDBFwzin5DAKn0V7X6QjacA=="}],"memo":"Called through gno.studio"},"blockNum":"447500"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood","Path":"gno.land/r/michelle22/mood","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"LyESFip/nHKkFLT1qOa9e8mIqfPg7BDHMnfR/QyfS9IYlX7i32OuPPfP1vZPdLmbyqURn7N5VCVDQjDJrUg63g=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447508"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood","Path":"gno.land/r/michelle_22/mood","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"6HSJatad0x1fHwbxu/Nfrm08PL/gm49Q5jLO31FopAFlo9N5xL/DsCWcujxZdz9u7AU9U/U2WYwcDbO4m84f7w=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447510"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood","Path":"gno.land/r/michellemood/mood","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"PSRqUMLd50xFCiiv1pXPi3xm5EQjTkariBff/0GMBO5mOvkPw6jBX+XX8y+R/hQD6PbGywPsA9iTgz6sVJPwdQ=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447512"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood","Path":"gno.land/r/tryagain/mood","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"i2qn5DOGTUuu9D9fmAeUvSmIpLDCdrLEkIn88tx6I9QgckJCc991CC546ieGVYX26/JKo6zLrXk9hOOMdus3Dg=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447520"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood","Path":"gno.land/r/tryagain/mood","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"5xa37uswdO8dR1MfPuUOA+G4Yn4YbbFGq5L4inD520VZuVAGklgy6hc6wU0TfABISB4Kc6Kg+BuY1ybEj9FUSQ=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447522"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood2","Path":"gno.land/r/tryagain/mood2","Files":[{"Name":"mood.gno","Body":"package mood\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"4BDHu+T4FX3yvCu6mZq5NEm5bJ7189kkyoRyQ5ujwP1VWb3/fsUrVtRullEcnKzOwcPbfZIMOqUsTRogA/JPZg=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447524"} | ||
{"tx":{"msg":[{"@type":"/vm.m_addpkg","creator":"g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5","package":{"Name":"mood1","Path":"gno.land/r/tryagain/mood1","Files":[{"Name":"mood.gno","Body":"package mood1\r\n\r\nvar myMood = \"my mood is\"\r\n\r\nfun Render(path string) string {\r\n\treturn \"My current mood is \" + myMood\r\n}\r\n\r\nfunc ChangeMyMood(newMood string) string {\r\n\tmyMood = newMood\r\n\treturn \"My mood was successfully updated\"\r\n}\r\n"}]},"deposit":"1ugnot"}],"fee":{"gas_wanted":"10000000","gas_fee":"50000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A7MWSLkjf+z/CYfMh6KVHEaHLDWpnfGBRDqFO81j1FRN"},"signature":"91nRWdf73uL67WXZ9HVJ1O1kdUQb7KZeKhsw6DcYQCASBfLA0gMu/ahHiDEkYyQcsjkEItEZPQExt1FL1Uxvnw=="}],"memo":"Deployed through play.gno.land"},"blockNum":"447526"} |
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,5 +1,34 @@ | ||
package hello | ||
package foo | ||
|
||
import ( | ||
"std | ||
"strings | ||
|
||
"gno.land/p/demo/grc/grc20 | ||
"gno.land/p/demo/ufmt | ||
"gno.land/r/demo/users" | ||
) | ||
|
||
var ( | ||
foo *grc20.AdminToken | ||
admin std.address = "g1zakcnjtwj0rs9ejtr5c0gqlnus50xny8frar5n" | ||
) | ||
|
||
func init() { | ||
hyperborea = grc20.NewAdminToken("Hyperborea","HYPERBOREA", 6) | ||
hyperborea.Mint(admin,8888888) // @administrator | ||
} | ||
|
||
// method proxies as public functions. | ||
// | ||
|
||
// getters. | ||
|
||
func TotalSupply() uint64 { | ||
return hyperborea.TotalSupply/() | ||
} | ||
|
||
func BalanceOf(owner users.AddressOrName) uint64 { | ||
balance, err := hyperborea.BalanceOf(owner.Resolve()) | ||
|
||
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 +1 @@ | ||
{"creator":"g1f748xee7gpwldyrz4xea3nk6hw24lfya49fus8","deposit":""} | ||
{"creator":"g100xslzk674xuv3s0q8yp44cr63l26z2y4n7ycg","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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"creator":"g1fsu3z335h5qngf7t3lmakvpmpwg9ae76tqwh7c","deposit":"1ugnot"} | ||
{"creator":"g15wmukt79xymnnu6c4de32trnufudqum60yrxu8","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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,117 @@ | ||
package counter | ||
package mynonfungibletoken | ||
|
||
import "fmt" | ||
import ( | ||
"std" | ||
"gno.land/p/demo/grc/grc721" | ||
"gno.land/p/demo/users" | ||
"gno.land/p/demo/ufmt" | ||
) | ||
|
||
var count int | ||
var ( | ||
admin std.Address = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // set admin account | ||
mynonfungibletoken = grc721.NewBasicNFT("mynonfungibletoken", "MNFT") | ||
) | ||
|
||
func Increment() { | ||
count++ | ||
func init() { | ||
mintNNFT(admin, 10) // @administrator (initial supply = 10 NFTs) | ||
} | ||
|
||
func Decrement() { | ||
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 Render(_ string) string { | ||
return fmt.Sprintf("Count: %d", 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") | ||
} | ||
} |
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":"g1ghfakgzr6q77etpg8jtas6llg4uvqnfl8skxxq","deposit":"1ugnot"} | ||
{"creator":"g1dnllrdzwfhxv3evyk09y48mgn5phfjvtyrlzm7","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
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!" | ||
} |
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":"g1v4e0gv2m6gpqh6mx0auu6x6gmep9yt6cxj6q5f","deposit":""} | ||
{"creator":"g100xslzk674xuv3s0q8yp44cr63l26z2y4n7ycg","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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package hello | ||
|
||
func Render(path string) string { | ||
func Render(path string) a 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 +1 @@ | ||
{"creator":"g1yc0x2kj67mj564zsjyp27t5zya5eynnrdqkpqv","deposit":"1ugnot"} | ||
{"creator":"g1fsu3z335h5qngf7t3lmakvpmpwg9ae76tqwh7c","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
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":"g1098kpwkwv3r08cat9ssucrq4mznxyv855jgqvx","deposit":""} | ||
{"creator":"g1sycj68ur0n7xytglx0me3f207ktudm80aqpysm","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":"g1m6cdxuuesrgdu2krq9m5xrrvhx74f56a0w2y3t","deposit":""} | ||
{"creator":"g17k3jmr2xdwhu6xzcqh5uwu56644ccptrmhy5d0","deposit":""} |
Oops, something went wrong.