Transaction

5C54812A86F12A…2E9275165D5E

Block 26,340 · index 0 · indexed

Summary

Hash
5C54812A86F12A32B476D41D0B72385C689A1870C3CCE733D57D2E9275165D5E
Block
26,340
Size
1859 bytes
Gas used
6,717,173 / 8,060,667
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

#1AddPackagegno.land/r/moul/demo/microposts/v011 arguments

Arguments · 11

  1. #1microposts
  2. #2README.md
  3. #3# fork of `leon/fosdem25/microposts` removing optional lines to make the code more concise for slides. Original work here: https://gno.land/r/leon/fosdem25/microposts <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. > ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
  4. #4gnomod.toml
  5. #5module = "gno.land/r/moul/demo/microposts/v0" gno = "0.9"
  6. #6post.gno
  7. #7package microposts import ( "time" ) type Post struct { text string author address createdAt time.Time } func (p Post) String() string { out := p.text + "\n" out += "_" + p.createdAt.Format("02 Jan 2006, 15:04") + ", by " + p.author.String() + "_" return out }
  8. #8realm.gno
  9. #9package microposts import ( "chain/runtime/unsafe" "strconv" "time" ) var posts []*Post func CreatePost(text string) { posts = append(posts, &Post{ text: text, author: unsafe.PreviousRealm().Address(), // provided by env createdAt: time.Now(), }) } func Render(_ string) string { out := "# Posts\n" for i := len(posts) - 1; i >= 0; i-- { out += "### Post " + strconv.Itoa(i) + "\n" + posts[i].String() } return out }
  10. #10/gno.MemPackageType
  11. #11 MPUserProd

Result log

msg:0,success:true,log:,events:[]

← Back to block 26,340