Skip to content

Commit

Permalink
feat: add r/demo/foo20_lp
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <[email protected]>
  • Loading branch information
moul committed Jun 26, 2023
1 parent dcbe130 commit 60ddd39
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/gno.land/r/demo/foo20_lp/doc.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Package foo20_lp provides a simple implementation of a fixed price liquidity queue for swapping two types of tokens.
A liquidity queue represents a queue of tokens that can be swapped for tokens of a different type at a fixed price. When a token is swapped, it is removed from its queue and a token of the other type is removed from the other queue. If there are not enough tokens in the other queue to swap with, the token is added to its queue to be swapped later when more tokens are added to the other queue.
Please note that this is a simple implementation and does not handle many practical considerations that would need to be addressed in a real-world application.
*/
package foo20_lp // import "gno.land/r/demo/foo20_lp"
13 changes: 13 additions & 0 deletions examples/gno.land/r/demo/foo20_lp/lp.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package foo20_lp

func DepositFoo20() {

}

func DepositGnot() {

}

func Render(path string) string {
return "Queues: ..."
}
7 changes: 7 additions & 0 deletions examples/gno.land/r/demo/foo20_lp/lp_test.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package foo20_lp

import "testing"

func TestPackage(t *testing.T) {
println("OK")
}
17 changes: 17 additions & 0 deletions examples/gno.land/r/demo/foo20_lp/z0_filetest.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// PKGPATH: gno.land/r/demo/foo20_lp_test
package foo20_lp_test

import "gno.land/r/demo/foo20_lp"

func main() {
println("A", foo20_lp.Render(""))
foo20_lp.DepositFoo20()
println("B", foo20_lp.Render(""))
foo20_lp.DepositGnot()
println("C", foo20_lp.Render(""))
}

// Output:
// A Queues: ...
// B Queues: ...
// C Queues: ...

0 comments on commit 60ddd39

Please sign in to comment.