Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion account/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const (
)

var (
DefaultNewCurrencyPurchaseAmount = ocp_common.ToCoreMintQuarks(20)
DefaultNewCurrencyPurchaseAmount = ocp_common.ToCoreMintQuarks(5)
DefaultNewCurrencyFeeAmount = ocp_common.ToCoreMintQuarks(15)
)

var (
Expand Down Expand Up @@ -238,6 +239,7 @@ func (s *Server) GetUserFlags(ctx context.Context, req *accountpb.GetUserFlagsRe
MinBuildNumber: uint32(minBuildNumber),
BillExchangeDataTimeout: durationpb.New(defaultBillExchangeDataTimeout),
NewCurrencyPurchaseAmount: DefaultNewCurrencyPurchaseAmount,
NewCurrencyFeeAmount: DefaultNewCurrencyFeeAmount,
},
}, nil
}
Expand Down Expand Up @@ -268,6 +270,7 @@ func (s *Server) GetUnauthenticatedUserFlags(ctx context.Context, req *accountpb
PreferredOnRampProvider: preferredOnRampProviderForUser,
MinBuildNumber: uint32(minBuildNumber),
NewCurrencyPurchaseAmount: DefaultNewCurrencyPurchaseAmount,
NewCurrencyFeeAmount: DefaultNewCurrencyFeeAmount,
},
}, nil
}
Expand Down
13 changes: 11 additions & 2 deletions antispam/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,19 @@ func (i *Integration) AllowDistribution(_ context.Context, _ *ocp_common.Account
return true, "", nil
}

func (i *Integration) AllowSwap(_ context.Context, _ swap.FundingSource, _, _, _ *ocp_common.Account, amount uint64, initializesMint bool) (bool, string, error) {
if initializesMint && amount != account.DefaultNewCurrencyPurchaseAmount {
func (i *Integration) AllowSwap(_ context.Context, _ swap.FundingSource, _, _, _ *ocp_common.Account, swapAmount, feeAmount uint64, initializesMint bool) (bool, string, error) {
if !initializesMint {
return true, "", nil
}

if swapAmount != account.DefaultNewCurrencyPurchaseAmount {
return false, "invalid initial purchase amount for currency launch", nil
}

if feeAmount != account.DefaultNewCurrencyFeeAmount {
return false, "invalid fee amount for currency launch", nil
}

return true, "", nil
}

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.26.0
require (
firebase.google.com/go/v4 v4.18.0
github.com/ReneKroon/ttlcache v1.7.0
github.com/code-payments/flipcash2-protobuf-api v1.2.1-0.20260410155215-c85f2e8a4169
github.com/code-payments/ocp-protobuf-api v1.8.1
github.com/code-payments/ocp-server v1.7.0
github.com/code-payments/flipcash2-protobuf-api v1.3.0
github.com/code-payments/ocp-protobuf-api v1.9.0
github.com/code-payments/ocp-server v1.10.0
github.com/devsisters/go-applereceipt v0.0.0-20240805020915-fa22a0160fc2
github.com/georgysavva/scany/v2 v2.1.4
github.com/google/uuid v1.6.0
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ github.com/cockroachdb/cockroach-go/v2 v2.2.0 h1:/5znzg5n373N/3ESjHF5SMLxiW4RKB0
github.com/cockroachdb/cockroach-go/v2 v2.2.0/go.mod h1:u3MiKYGupPPjkn3ozknpMUpxPaNLTFWAya419/zv6eI=
github.com/code-payments/code-vm-indexer v1.2.0 h1:rSHpBMiT9BKgmKcXg/VIoi/h0t7jNxGx07Qz59m+6Q0=
github.com/code-payments/code-vm-indexer v1.2.0/go.mod h1:vn91YN2qNqb+gGJeZe2+l+TNxVmEEiRHXXnIn2Y40h8=
github.com/code-payments/flipcash2-protobuf-api v1.2.1-0.20260410155215-c85f2e8a4169 h1:BRLsHqck5Vf69cclP/lHO7p72dZ9EY52VumPNxVZ7Pg=
github.com/code-payments/flipcash2-protobuf-api v1.2.1-0.20260410155215-c85f2e8a4169/go.mod h1:s/1pOsb4FTRD+LcvRKGjfmm6ygRS/m1ep34EIW0fuDs=
github.com/code-payments/ocp-protobuf-api v1.8.1 h1:IaCVADbbTUtZwf0Rk8Pf8PygsancuOXc+A3CcTG/74w=
github.com/code-payments/ocp-protobuf-api v1.8.1/go.mod h1:tw6BooY5a8l6CtSZnKOruyKII0W04n89pcM4BizrgG8=
github.com/code-payments/ocp-server v1.7.0 h1:oKrwXWWvoDzTm4V4qiN6YXzHy8aAoMW07ruRDudg2r0=
github.com/code-payments/ocp-server v1.7.0/go.mod h1:bYRKFaawR3PubHMMSkjsIhN3ayf3ZRxqxF/VZ2PNt9g=
github.com/code-payments/flipcash2-protobuf-api v1.3.0 h1:HdMO6uXEmroFW++7YTxkQxbnroUdfhjsO43yJVacQ0U=
github.com/code-payments/flipcash2-protobuf-api v1.3.0/go.mod h1:s/1pOsb4FTRD+LcvRKGjfmm6ygRS/m1ep34EIW0fuDs=
github.com/code-payments/ocp-protobuf-api v1.9.0 h1:VpcOENVTmebpTENhpVaDbFfPPliK1zuMtjHzdhBQY2U=
github.com/code-payments/ocp-protobuf-api v1.9.0/go.mod h1:tw6BooY5a8l6CtSZnKOruyKII0W04n89pcM4BizrgG8=
github.com/code-payments/ocp-server v1.10.0 h1:BKBYqfrQmmMORTVoQn0Qym5B6eb6G792qM+mnG1UWsc=
github.com/code-payments/ocp-server v1.10.0/go.mod h1:tk3LabRL/iRP3C6iImbW5B7oC3ceGRqtmVhkFlqOHZA=
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
Expand Down
Loading