diff --git a/__local/test/launchpad_test.mk b/__local/test/launchpad_test.mk index 30e21701..86f7e5dc 100644 --- a/__local/test/launchpad_test.mk +++ b/__local/test/launchpad_test.mk @@ -8,6 +8,14 @@ ADDR_LP02 := g1ta0w7j4f586kwqu584z5h5sjurzywz3na7qg0a ADDR_TR01 := g14m6fj3t8005u77ku6zyzazq9vd9hwhl00ppt8j # use this as project's recipient for testing launchpad +# use this as project's recipient for testing launchpad +ADDR_QA01 := g1kcdd3n0d472g2p5l8svyg9t0wq6h5857nq992f +ADDR_QA02 := g1d598tyfatprdstalqutk62cnzpm3thvyy9mypg +ADDR_QA03 := g1w4qqmxdk59xsh3x5hnp2z78s4ymyva8pnenfem +ADDR_QA04 := g14supzhx0v5sza947sdh4x74wnws9xvcfwdecef +ADDR_QA05 := g1apl4u79zhexrxcf4h48y5qlyjncskdlrxtz6vg +ADDR_QA06 := g12g569s05c293zu2kxk0z426yylxmmthx8hcudd + ADDR_POOL := g126swhfaq2vyvvjywevhgw7lv9hg8qan93dasu8 ADDR_POSITION := g1vsm68lq9cpn7x507s6gh59anmx86kxfhzyszu2 ADDR_ROUTER := g1cnz5gm2l09pm2k6rknjjar9a2w53fdhk4yjzy5 @@ -31,11 +39,11 @@ TX_EXPIRE := 9999999999 MAKEFILE := $(shell realpath $(firstword $(MAKEFILE_LIST))) -GNOLAND_RPC_URL ?= http://localhost:26657 -CHAINID ?= dev +#GNOLAND_RPC_URL ?= http://localhost:26657 +#CHAINID ?= dev -# GNOLAND_RPC_URL ?= https://dev.rpc.gnoswap.io:443 -# CHAINID ?= dev.gnoswap +GNOLAND_RPC_URL ?= https://dev.rpc.gnoswap.io:443 +CHAINID ?= dev.gnoswap ROOT_DIR:=$(shell dirname $(MAKEFILE))/../../ @@ -390,10 +398,54 @@ gov-reconfigure: @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/gov/governance -func Reconfigure -args 123 -args 456 -args 789 -args 1234 -args 5678 -args 9012 -args 3456 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin @echo +## LAUNCHPAD QA +launchpad-qa: + ## APPROVE + @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/obl -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## CREATE PROJECT + $(info ************ create project // gnoswap_admin ************) + @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/launchpad -func CreateProject -args "gno.land/r/onbloc/obl" -args $(ADDR_QA01) -args 1000000000000 -args "" -args "" -args 50 -args 30 -args 20 -args 1728975600 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## APPROVE + @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/foo -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## CREATE PROJECT + $(info ************ create project // gnoswap_admin ************) + @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/launchpad -func CreateProject -args "gno.land/r/onbloc/foo" -args $(ADDR_QA02) -args 2000000000000 -args "" -args "" -args 50 -args 25 -args 25 -args 1728975600 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## APPROVE + @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/baz -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## CREATE PROJECT + $(info ************ create project // gnoswap_admin ************) + @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/launchpad -func CreateProject -args "gno.land/r/onbloc/baz" -args $(ADDR_QA03) -args 2500000000000 -args "" -args "" -args 60 -args 25 -args 15 -args 1728975600 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## APPROVE + @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/bar -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## CREATE PROJECT + $(info ************ create project // gnoswap_admin ************) + @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/launchpad -func CreateProject -args "gno.land/r/onbloc/bar" -args $(ADDR_QA04) -args 1000000000000 -args "" -args "" -args 40 -args 40 -args 20 -args 1728975600 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## APPROVE + @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/qux -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## CREATE PROJECT + $(info ************ create project // gnoswap_admin ************) + @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/launchpad -func CreateProject -args "gno.land/r/onbloc/qux" -args $(ADDR_QA05) -args 2000000000000 -args "" -args "" -args 50 -args 30 -args 20 -args 1729040400 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## APPROVE + @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/qux -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + + ## CREATE PROJECT + $(info ************ create project // gnoswap_admin ************) + @echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v2/launchpad -func CreateProject -args "gno.land/r/onbloc/qux" -args $(ADDR_QA06) -args 5000000000000 -args "gno.land/r/gnoswap/v2/gov/xgns*PAD*gno.land/r/onbloc/usdc" -args "100000000*PAD*200000000" -args 50 -args 30 -args 20 -args 1729047600 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin + ## LAUNCHPAD launchpad-create-project: - ## APPROVE + ## APPROVE @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/obl -func Approve -args $(ADDR_LAUNCHPAD) -args $(MAX_UINT64) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin ## CREATE PROJECT @@ -439,4 +491,4 @@ transfer-test1: @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/obl -func Transfer -args $(ADDR_TEST1) -args "1000000000" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/qux -func Transfer -args $(ADDR_TEST1) -args "1000000000" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin @echo "" | gnokey maketx call -pkgpath gno.land/r/onbloc/usdc -func Transfer -args $(ADDR_TEST1) -args "1000000000" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin - @echo "" \ No newline at end of file + @echo "" diff --git a/launchpad/launchpad_deposit.gno b/launchpad/launchpad_deposit.gno index f3fb7775..a7a32b09 100644 --- a/launchpad/launchpad_deposit.gno +++ b/launchpad/launchpad_deposit.gno @@ -398,7 +398,12 @@ func checkDepositConditions(project Project) { continue } else { // check balance - balance := balanceOfByRegisterCall(condition.tokenPath, std.PrevRealm().Addr()) + var balance uint64 + if condition.tokenPath == consts.GOV_XGNS_PATH { + balance = xgns.BalanceOf(a2u(std.PrevRealm().Addr())) + } else { + balance = balanceOfByRegisterCall(condition.tokenPath, std.PrevRealm().Addr()) + } if balance < condition.minAmount { panic(ufmt.Sprintf("insufficient balance(%d) for token(%s)", balance, condition.tokenPath)) } diff --git a/launchpad/launchpad_init.gno b/launchpad/launchpad_init.gno index c0311747..79e8898a 100644 --- a/launchpad/launchpad_init.gno +++ b/launchpad/launchpad_init.gno @@ -63,6 +63,9 @@ func CreateProject( if strings.Contains(conditionsToken, "*PAD*") { tokensToCheck := strings.Split(conditionsToken, "*PAD*") for _, token := range tokensToCheck { + if token == consts.GOV_XGNS_PATH { + continue + } if _, exist := registered[token]; !exist { panic(ufmt.Sprintf("condition token(%s) not registered", token)) }