Skip to content

Commit f5b33c6

Browse files
committed
remove unnecessary things
1 parent eb596b5 commit f5b33c6

File tree

5 files changed

+3
-35
lines changed

5 files changed

+3
-35
lines changed

launchpad/api_deposit.gno

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"std"
55
"strings"
66

7-
"gno.land/p/demo/json"
87
"gno.land/p/demo/ufmt"
98
)
109

launchpad/deposit.gno

-16
Original file line numberDiff line numberDiff line change
@@ -516,22 +516,6 @@ func checkDepositConditions(project Project) {
516516
}
517517
}
518518

519-
// Deprecated: use isProjectActive instead
520-
func checkProjectActive(project Project) bool {
521-
if project.started.height > uint64(std.GetHeight()) {
522-
// not started yet
523-
return false
524-
}
525-
526-
if project.ended.height < uint64(std.GetHeight()) {
527-
// already ended
528-
return false
529-
}
530-
531-
return true
532-
}
533-
534-
// Deprecated: use isTierActive instead
535519
func checkTierActive(project Project, tier Tier) bool {
536520
if tier.ended.height < uint64(std.GetHeight()) {
537521
return false

launchpad/launchpad.gno

+1-16
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ func validateProjectInput(input ProjectInput, now uint64) error {
7272
return nil
7373
}
7474

75-
// validateToken checks if the token is registered
76-
func validateToken(tokenPath string, registeredTokens []string) error {
77-
for _, regToken := range registeredTokens {
78-
if regToken == tokenPath {
79-
return nil
80-
}
81-
}
82-
return errors.New(ufmt.Sprintf("token(%s) not registered", tokenPath))
83-
}
84-
8575
// createTier creates a new tier with the given parameters
8676
func createTier(projectId string, duration uint64, amount uint64, startHeight uint64,
8777
startTime uint64, collectWaitDuration uint64) Tier {
@@ -118,10 +108,6 @@ func CreateProject(
118108
) string {
119109
common.IsHalted()
120110

121-
if err := common.SatisfyCond(isUserCall()); err != nil {
122-
panic(err)
123-
}
124-
125111
caller := std.PrevRealm().Addr()
126112
if err := common.AdminOnly(caller); err != nil {
127113
panic(err)
@@ -145,8 +131,7 @@ func CreateProject(
145131
panic(err)
146132
}
147133

148-
registered := common.ListRegisteredTokens()
149-
if err := validateToken(tokenPath, registered); err != nil {
134+
if err := common.IsRegistered(tokenPath); err != nil {
150135
panic(err)
151136
}
152137

launchpad/reward.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,6 @@ func calcDepositRatioX96(tierAmount uint64, amount uint64) *u256.Uint {
358358

359359
// calcProjectTiersRewardPerBlockX96 calculates the reward per block with Q96 precision
360360
func calcProjectTiersRewardPerBlockX96(tier Tier) *u256.Uint {
361-
tierAmountX96 := new(u256.Uint).Mul(u256.NewUint(tier.tierAmount), q96.Clone())
361+
tierAmountX96 := new(u256.Uint).Mul(u256.NewUint(tier.tierAmount), q96)
362362
return new(u256.Uint).Div(tierAmountX96, u256.NewUint(tier.ended.height-tier.started.height))
363363
}

launchpad/type.gno

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type Deposit struct {
7575
projectId string
7676
tier string // 30, 60, 180 // instead of tierId
7777
depositor std.Address
78-
// amount uint64
78+
amount uint64
7979

8080
depositHeight uint64
8181
depositTime uint64

0 commit comments

Comments
 (0)