From 4f6f2313c55ed473f5dbc912ee4f9480255ee120 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Wed, 13 Dec 2023 12:10:34 +0900 Subject: [PATCH] GSW-668 test: reduce initialize process --- _setup/grc20_wrapper/grc20wrapper.gno | 43 +-- _setup/grc20_wrapper/wrapper_st11.gno | 33 --- _setup/grc20_wrapper/wrapper_st22.gno | 33 --- _setup/grc20_wrapper/wrapper_st33.gno | 33 --- _setup/grc20_wrapper/wrapper_st44.gno | 33 --- _setup/grc20_wrapper/wrapper_st55.gno | 33 --- _setup/st11/gno.mod | 1 - _setup/st11/st11.gno | 118 -------- _setup/st22/gno.mod | 1 - _setup/st22/st22.gno | 118 -------- _setup/st33/gno.mod | 1 - _setup/st33/st33.gno | 118 -------- _setup/st44/gno.mod | 1 - _setup/st44/st44.gno | 118 -------- _setup/st55/gno.mod | 1 - _setup/st55/st55.gno | 118 -------- _test/init_only.mk | 80 +----- _test/live_test_multi_msg.mk | 279 ------------------- _test/multi_msg_01.txt | 1 - _test/multi_msg_02.txt | 1 - _test/multi_msg_03.txt | 1 - _test/multi_msg_04.txt | 1 - _test/multi_msg_generator.ipynb | 380 -------------------------- 23 files changed, 15 insertions(+), 1531 deletions(-) delete mode 100644 _setup/grc20_wrapper/wrapper_st11.gno delete mode 100644 _setup/grc20_wrapper/wrapper_st22.gno delete mode 100644 _setup/grc20_wrapper/wrapper_st33.gno delete mode 100644 _setup/grc20_wrapper/wrapper_st44.gno delete mode 100644 _setup/grc20_wrapper/wrapper_st55.gno delete mode 100644 _setup/st11/gno.mod delete mode 100644 _setup/st11/st11.gno delete mode 100644 _setup/st22/gno.mod delete mode 100644 _setup/st22/st22.gno delete mode 100644 _setup/st33/gno.mod delete mode 100644 _setup/st33/st33.gno delete mode 100644 _setup/st44/gno.mod delete mode 100644 _setup/st44/st44.gno delete mode 100644 _setup/st55/gno.mod delete mode 100644 _setup/st55/st55.gno delete mode 100644 _test/live_test_multi_msg.mk delete mode 100644 _test/multi_msg_01.txt delete mode 100644 _test/multi_msg_02.txt delete mode 100644 _test/multi_msg_03.txt delete mode 100644 _test/multi_msg_04.txt delete mode 100644 _test/multi_msg_generator.ipynb diff --git a/_setup/grc20_wrapper/grc20wrapper.gno b/_setup/grc20_wrapper/grc20wrapper.gno index d2485f3b..e614853d 100644 --- a/_setup/grc20_wrapper/grc20wrapper.gno +++ b/_setup/grc20_wrapper/grc20wrapper.gno @@ -51,35 +51,16 @@ func init() { rRegistry.RegisterGRC20Interface("gno.land/r/st5", SwapTest5TokenCTokenInterface{}) sRegistry.RegisterGRC20Interface("gno.land/r/st5", SwapTest5TokenCTokenInterface{}) - pRegistry.RegisterGRC20Interface("gno.land/r/st11", SwapTest11TokenCTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/st11", SwapTest11TokenCTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/st11", SwapTest11TokenCTokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/st22", SwapTest22TokenCTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/st22", SwapTest22TokenCTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/st22", SwapTest22TokenCTokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/st33", SwapTest33TokenCTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/st33", SwapTest33TokenCTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/st33", SwapTest33TokenCTokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/st44", SwapTest44TokenCTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/st44", SwapTest44TokenCTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/st44", SwapTest44TokenCTokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/st55", SwapTest55TokenCTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/st55", SwapTest55TokenCTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/st55", SwapTest55TokenCTokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/testtokena", TestTokenATokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/testtokena", TestTokenATokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/testtokena", TestTokenATokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/testtokenb", TestTokenBTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/testtokenb", TestTokenBTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/testtokenb", TestTokenBTokenInterface{}) - - pRegistry.RegisterGRC20Interface("gno.land/r/testtokenc", TestTokenCTokenInterface{}) - rRegistry.RegisterGRC20Interface("gno.land/r/testtokenc", TestTokenCTokenInterface{}) - sRegistry.RegisterGRC20Interface("gno.land/r/testtokenc", TestTokenCTokenInterface{}) + // TO BE USED + // pRegistry.RegisterGRC20Interface("gno.land/r/testtokena", TestTokenATokenInterface{}) + // rRegistry.RegisterGRC20Interface("gno.land/r/testtokena", TestTokenATokenInterface{}) + // sRegistry.RegisterGRC20Interface("gno.land/r/testtokena", TestTokenATokenInterface{}) + + // pRegistry.RegisterGRC20Interface("gno.land/r/testtokenb", TestTokenBTokenInterface{}) + // rRegistry.RegisterGRC20Interface("gno.land/r/testtokenb", TestTokenBTokenInterface{}) + // sRegistry.RegisterGRC20Interface("gno.land/r/testtokenb", TestTokenBTokenInterface{}) + + // pRegistry.RegisterGRC20Interface("gno.land/r/testtokenc", TestTokenCTokenInterface{}) + // rRegistry.RegisterGRC20Interface("gno.land/r/testtokenc", TestTokenCTokenInterface{}) + // sRegistry.RegisterGRC20Interface("gno.land/r/testtokenc", TestTokenCTokenInterface{}) } diff --git a/_setup/grc20_wrapper/wrapper_st11.gno b/_setup/grc20_wrapper/wrapper_st11.gno deleted file mode 100644 index e8c4fd9e..00000000 --- a/_setup/grc20_wrapper/wrapper_st11.gno +++ /dev/null @@ -1,33 +0,0 @@ -package grc20wrapper - -import ( - "gno.land/r/demo/users" - - "gno.land/r/st11" - - pRegistry "gno.land/r/pool" - rRegistry "gno.land/r/router" - sRegistry "gno.land/r/staker" -) - -type SwapTest11TokenCTokenInterface struct{} - -func (SwapTest11TokenCTokenInterface) Transfer() func(to users.AddressOrName, amount uint64) { - return st11.Transfer -} - -func (SwapTest11TokenCTokenInterface) TransferFrom() func(from, to users.AddressOrName, amount uint64) { - return st11.TransferFrom -} - -func (SwapTest11TokenCTokenInterface) BalanceOf() func(owner users.AddressOrName) uint64 { - return st11.BalanceOf -} - -func (SwapTest11TokenCTokenInterface) Approve() func(spender users.AddressOrName, amount uint64) { - return st11.Approve -} - -var _ pRegistry.GRC20Interface = SwapTest11TokenCTokenInterface{} -var _ rRegistry.GRC20Interface = SwapTest11TokenCTokenInterface{} -var _ sRegistry.GRC20Interface = SwapTest11TokenCTokenInterface{} diff --git a/_setup/grc20_wrapper/wrapper_st22.gno b/_setup/grc20_wrapper/wrapper_st22.gno deleted file mode 100644 index e615cae2..00000000 --- a/_setup/grc20_wrapper/wrapper_st22.gno +++ /dev/null @@ -1,33 +0,0 @@ -package grc20wrapper - -import ( - "gno.land/r/demo/users" - - "gno.land/r/st22" - - pRegistry "gno.land/r/pool" - rRegistry "gno.land/r/router" - sRegistry "gno.land/r/staker" -) - -type SwapTest22TokenCTokenInterface struct{} - -func (SwapTest22TokenCTokenInterface) Transfer() func(to users.AddressOrName, amount uint64) { - return st22.Transfer -} - -func (SwapTest22TokenCTokenInterface) TransferFrom() func(from, to users.AddressOrName, amount uint64) { - return st22.TransferFrom -} - -func (SwapTest22TokenCTokenInterface) BalanceOf() func(owner users.AddressOrName) uint64 { - return st22.BalanceOf -} - -func (SwapTest22TokenCTokenInterface) Approve() func(spender users.AddressOrName, amount uint64) { - return st22.Approve -} - -var _ pRegistry.GRC20Interface = SwapTest22TokenCTokenInterface{} -var _ rRegistry.GRC20Interface = SwapTest22TokenCTokenInterface{} -var _ sRegistry.GRC20Interface = SwapTest22TokenCTokenInterface{} diff --git a/_setup/grc20_wrapper/wrapper_st33.gno b/_setup/grc20_wrapper/wrapper_st33.gno deleted file mode 100644 index cd7ceee6..00000000 --- a/_setup/grc20_wrapper/wrapper_st33.gno +++ /dev/null @@ -1,33 +0,0 @@ -package grc20wrapper - -import ( - "gno.land/r/demo/users" - - "gno.land/r/st33" - - pRegistry "gno.land/r/pool" - rRegistry "gno.land/r/router" - sRegistry "gno.land/r/staker" -) - -type SwapTest33TokenCTokenInterface struct{} - -func (SwapTest33TokenCTokenInterface) Transfer() func(to users.AddressOrName, amount uint64) { - return st33.Transfer -} - -func (SwapTest33TokenCTokenInterface) TransferFrom() func(from, to users.AddressOrName, amount uint64) { - return st33.TransferFrom -} - -func (SwapTest33TokenCTokenInterface) BalanceOf() func(owner users.AddressOrName) uint64 { - return st33.BalanceOf -} - -func (SwapTest33TokenCTokenInterface) Approve() func(spender users.AddressOrName, amount uint64) { - return st33.Approve -} - -var _ pRegistry.GRC20Interface = SwapTest33TokenCTokenInterface{} -var _ rRegistry.GRC20Interface = SwapTest33TokenCTokenInterface{} -var _ sRegistry.GRC20Interface = SwapTest33TokenCTokenInterface{} diff --git a/_setup/grc20_wrapper/wrapper_st44.gno b/_setup/grc20_wrapper/wrapper_st44.gno deleted file mode 100644 index c1e1b736..00000000 --- a/_setup/grc20_wrapper/wrapper_st44.gno +++ /dev/null @@ -1,33 +0,0 @@ -package grc20wrapper - -import ( - "gno.land/r/demo/users" - - "gno.land/r/st44" - - pRegistry "gno.land/r/pool" - rRegistry "gno.land/r/router" - sRegistry "gno.land/r/staker" -) - -type SwapTest44TokenCTokenInterface struct{} - -func (SwapTest44TokenCTokenInterface) Transfer() func(to users.AddressOrName, amount uint64) { - return st44.Transfer -} - -func (SwapTest44TokenCTokenInterface) TransferFrom() func(from, to users.AddressOrName, amount uint64) { - return st44.TransferFrom -} - -func (SwapTest44TokenCTokenInterface) BalanceOf() func(owner users.AddressOrName) uint64 { - return st44.BalanceOf -} - -func (SwapTest44TokenCTokenInterface) Approve() func(spender users.AddressOrName, amount uint64) { - return st44.Approve -} - -var _ pRegistry.GRC20Interface = SwapTest44TokenCTokenInterface{} -var _ rRegistry.GRC20Interface = SwapTest44TokenCTokenInterface{} -var _ sRegistry.GRC20Interface = SwapTest44TokenCTokenInterface{} diff --git a/_setup/grc20_wrapper/wrapper_st55.gno b/_setup/grc20_wrapper/wrapper_st55.gno deleted file mode 100644 index 123a2a58..00000000 --- a/_setup/grc20_wrapper/wrapper_st55.gno +++ /dev/null @@ -1,33 +0,0 @@ -package grc20wrapper - -import ( - "gno.land/r/demo/users" - - "gno.land/r/st55" - - pRegistry "gno.land/r/pool" - rRegistry "gno.land/r/router" - sRegistry "gno.land/r/staker" -) - -type SwapTest55TokenCTokenInterface struct{} - -func (SwapTest55TokenCTokenInterface) Transfer() func(to users.AddressOrName, amount uint64) { - return st55.Transfer -} - -func (SwapTest55TokenCTokenInterface) TransferFrom() func(from, to users.AddressOrName, amount uint64) { - return st55.TransferFrom -} - -func (SwapTest55TokenCTokenInterface) BalanceOf() func(owner users.AddressOrName) uint64 { - return st55.BalanceOf -} - -func (SwapTest55TokenCTokenInterface) Approve() func(spender users.AddressOrName, amount uint64) { - return st55.Approve -} - -var _ pRegistry.GRC20Interface = SwapTest55TokenCTokenInterface{} -var _ rRegistry.GRC20Interface = SwapTest55TokenCTokenInterface{} -var _ sRegistry.GRC20Interface = SwapTest55TokenCTokenInterface{} diff --git a/_setup/st11/gno.mod b/_setup/st11/gno.mod deleted file mode 100644 index 940676ae..00000000 --- a/_setup/st11/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/st11 \ No newline at end of file diff --git a/_setup/st11/st11.gno b/_setup/st11/st11.gno deleted file mode 100644 index 7a7ba4b1..00000000 --- a/_setup/st11/st11.gno +++ /dev/null @@ -1,118 +0,0 @@ -package st11 - -import ( - "std" - "strings" - - "gno.land/p/demo/grc/grc20" - "gno.land/p/demo/ufmt" - "gno.land/r/demo/users" -) - -var ( - st11 *grc20.AdminToken - admin std.Address = "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5" // TODO: helper to change admin -) - -func init() { - st11 = grc20.NewAdminToken("Swap Test 11", "ST11", 6) - st11.Mint(admin, 10_000_000_000_000) // @administrator (1M) -} - -// method proxies as public functions. -// - -// getters. -func GetGRC20() *grc20.AdminToken { - return st11 -} - -func TotalSupply() uint64 { - return st11.TotalSupply() -} - -func BalanceOf(owner users.AddressOrName) uint64 { - balance, err := st11.BalanceOf(owner.Resolve()) - if err != nil { - panic(err) - } - return balance -} - -func Allowance(owner, spender users.AddressOrName) uint64 { - allowance, err := st11.Allowance(owner.Resolve(), spender.Resolve()) - if err != nil { - panic(err) - } - return allowance -} - -// setters. - -func Transfer(to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st11.Transfer(caller, to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func Approve(spender users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st11.Approve(caller, spender.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func TransferFrom(from, to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st11.TransferFrom(caller, from.Resolve(), to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -// faucet. -func Faucet() { - caller := std.PrevRealm().Addr() - st11.Mint(caller, 1_000_000_000) -} - -// administration. -func Mint(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st11.Mint(address.Resolve(), amount) -} - -func Burn(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st11.Burn(address.Resolve(), amount) -} - -// render. -// - -func Render(path string) string { - parts := strings.Split(path, "/") - c := len(parts) - - switch { - case path == "": - return st11.RenderHome() - case c == 2 && parts[0] == "balance": - owner := users.AddressOrName(parts[1]) - balance, _ := st11.BalanceOf(owner.Resolve()) - return ufmt.Sprintf("%d\n", balance) - default: - return "404\n" - } -} - -func assertIsAdmin(address std.Address) { - if address != admin { - panic("restricted access") - } -} diff --git a/_setup/st22/gno.mod b/_setup/st22/gno.mod deleted file mode 100644 index 0f2e4108..00000000 --- a/_setup/st22/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/st22 \ No newline at end of file diff --git a/_setup/st22/st22.gno b/_setup/st22/st22.gno deleted file mode 100644 index ee4a2464..00000000 --- a/_setup/st22/st22.gno +++ /dev/null @@ -1,118 +0,0 @@ -package st22 - -import ( - "std" - "strings" - - "gno.land/p/demo/grc/grc20" - "gno.land/p/demo/ufmt" - "gno.land/r/demo/users" -) - -var ( - st22 *grc20.AdminToken - admin std.Address = "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5" // TODO: helper to change admin -) - -func init() { - st22 = grc20.NewAdminToken("Swap Test 22", "ST22", 6) - st22.Mint(admin, 10_000_000_000_000) // @administrator (1M) -} - -// method proxies as public functions. -// - -// getters. -func GetGRC20() *grc20.AdminToken { - return st22 -} - -func TotalSupply() uint64 { - return st22.TotalSupply() -} - -func BalanceOf(owner users.AddressOrName) uint64 { - balance, err := st22.BalanceOf(owner.Resolve()) - if err != nil { - panic(err) - } - return balance -} - -func Allowance(owner, spender users.AddressOrName) uint64 { - allowance, err := st22.Allowance(owner.Resolve(), spender.Resolve()) - if err != nil { - panic(err) - } - return allowance -} - -// setters. - -func Transfer(to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st22.Transfer(caller, to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func Approve(spender users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st22.Approve(caller, spender.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func TransferFrom(from, to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st22.TransferFrom(caller, from.Resolve(), to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -// faucet. -func Faucet() { - caller := std.PrevRealm().Addr() - st22.Mint(caller, 1_000_000_000) -} - -// administration. -func Mint(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st22.Mint(address.Resolve(), amount) -} - -func Burn(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st22.Burn(address.Resolve(), amount) -} - -// render. -// - -func Render(path string) string { - parts := strings.Split(path, "/") - c := len(parts) - - switch { - case path == "": - return st22.RenderHome() - case c == 2 && parts[0] == "balance": - owner := users.AddressOrName(parts[1]) - balance, _ := st22.BalanceOf(owner.Resolve()) - return ufmt.Sprintf("%d\n", balance) - default: - return "404\n" - } -} - -func assertIsAdmin(address std.Address) { - if address != admin { - panic("restricted access") - } -} diff --git a/_setup/st33/gno.mod b/_setup/st33/gno.mod deleted file mode 100644 index e43f248d..00000000 --- a/_setup/st33/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/st33 \ No newline at end of file diff --git a/_setup/st33/st33.gno b/_setup/st33/st33.gno deleted file mode 100644 index efc04dac..00000000 --- a/_setup/st33/st33.gno +++ /dev/null @@ -1,118 +0,0 @@ -package st33 - -import ( - "std" - "strings" - - "gno.land/p/demo/grc/grc20" - "gno.land/p/demo/ufmt" - "gno.land/r/demo/users" -) - -var ( - st33 *grc20.AdminToken - admin std.Address = "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5" // TODO: helper to change admin -) - -func init() { - st33 = grc20.NewAdminToken("Swap Test 33", "ST33", 6) - st33.Mint(admin, 10_000_000_000_000) // @administrator (1M) -} - -// method proxies as public functions. -// - -// getters. -func GetGRC20() *grc20.AdminToken { - return st33 -} - -func TotalSupply() uint64 { - return st33.TotalSupply() -} - -func BalanceOf(owner users.AddressOrName) uint64 { - balance, err := st33.BalanceOf(owner.Resolve()) - if err != nil { - panic(err) - } - return balance -} - -func Allowance(owner, spender users.AddressOrName) uint64 { - allowance, err := st33.Allowance(owner.Resolve(), spender.Resolve()) - if err != nil { - panic(err) - } - return allowance -} - -// setters. - -func Transfer(to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st33.Transfer(caller, to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func Approve(spender users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st33.Approve(caller, spender.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func TransferFrom(from, to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st33.TransferFrom(caller, from.Resolve(), to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -// faucet. -func Faucet() { - caller := std.PrevRealm().Addr() - st33.Mint(caller, 1_000_000_000) -} - -// administration. -func Mint(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st33.Mint(address.Resolve(), amount) -} - -func Burn(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st33.Burn(address.Resolve(), amount) -} - -// render. -// - -func Render(path string) string { - parts := strings.Split(path, "/") - c := len(parts) - - switch { - case path == "": - return st33.RenderHome() - case c == 2 && parts[0] == "balance": - owner := users.AddressOrName(parts[1]) - balance, _ := st33.BalanceOf(owner.Resolve()) - return ufmt.Sprintf("%d\n", balance) - default: - return "404\n" - } -} - -func assertIsAdmin(address std.Address) { - if address != admin { - panic("restricted access") - } -} diff --git a/_setup/st44/gno.mod b/_setup/st44/gno.mod deleted file mode 100644 index ef85c15d..00000000 --- a/_setup/st44/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/st44 \ No newline at end of file diff --git a/_setup/st44/st44.gno b/_setup/st44/st44.gno deleted file mode 100644 index b37c68b5..00000000 --- a/_setup/st44/st44.gno +++ /dev/null @@ -1,118 +0,0 @@ -package st44 - -import ( - "std" - "strings" - - "gno.land/p/demo/grc/grc20" - "gno.land/p/demo/ufmt" - "gno.land/r/demo/users" -) - -var ( - st44 *grc20.AdminToken - admin std.Address = "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5" // TODO: helper to change admin -) - -func init() { - st44 = grc20.NewAdminToken("Swap Test 44", "ST44", 6) - st44.Mint(admin, 10_000_000_000_000) // @administrator (1M) -} - -// method proxies as public functions. -// - -// getters. -func GetGRC20() *grc20.AdminToken { - return st44 -} - -func TotalSupply() uint64 { - return st44.TotalSupply() -} - -func BalanceOf(owner users.AddressOrName) uint64 { - balance, err := st44.BalanceOf(owner.Resolve()) - if err != nil { - panic(err) - } - return balance -} - -func Allowance(owner, spender users.AddressOrName) uint64 { - allowance, err := st44.Allowance(owner.Resolve(), spender.Resolve()) - if err != nil { - panic(err) - } - return allowance -} - -// setters. - -func Transfer(to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st44.Transfer(caller, to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func Approve(spender users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st44.Approve(caller, spender.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func TransferFrom(from, to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st44.TransferFrom(caller, from.Resolve(), to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -// faucet. -func Faucet() { - caller := std.PrevRealm().Addr() - st44.Mint(caller, 1_000_000_000) -} - -// administration. -func Mint(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st44.Mint(address.Resolve(), amount) -} - -func Burn(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st44.Burn(address.Resolve(), amount) -} - -// render. -// - -func Render(path string) string { - parts := strings.Split(path, "/") - c := len(parts) - - switch { - case path == "": - return st44.RenderHome() - case c == 2 && parts[0] == "balance": - owner := users.AddressOrName(parts[1]) - balance, _ := st44.BalanceOf(owner.Resolve()) - return ufmt.Sprintf("%d\n", balance) - default: - return "404\n" - } -} - -func assertIsAdmin(address std.Address) { - if address != admin { - panic("restricted access") - } -} diff --git a/_setup/st55/gno.mod b/_setup/st55/gno.mod deleted file mode 100644 index c943060d..00000000 --- a/_setup/st55/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/st55 \ No newline at end of file diff --git a/_setup/st55/st55.gno b/_setup/st55/st55.gno deleted file mode 100644 index c5c730d5..00000000 --- a/_setup/st55/st55.gno +++ /dev/null @@ -1,118 +0,0 @@ -package st55 - -import ( - "std" - "strings" - - "gno.land/p/demo/grc/grc20" - "gno.land/p/demo/ufmt" - "gno.land/r/demo/users" -) - -var ( - st55 *grc20.AdminToken - admin std.Address = "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5" // TODO: helper to change admin -) - -func init() { - st55 = grc20.NewAdminToken("Swap Test 55", "ST55", 6) - st55.Mint(admin, 10_000_000_000_000) // @administrator (1M) -} - -// method proxies as public functions. -// - -// getters. -func GetGRC20() *grc20.AdminToken { - return st55 -} - -func TotalSupply() uint64 { - return st55.TotalSupply() -} - -func BalanceOf(owner users.AddressOrName) uint64 { - balance, err := st55.BalanceOf(owner.Resolve()) - if err != nil { - panic(err) - } - return balance -} - -func Allowance(owner, spender users.AddressOrName) uint64 { - allowance, err := st55.Allowance(owner.Resolve(), spender.Resolve()) - if err != nil { - panic(err) - } - return allowance -} - -// setters. - -func Transfer(to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st55.Transfer(caller, to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func Approve(spender users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st55.Approve(caller, spender.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -func TransferFrom(from, to users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - err := st55.TransferFrom(caller, from.Resolve(), to.Resolve(), amount) - if err != nil { - panic(err.Error()) - } -} - -// faucet. -func Faucet() { - caller := std.PrevRealm().Addr() - st55.Mint(caller, 1_000_000_000) -} - -// administration. -func Mint(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st55.Mint(address.Resolve(), amount) -} - -func Burn(address users.AddressOrName, amount uint64) { - caller := std.PrevRealm().Addr() - assertIsAdmin(caller) - st55.Burn(address.Resolve(), amount) -} - -// render. -// - -func Render(path string) string { - parts := strings.Split(path, "/") - c := len(parts) - - switch { - case path == "": - return st55.RenderHome() - case c == 2 && parts[0] == "balance": - owner := users.AddressOrName(parts[1]) - balance, _ := st55.BalanceOf(owner.Resolve()) - return ufmt.Sprintf("%d\n", balance) - default: - return "404\n" - } -} - -func assertIsAdmin(address std.Address) { - if address != admin { - panic("restricted access") - } -} diff --git a/_test/init_only.mk b/_test/init_only.mk index d189a9b4..8dd0ab47 100644 --- a/_test/init_only.mk +++ b/_test/init_only.mk @@ -56,14 +56,7 @@ deploy-grc20s: @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st3 -pkgpath gno.land/r/st3 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st4 -pkgpath gno.land/r/st4 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st5 -pkgpath gno.land/r/st5 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st11 -pkgpath gno.land/r/st11 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st22 -pkgpath gno.land/r/st22 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st33 -pkgpath gno.land/r/st33 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st44 -pkgpath gno.land/r/st44 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/st55 -pkgpath gno.land/r/st55 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/testtokena -pkgpath gno.land/r/testtokena -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/testtokenb -pkgpath gno.land/r/testtokenb -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/testtokenc -pkgpath gno.land/r/testtokenc -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null + @echo deploy-gnft: $(info ************ [GNFT] deploy lp token ************) @@ -119,14 +112,7 @@ approve-test1: @echo "" | gnokey maketx call -pkgpath gno.land/r/st3 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo "" | gnokey maketx call -pkgpath gno.land/r/st4 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo "" | gnokey maketx call -pkgpath gno.land/r/st5 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/st11 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/st22 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/st33 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/st44 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/st55 -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/testtokena -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/testtokenb -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/testtokenc -func Approve -args $(ADDR_POOL) -args 500000000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null + @echo @@ -173,37 +159,6 @@ pool-create: @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st4" -args "gno.land/r/st5" -args 500 -args 87350341247483919659585300674 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st4" -args "gno.land/r/st5" -args 10000 -args 86446650220495278410339891092 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st22" -args 100 -args 78632271998467896963137734028 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st22" -args 3000 -args 79816596014554786537349811406 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st33" -args 500 -args 114951834955391683882956380297 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st33" -args 10000 -args 114127195240248353140234912719 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st44" -args 100 -args 96223355229883343171379415442 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st44" -args 3000 -args 94577818186581255193903899028 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st55" -args 500 -args 105553452024597856248239970211 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st11" -args "gno.land/r/st55" -args 10000 -args 104060055720203537188615070492 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st22" -args "gno.land/r/st33" -args 100 -args 105553452024597856248239970211 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st22" -args "gno.land/r/st33" -args 3000 -args 113575045994529217799398739318 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st22" -args "gno.land/r/st44" -args 500 -args 93744538858360434067702382727 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st22" -args "gno.land/r/st44" -args 10000 -args 98639408880844237329631226990 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st22" -args "gno.land/r/st55" -args 100 -args 107036166435155529528362134687 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st22" -args "gno.land/r/st55" -args 3000 -args 103303220962225903261255492424 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st33" -args "gno.land/r/st44" -args 500 -args 65597741190543616110355062640 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st33" -args "gno.land/r/st44" -args 10000 -args 64634091399937790156998403932 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st33" -args "gno.land/r/st55" -args 100 -args 71936706074190924971728256808 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st33" -args "gno.land/r/st55" -args 3000 -args 71238766072602061195894228565 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st44" -args "gno.land/r/st55" -args 500 -args 87350341247483919659585300674 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/st44" -args "gno.land/r/st55" -args 10000 -args 86446650220495278410339891092 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo @@ -246,39 +201,10 @@ position-mint: @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st4" -args "gno.land/r/st5" -args 500 -args -11910 -args 4180 -args 5000000000 -args 28808800000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st4" -args "gno.land/r/st5" -args 10000 -args 3200 -args 16200 -args 195000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st22" -args 100 -args -14014 -args 2080 -args 20000000000 -args 93281000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st22" -args 3000 -args 1560 -args 14640 -args 16000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st33" -args 500 -args -6420 -args 9670 -args 15000000000 -args 149269000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st33" -args 10000 -args 8600 -args 21800 -args 85000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st44" -args 100 -args -9978 -args 6114 -args 2000000000 -args 13968500000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st44" -args 3000 -args 4920 -args 18000 -args 18000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st55" -args 500 -args -8130 -args 7970 -args 35000000000 -args 294396000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st11" -args "gno.land/r/st55" -args 10000 -args 6800 -args 20000 -args 65000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st22" -args "gno.land/r/st33" -args 100 -args -6420 -args 9674 -args 8000000000 -args 79745300000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st22" -args "gno.land/r/st33" -args 3000 -args 8580 -args 21660 -args 12000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st22" -args "gno.land/r/st44" -args 500 -args -10500 -args 5600 -args 900000000000 -args 5959200000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st22" -args "gno.land/r/st44" -args 10000 -args 5800 -args 18800 -args 1100000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st22" -args "gno.land/r/st55" -args 100 -args -7848 -args 8248 -args 17000000000 -args 146986000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st22" -args "gno.land/r/st55" -args 3000 -args 6720 -args 19800 -args 30000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st33" -args "gno.land/r/st44" -args 500 -args -17640 -args -1550 -args 10000000000 -args 32406000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st33" -args "gno.land/r/st44" -args 10000 -args -2600 -args 10400 -args 19000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st33" -args "gno.land/r/st55" -args 100 -args -15794 -args 300 -args 25000000000 -args 97589400000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st33" -args "gno.land/r/st55" -args 3000 -args -720 -args 12360 -args 75000000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st44" -args "gno.land/r/st55" -args 500 -args -11910 -args 4180 -args 15000000000 -args 86476200000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/st44" -args "gno.land/r/st55" -args 10000 -args 3200 -args 16200 -args 17500000000 -args 0 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null @echo + done: $(info ************ [DONE] send 1ugnot to gov ************) @echo "" | gnokey maketx send -send 1ugnot -to $(ADDR_GOV) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null diff --git a/_test/live_test_multi_msg.mk b/_test/live_test_multi_msg.mk deleted file mode 100644 index 18999281..00000000 --- a/_test/live_test_multi_msg.mk +++ /dev/null @@ -1,279 +0,0 @@ -# Test Mnemonic -# source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast - -# Test Accounts -# gnokey add -recover=true -index 10 gsa -# gnokey add -recover=true -index 11 lp01 -# gnokey add -recover=true -index 12 lp02 -# gnokey add -recover=true -index 13 tr01 - -ADDR_GSA := g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4 -ADDR_LP01 := g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd -ADDR_LP02 := g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq -ADDR_TR01 := g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn - -ADDR_POOL := g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w -ADDR_POS := g1htpxzv2dkplvzg50nd8fswrneaxmdpwn459thx -ADDR_STAKER := g13h5s9utqcwg3a655njen0p89txusjpfrs3vxp8 -ADDR_ROUTER := g1ernz3lj85hnn3ucug73ymgkhqdv2lg8e4yd48e -ADDR_GOV := g1wj5lwwmkru3ky6dh2zztanrcj2ups8g0pfe8cu - -TX_EXPIRE := 9999999999 - -NOW := $(shell date +%s) -INCENTIVE_START := $(shell expr $(NOW) + 120) -INCENTIVE_END := $(shell expr $(NOW) + 7776000) # 90 DAY - -MAKEFILE := $(shell realpath $(firstword $(MAKEFILE_LIST))) -GNOLAND_RPC_URL ?= localhost:26657 -CHAINID ?= dev -ROOT_DIR:=$(shell dirname $(MAKEFILE))/.. - -.PHONY: help -help: - @echo "Available make commands:" - @cat $(MAKEFILE) | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /' - -.PHONY: all -all: deploy faucet-approve pool-setup position-mint staker-stake router-swap staker-unstake done - -.PHONY: deploy -deploy: deploy-foo deploy-bar deploy-baz deploy-qux deploy-wugnot deploy-gns deploy-obl deploy-gnft deploy-gov deploy-pool deploy-position deploy-staker deploy-router deploy-grc20_wrapper - -.PHONY: faucet-approve -faucet-approve: faucet-approve-lp01 faucet-approve-lp02 faucet-approve-tr01 faucet-approve-gsa - -.PHONY: pool-setup -pool-setup: pool-init pool-create - -.PHONY: position-mint -position-mint: mint-01 mint-02 mint-03 mint-rest - -.PHONY: staker-stake -staker-stake: stake-token-1 stake-token-2 - -.PHONY: router-swap -router-swap: set-protocol-fee swap-exact-in-single swap-exact-out-multi collect-lp01 collect-lp02 - -.PHONY: staker-unstake -staker-unstake: unstake-token-1 unstake-token-2 - -# Deploy Tokens -# [GRC20] FOO, BAR, BAZ, QUX: Token Pair for Pool -# [GRC20] WUGNOT: Wrapped GRC20 for native ugnot -# [GRC20] GNS: Default Staking Reward -# [GRC20] OBL: External Staking Reward -# [GRC721] GNFT: LP Token -deploy-foo: - $(info ************ [FOO] deploy foo ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/foo -pkgpath gno.land/r/foo -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-bar: - $(info ************ [BAR] deploy bar ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/bar -pkgpath gno.land/r/bar -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-baz: - $(info ************ [BAZ] deploy baz ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/baz -pkgpath gno.land/r/baz -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-qux: - $(info ************ [QUX] deploy qux ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/qux -pkgpath gno.land/r/qux -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-wugnot: - $(info ************ [WUGNOT] deploy wugnot ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/wugnot -pkgpath gno.land/r/wugnot -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-gns: - $(info ************ [GNS] deploy staking reward ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/gns -pkgpath gno.land/r/gns -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-obl: - $(info ************ [OBL] deploy external staking reward ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/obl -pkgpath gno.land/r/obl -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-gnft: - $(info ************ [GNFT] deploy lp token ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/gnft -pkgpath gno.land/r/gnft -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - - -# Deploy Contracts -deploy-gov: - $(info ************ [GOV] deploy governance ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/gov -pkgpath gno.land/r/gov -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-pool: - $(info ************ [POOL] deploy pool ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/pool -pkgpath gno.land/r/pool -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-position: - $(info ************ [POSITION] deploy position ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/position -pkgpath gno.land/r/position -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-staker: - $(info ************ [STAKER] deploy staker ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/staker -pkgpath gno.land/r/staker -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-router: - $(info ************ [ROUTER] deploy router ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/router -pkgpath gno.land/r/router -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-grc20_wrapper: - $(info ************ [GRC20 Wrapper] deploy grc20_wrapper ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/grc20_wrapper -pkgpath gno.land/r/grc20_wrapper -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - - -# Facuet Tokens & Approve Tokens -faucet-approve-lp01: - $(info ************ [Faucet & Approve] lp01 ************) - @echo "" | gnokey sign -txpath multi_msg_01.txt -insecure-password-stdin=true -chainid $(CHAINID) -number 1 -sequence 0 lp01 > signed01.tx - gnokey broadcast -remote $(GNOLAND_RPC_URL) signed01.tx > /dev/null - -faucet-approve-lp02: - $(info ************ [Faucet & Approve] lp02 ************) - @echo "" | gnokey sign -txpath multi_msg_02.txt -insecure-password-stdin=true -chainid $(CHAINID) -number 2 -sequence 0 lp02 > signed02.tx - gnokey broadcast -remote $(GNOLAND_RPC_URL) signed02.tx > /dev/null - -faucet-approve-tr01: - $(info ************ [Faucet & Approve] tr01 ************) - @echo "" | gnokey sign -txpath multi_msg_03.txt -insecure-password-stdin=true -chainid $(CHAINID) -number 3 -sequence 0 tr01 > signed03.tx - gnokey broadcast -remote $(GNOLAND_RPC_URL) signed03.tx > /dev/null - -faucet-approve-gsa: - $(info ************ [Faucet & Approve] gsa ************) - @echo "" | gnokey sign -txpath multi_msg_04.txt -insecure-password-stdin=true -chainid $(CHAINID) -number 0 -sequence 0 gsa > signed04.tx - gnokey broadcast -remote $(GNOLAND_RPC_URL) signed04.tx > /dev/null - - -# Pool -pool-init: - $(info ************ [POOL] init pool ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func InitManual -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo - -pool-create: - $(info ************ [POOL] create pools ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gnot" -args "gno.land/r/bar" -args 100 -args 101729702841318637793976746270 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/bar" -args "gno.land/r/baz" -args 100 -args 101729702841318637793976746270 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/baz" -args "gno.land/r/qux" -args 100 -args 101729702841318637793976746270 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gnot" -args "gno.land/r/bar" -args 500 -args 101729702841318637793976746270 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/bar" -args "gno.land/r/baz" -args 500 -args 101729702841318637793976746270 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args "gno.land/r/baz" -args "gno.land/r/qux" -args 500 -args 101729702841318637793976746270 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo - - -# Position -mint-01: - $(info ************ [POSITION - 1] mint gnot & bar // tick range 4000 ~ 6000 // by lp01 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gnot" -args "gno.land/r/bar" -args 100 -args 4000 -args 6000 -args 10000000 -args 10000000 -args 0 -args 0 -args $(TX_EXPIRE) -send "10000000ugnot" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo - -mint-02: - $(info ************ [POSITION - 2] mint bar & baz // tick range 4000 ~ 6000 // by lp02 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/bar" -args "gno.land/r/baz" -args 100 -args 4000 -args 6000 -args 10000000 -args 10000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo - -mint-03: - $(info ************ [POSITION - 3] mint baz & qux // tick range 4000 ~ 6000 // by lp02 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/baz" -args "gno.land/r/qux" -args 100 -args 4000 -args 6000 -args 10000000 -args 10000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo - -mint-rest: - $(info ************ [POSITION - 4,5,6] ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/bar" -args "gnot" -args 500 -args -6000 -args -4000 -args 10000000 -args 10000000 -args 0 -args 0 -args $(TX_EXPIRE) -send "10000000ugnot" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/bar" -args "gno.land/r/baz" -args 500 -args 4000 -args 6000 -args 10000000 -args 10000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args "gno.land/r/baz" -args "gno.land/r/qux" -args 500 -args 4000 -args 6000 -args 10000000 -args 10000000 -args 0 -args 0 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo - - -# Staker -create-external-incentive: - $(info ************ [STAKER] create external incentive ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/staker -func CreateExternalIncentive -args "gno.land/r/bar:gnot:100" -args "gno.land/r/obl" -args 10000000000 -args $(INCENTIVE_START) -args $(INCENTIVE_END)-insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo - -stake-token-1: - $(info ************ [STAKER] stake gnft tokenId 1) - @$(MAKE) -f $(MAKEFILE) skip-time - @echo "" | gnokey maketx call -pkgpath gno.land/r/gnft -func Approve -args $(ADDR_STAKER) -args "1" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/staker -func StakeToken -args 1 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo - -stake-token-2: - $(info ************ [STAKER] stake gnft tokenId 2) - @$(MAKE) -f $(MAKEFILE) skip-time - @echo "" | gnokey maketx call -pkgpath gno.land/r/gnft -func Approve -args $(ADDR_STAKER) -args "2" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/staker -func StakeToken -args 2 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo - - -# Swap -set-protocol-fee: - $(info ************ [POOL] Set Protocol Fee ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func SetFeeProtocol -args 6 -args 8 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo - -swap-exact-in-single: - $(info ************ [ROUTER] Swap 123_456 BAR to BAZ // singlePath ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/router -func SwapRoute -args "gno.land/r/bar" -args "gno.land/r/baz" -args 123456 -args "EXACT_IN" -args "gno.land/r/bar:gno.land/r/baz:100" -args "100" -args 200000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @echo - -swap-exact-out-multi: - $(info ************ [ROUTER] Swap NATIVE ugnot to 987_654 QUX // multiPath ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/router -func SwapRoute -args "gnot" -args "gno.land/r/qux" -args 987654 -args "EXACT_OUT" -args "gnot:gno.land/r/bar:100*POOL*gno.land/r/bar:gno.land/r/baz:100*POOL*gno.land/r/baz:gno.land/r/qux:100,gnot:gno.land/r/bar:500*POOL*gno.land/r/bar:gno.land/r/baz:500*POOL*gno.land/r/baz:gno.land/r/qux:500" -args "40,60" -args 654321 -send 100000000ugnot -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @echo - -collect-lp01: - $(info ************ [POSITION] Collect swap fee at position of tokenId 1 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Collect -args 1 -args $(ADDR_LP01) -args 1000000 -args 1000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo - -collect-lp02: - $(info ************ [POSITION] Collect swap fee at position of tokenId 2 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Collect -args 2 -args $(ADDR_LP02) -args 1000000 -args 1000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo - - -## Staker // Unstake -unstake-token-1: - $(info ************ [STAKER] unstake gnft tokenId 1 ************) - @$(MAKE) -f $(MAKEFILE) skip-time - @echo "" | gnokey maketx call -pkgpath gno.land/r/staker -func UnstakeToken -args 1 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo - -unstake-token-2: - $(info ************ [STAKER] unstake gnft tokenId 2 ************) - @$(MAKE) -f $(MAKEFILE) skip-time - @echo "" | gnokey maketx call -pkgpath gno.land/r/staker -func UnstakeToken -args 2 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp02 > /dev/null - @echo - -### can not test staker EndExternalIncentive -### it needs to wait for 90 days ( which we can't skip it in makefiles ) - -done: - @echo "" | gnokey maketx send -send 1ugnot -to $(ADDR_GOV) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - -## ETC -# gno time.Now returns last block time, not actual time -# so to skip time, we need new block -skip-time: - $(info > SKIP 3 BLOCKS) - @echo "" | gnokey maketx send -send 1ugnot -to g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx send -send 1ugnot -to g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo "" | gnokey maketx send -send 1ugnot -to g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo \ No newline at end of file diff --git a/_test/multi_msg_01.txt b/_test/multi_msg_01.txt deleted file mode 100644 index 54b8f611..00000000 --- a/_test/multi_msg_01.txt +++ /dev/null @@ -1 +0,0 @@ -{"msg":[{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/foo","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/foo","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/bar","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/bar","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/baz","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/baz","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/qux","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/qux","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd","send":"","pkg_path":"gno.land/r/wugnot","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]}],"fee":{"gas_wanted":"9000000","gas_fee":"1ugnot"},"signatures":null,"memo":""} \ No newline at end of file diff --git a/_test/multi_msg_02.txt b/_test/multi_msg_02.txt deleted file mode 100644 index 1a21e1c0..00000000 --- a/_test/multi_msg_02.txt +++ /dev/null @@ -1 +0,0 @@ -{"msg":[{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/foo","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/foo","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/bar","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/bar","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/baz","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/baz","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/qux","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/qux","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq","send":"","pkg_path":"gno.land/r/wugnot","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]}],"fee":{"gas_wanted":"9000000","gas_fee":"1ugnot"},"signatures":null,"memo":""} \ No newline at end of file diff --git a/_test/multi_msg_03.txt b/_test/multi_msg_03.txt deleted file mode 100644 index 27c23370..00000000 --- a/_test/multi_msg_03.txt +++ /dev/null @@ -1 +0,0 @@ -{"msg":[{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/foo","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/foo","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/bar","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/bar","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/baz","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/baz","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/qux","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/qux","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn","send":"","pkg_path":"gno.land/r/wugnot","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]}],"fee":{"gas_wanted":"9000000","gas_fee":"1ugnot"},"signatures":null,"memo":""} \ No newline at end of file diff --git a/_test/multi_msg_04.txt b/_test/multi_msg_04.txt deleted file mode 100644 index ef0c57af..00000000 --- a/_test/multi_msg_04.txt +++ /dev/null @@ -1 +0,0 @@ -{"msg":[{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/foo","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/foo","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/bar","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/bar","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/baz","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/baz","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/qux","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/qux","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/gns","func":"FaucetL"},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/gns","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/gns","func":"Approve","args":["g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w","50000000000"]},{"@type":"/vm.m_call","caller":"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4","send":"","pkg_path":"gno.land/r/wugnot","func":"Approve","args":["g13h5s9utqcwg3a655njen0p89txusjpfrs3vxp8","50000000000"]}],"fee":{"gas_wanted":"9000000","gas_fee":"1ugnot"},"signatures":null,"memo":""} \ No newline at end of file diff --git a/_test/multi_msg_generator.ipynb b/_test/multi_msg_generator.ipynb deleted file mode 100644 index 11439447..00000000 --- a/_test/multi_msg_generator.ipynb +++ /dev/null @@ -1,380 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "600b6cee-59be-4817-be50-2a6ac0969106", - "metadata": {}, - "outputs": [], - "source": [ - "from string import Template \n", - "\n", - "from datetime import timezone \n", - "import datetime " - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "6be7faf1-8c9e-4d07-a9af-ba9af0de0070", - "metadata": {}, - "outputs": [], - "source": [ - "ADDR_GSA = \"g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4\"\n", - "ADDR_LP01 = \"g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd\"\n", - "ADDR_LP02 = \"g126yz2f34qdxaqxelmky40dym379q0vw3yzhyrq\"\n", - "ADDR_TR01 = \"g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn\"\n", - "\n", - "ADDR_POOL = \"g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w\"\n", - "ADDR_POS = \"g1htpxzv2dkplvzg50nd8fswrneaxmdpwn459thx\"\n", - "ADDR_STAKER = \"g13h5s9utqcwg3a655njen0p89txusjpfrs3vxp8\"\n", - "ADDR_ROUTER = \"g1ernz3lj85hnn3ucug73ymgkhqdv2lg8e4yd48e\"\n", - "ADDR_GOV = \"g1wj5lwwmkru3ky6dh2zztanrcj2ups8g0pfe8cu\"\n", - "\n", - "TX_EXPIRE = 9999999999" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "d9a73750-4014-4980-9ae8-5d6e8a31a1e0", - "metadata": {}, - "outputs": [], - "source": [ - "# def deployer()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4ca8146c-5126-44e8-aacc-25b91703b8a9", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "3c65e446-26c3-44d7-b1b8-5a1f8c157516", - "metadata": {}, - "outputs": [], - "source": [ - "t = Template('{\"@type\":\"/vm.m_call\",\"caller\":\"$caller\",\"send\":\"$send\",\"pkg_path\":\"$pkg_path\",\"func\":\"$func\",\"args\":$args}')\n", - "tna = Template('{\"@type\":\"/vm.m_call\",\"caller\":\"$caller\",\"send\":\"$send\",\"pkg_path\":\"$pkg_path\",\"func\":\"$func\"}')" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "8ca0ce1f-5861-4dc6-b725-eaa9a2c8c8a7", - "metadata": {}, - "outputs": [], - "source": [ - "gsa_msgs = \"\"\n", - "lp01_msgs = \"\"\n", - "lp02_msgs = \"\"\n", - "tr01_msgs = \"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 39, - "id": "383891f2-6da2-427c-b9db-b206e6d4ac3f", - "metadata": {}, - "outputs": [], - "source": [ - "def faucet_approve(msgs, caller, pkg_path, spender, amount):\n", - " msg = tna.substitute(caller=caller, send='', pkg_path=pkg_path, func='FaucetL')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " msg = t.substitute(caller=caller, send='', pkg_path=pkg_path, func='Approve', args=f'[\"{spender}\",\"{amount}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - "\n", - "def approve(msgs, caller, pkg_path, spender, amount):\n", - " msg = t.substitute(caller=caller, send='', pkg_path=pkg_path, func='Approve', args=f'[\"{spender}\",\"{amount}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - "\n", - "lp01_msgs = faucet_approve(lp01_msgs, ADDR_LP01, \"gno.land/r/foo\", ADDR_POOL, 50000000000)\n", - "lp01_msgs = faucet_approve(lp01_msgs, ADDR_LP01, \"gno.land/r/bar\", ADDR_POOL, 50000000000)\n", - "lp01_msgs = faucet_approve(lp01_msgs, ADDR_LP01, \"gno.land/r/baz\", ADDR_POOL, 50000000000)\n", - "lp01_msgs = faucet_approve(lp01_msgs, ADDR_LP01, \"gno.land/r/qux\", ADDR_POOL, 50000000000)\n", - "lp01_msgs = approve(lp01_msgs, ADDR_LP01, \"gno.land/r/wugnot\", ADDR_POOL, 50000000000)\n", - "\n", - "lp02_msgs = faucet_approve(lp02_msgs, ADDR_LP02, \"gno.land/r/foo\", ADDR_POOL, 50000000000)\n", - "lp02_msgs = faucet_approve(lp02_msgs, ADDR_LP02, \"gno.land/r/bar\", ADDR_POOL, 50000000000)\n", - "lp02_msgs = faucet_approve(lp02_msgs, ADDR_LP02, \"gno.land/r/baz\", ADDR_POOL, 50000000000)\n", - "lp02_msgs = faucet_approve(lp02_msgs, ADDR_LP02, \"gno.land/r/qux\", ADDR_POOL, 50000000000)\n", - "lp02_msgs = approve(lp02_msgs, ADDR_LP02, \"gno.land/r/wugnot\", ADDR_POOL, 50000000000)\n", - "\n", - "tr01_msgs = faucet_approve(tr01_msgs, ADDR_TR01, \"gno.land/r/foo\", ADDR_POOL, 50000000000)\n", - "tr01_msgs = faucet_approve(tr01_msgs, ADDR_TR01, \"gno.land/r/bar\", ADDR_POOL, 50000000000)\n", - "tr01_msgs = faucet_approve(tr01_msgs, ADDR_TR01, \"gno.land/r/baz\", ADDR_POOL, 50000000000)\n", - "tr01_msgs = faucet_approve(tr01_msgs, ADDR_TR01, \"gno.land/r/qux\", ADDR_POOL, 50000000000)\n", - "tr01_msgs = approve(tr01_msgs, ADDR_TR01, \"gno.land/r/wugnot\", ADDR_POOL, 50000000000)\n", - "\n", - "\n", - "gsa_msgs = faucet_approve(gsa_msgs, ADDR_GSA, \"gno.land/r/foo\", ADDR_POOL, 50000000000)\n", - "gsa_msgs = faucet_approve(gsa_msgs, ADDR_GSA, \"gno.land/r/bar\", ADDR_POOL, 50000000000)\n", - "gsa_msgs = faucet_approve(gsa_msgs, ADDR_GSA, \"gno.land/r/baz\", ADDR_POOL, 50000000000)\n", - "gsa_msgs = faucet_approve(gsa_msgs, ADDR_GSA, \"gno.land/r/qux\", ADDR_POOL, 50000000000)\n", - "gsa_msgs = faucet_approve(gsa_msgs, ADDR_GSA, \"gno.land/r/gns\", ADDR_POOL, 50000000000)\n", - "\n", - "gsa_msgs = approve(gsa_msgs, ADDR_GSA, \"gno.land/r/gns\", ADDR_POOL, 50000000000)\n", - "gsa_msgs = approve(gsa_msgs, ADDR_GSA, \"gno.land/r/wugnot\", ADDR_STAKER, 50000000000)" - ] - }, - { - "cell_type": "code", - "execution_count": 41, - "id": "71983033-2dee-4982-bf9e-b93638af09d8", - "metadata": {}, - "outputs": [], - "source": [ - "multi_msg_01 = lp01_msgs[:-1]\n", - "multi_msg_01 = f'\"msg\":[{multi_msg_01}]'\n", - "multi_msg_01 = '{' + multi_msg_01 + ',\"fee\":{\"gas_wanted\":\"9000000\",\"gas_fee\":\"1ugnot\"},\"signatures\":null,\"memo\":\"\"}'\n", - "\n", - "multi_msg_02 = lp02_msgs[:-1]\n", - "multi_msg_02 = f'\"msg\":[{multi_msg_02}]'\n", - "multi_msg_02 = '{' + multi_msg_02 + ',\"fee\":{\"gas_wanted\":\"9000000\",\"gas_fee\":\"1ugnot\"},\"signatures\":null,\"memo\":\"\"}'\n", - "\n", - "multi_msg_03 = tr01_msgs[:-1]\n", - "multi_msg_03 = f'\"msg\":[{multi_msg_03}]'\n", - "multi_msg_03 = '{' + multi_msg_03 + ',\"fee\":{\"gas_wanted\":\"9000000\",\"gas_fee\":\"1ugnot\"},\"signatures\":null,\"memo\":\"\"}'\n", - "\n", - "\n", - "multi_msg_04 = gsa_msgs[:-1]\n", - "multi_msg_04 = f'\"msg\":[{multi_msg_04}]'\n", - "multi_msg_04 = '{' + multi_msg_04 + ',\"fee\":{\"gas_wanted\":\"9000000\",\"gas_fee\":\"1ugnot\"},\"signatures\":null,\"memo\":\"\"}'\n", - "\n", - "lp01_msgs = \"\"\n", - "lp02_msgs = \"\"\n", - "tr01_msgs = \"\"\n", - "gsa_msgs = \"\"\n", - "\n", - "with open(\"multi_msg_01.txt\", \"w\") as f:\n", - " f.write(multi_msg_01)\n", - " \n", - "with open(\"multi_msg_02.txt\", \"w\") as f:\n", - " f.write(multi_msg_02)\n", - " \n", - "with open(\"multi_msg_03.txt\", \"w\") as f:\n", - " f.write(multi_msg_03)\n", - " \n", - "with open(\"multi_msg_04.txt\", \"w\") as f:\n", - " f.write(multi_msg_04)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "fe3f09fa-249b-470e-90b5-2c0c8aef747f", - "metadata": {}, - "outputs": [], - "source": [ - "def pool_init(msgs, caller):\n", - " msg = tna.substitute(caller=caller, send='', pkg_path='gno.land/r/pool', func='InitManual')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - " \n", - "gsa_msgs = pool_init(gsa_msgs, ADDR_GSA)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "45ec520c-b0f3-4f0b-9d9f-fda2a8fde3c5", - "metadata": {}, - "outputs": [], - "source": [ - "def pool_create(msgs, caller, tokenA, tokenB, fee, sqrtX96):\n", - " msg = t.substitute(caller=caller, send='', pkg_path='gno.land/r/pool', func='CreatePool', args=f'[\"{tokenA}\",\"{tokenB}\",\"{fee}\",\"{sqrtX96}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - "\n", - "gsa_msgs = pool_create(gsa_msgs, ADDR_GSA, \"gnot\", \"gno.land/r/bar\", 100, 101729702841318637793976746270)\n", - "gsa_msgs = pool_create(gsa_msgs, ADDR_GSA, \"gno.land/r/bar\", \"gno.land/r/baz\", 100, 101729702841318637793976746270)\n", - "gsa_msgs = pool_create(gsa_msgs, ADDR_GSA, \"gno.land/r/baz\", \"gno.land/r/qux\", 100, 101729702841318637793976746270)\n", - "\n", - "gsa_msgs = pool_create(gsa_msgs, ADDR_GSA, \"gnot\", \"gno.land/r/bar\", 500, 101729702841318637793976746270)\n", - "gsa_msgs = pool_create(gsa_msgs, ADDR_GSA, \"gno.land/r/bar\", \"gno.land/r/baz\", 500, 101729702841318637793976746270)\n", - "gsa_msgs = pool_create(gsa_msgs, ADDR_GSA, \"gno.land/r/baz\", \"gno.land/r/qux\", 500, 101729702841318637793976746270)" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "b1e91bc5-1850-4abe-a95d-5aac9da5a37e", - "metadata": {}, - "outputs": [], - "source": [ - "def position_mint(msgs, caller, send, tokenA, tokenB, fee, minTick, maxTick, maxA, maxB, minA, minB): \n", - " msg = t.substitute(caller=caller, send=send, pkg_path='gno.land/r/position', func='Mint', args=f'[\"{tokenA}\",\"{tokenB}\",\"{fee}\",\"{minTick}\",\"{maxTick}\",\"{maxA}\",\"{maxB}\",\"{minA}\",\"{minB}\",\"{TX_EXPIRE}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - "\n", - " return msgs\n", - "\n", - " \n", - "lp01_msgs = position_mint(lp01_msgs, ADDR_LP01, \"10000000ugnot\", \"gnot\", \"gno.land/r/bar\", 100, 4000, 6000, 10000000, 10000000, 0, 0)\n", - "lp02_msgs = position_mint(lp02_msgs, ADDR_LP02, \"\", \"gno.land/r/bar\", \"gno.land/r/baz\", 100, 4000, 6000, 10000000, 10000000, 0, 0)\n", - "lp02_msgs = position_mint(lp02_msgs, ADDR_LP02, \"\", \"gno.land/r/baz\", \"gno.land/r/qux\", 100, 4000, 6000, 10000000, 10000000, 0, 0)\n", - "\n", - "lp01_msgs = position_mint(lp01_msgs, ADDR_LP01, \"10000000ugnot\", \"gnot\", \"gno.land/r/bar\", 500, 4000, 6000, 10000000, 10000000, 0, 0)\n", - "lp02_msgs = position_mint(lp02_msgs, ADDR_LP02, \"\", \"gno.land/r/bar\", \"gno.land/r/baz\", 500, 4000, 6000, 10000000, 10000000, 0, 0)\n", - "lp02_msgs = position_mint(lp02_msgs, ADDR_LP02, \"\", \"gno.land/r/baz\", \"gno.land/r/qux\", 500, 4000, 6000, 10000000, 10000000, 0, 0)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "703d1455-08a9-4510-8d1b-9da78dc24a09", - "metadata": {}, - "outputs": [], - "source": [ - "def staker_create(msgs, caller, send, targetPath, rewardToken, rewardAmount, startTime, endTime):\n", - " msg = t.substitute(caller=caller, send=send, pkg_path='gno.land/r/staker', func='CreateExternalIncentive', args=f'[\"{targetPath}\",\"{rewardToken}\",\"{rewardAmount}\",\"{startTime}\",\"{endTime}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - "\n", - " \n", - "dt = datetime.datetime.now(timezone.utc) \n", - "utc_time = dt.replace(tzinfo=timezone.utc) \n", - "utc_timestamp = utc_time.timestamp() \n", - "\n", - "incentive_start = utc_timestamp\n", - "incentive_end = incentive_start + 100\n", - "\n", - "gsa_msgs = staker_create(gsa_msgs, ADDR_GSA, \"\", \"gno.land/r/bar:gnot:10\", \"gno.land/r/obl\", \"10000000000\", incentive_start, incentive_end)" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "1d2df3eb-e451-4d76-9ced-b04f09075f17", - "metadata": {}, - "outputs": [], - "source": [ - "def staker_stake(msgs, caller, tokenId):\n", - " msg = t.substitute(caller=caller, send='', pkg_path='gno.land/r/gnft', func='Approve', args=f'[\"{ADDR_STAKER}\",\"{tokenId}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " msg = t.substitute(caller=caller, send='', pkg_path='gno.land/r/staker', func='StakeToken', args=f'[\"{tokenId}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - " \n", - " \n", - "lp01_msgs = staker_stake(lp01_msgs, ADDR_LP01, 1)\n", - "lp02_msgs = staker_stake(lp02_msgs, ADDR_LP02, 2)" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "a3e43c08-5cb6-4b2d-9cfc-db4edb528d85", - "metadata": {}, - "outputs": [], - "source": [ - "def pool_set_protocol_fee(msgs, caller, feeA, feeB): \n", - " msg = t.substitute(caller=caller, send='', pkg_path='gno.land/r/pool', func='SetFeeProtocol', args=f'[\"{feeA}\",\"{feeB}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - " \n", - " \n", - "gsa_msgs = pool_set_protocol_fee(gsa_msgs, ADDR_GSA, 6, 8)" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "id": "73e9e677-99c6-4f2a-b980-a91fb4e3d2cb", - "metadata": {}, - "outputs": [], - "source": [ - "def router_swap(msgs, caller, send, tokenIn, tokenOut, amountSpecified, swapType, strRoutes, strQuotes, swapResultLimit):\n", - " msg = t.substitute(caller=caller, send=send, pkg_path='gno.land/r/router', func='SwapRoute', args=f'[\"{tokenIn}\",\"{tokenOut}\",\"{amountSpecified}\",\"{swapType}\",\"{strRoutes}\",\"{strQuotes}\",\"{swapResultLimit}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - "\n", - " \n", - "tr01_msgs = router_swap(tr01_msgs, ADDR_TR01, \"\", \"gno.land/r/bar\", \"gno.land/r/baz\", 123456, \"EXACT_IN\", \"gno.land/r/bar:gno.land/r/baz:100\", \"100\", 200000)\n", - "tr01_msgs = router_swap(tr01_msgs, ADDR_TR01, \"100000000ugnot\", \"gnot\", \"gno.land/r/qux\", 987654, \"EXACT_OUT\", \"gnot:gno.land/r/bar:100*POOL*gno.land/r/bar:gno.land/r/baz:100*POOL*gno.land/r/baz:gno.land/r/qux:100,gnot:gno.land/r/bar:500*POOL*gno.land/r/bar:gno.land/r/baz:500*POOL*gno.land/r/baz:gno.land/r/qux:500\", \"40,60\", 654321)" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "id": "80075f54-d4f1-488c-a1d1-2e6fd83e508c", - "metadata": {}, - "outputs": [], - "source": [ - "def position_collect(msgs, caller, tokenId, recipient, amount0, amount1):\n", - " msg = t.substitute(caller=caller, send='', pkg_path='gno.land/r/position', func='Collect', args=f'[\"{tokenId}\",\"{recipient}\",\"{amount0}\",\"{amount1}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs\n", - " \n", - "\n", - "lp01_msgs = position_collect(lp01_msgs, ADDR_LP01, 1, ADDR_LP01, 1000000, 1000000)\n", - "lp01_msgs = position_collect(lp01_msgs, ADDR_LP02, 2, ADDR_LP01, 1000000, 1000000)" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "9a4bc660-4a16-4c5c-9487-70f7ee745517", - "metadata": {}, - "outputs": [], - "source": [ - "def staker_unstake(msgs, caller, tokenId):\n", - " msg = t.substitute(caller=caller, send='', pkg_path='gno.land/r/staker', func='UnstakeToken', args=f'[\"{tokenId}\"]')\n", - " msgs += msg\n", - " msgs += \",\"\n", - " \n", - " return msgs" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.10" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}