Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/spf13/viper v1.20.1
github.com/vultisig/commondata v0.0.0-20250710214228-61d9ed8f7778
github.com/vultisig/mobile-tss-lib v0.0.0-20250316003201-2e7e570a4a74
github.com/vultisig/recipes v0.0.0-20250729120802-9b1d07f8262a
github.com/vultisig/recipes v0.0.0-20250805093243-2060ffd4754e
github.com/vultisig/verifier v0.0.0-20250731092019-00d44a4b02b9
github.com/vultisig/vultiserver v0.0.0-20250715212748-4b23f9849e4b
golang.org/x/sync v0.14.0
Expand Down
10 changes: 8 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,14 @@ github.com/vultisig/go-wrappers v0.0.0-20250403041248-86911e8aa33f h1:124Xlloih1
github.com/vultisig/go-wrappers v0.0.0-20250403041248-86911e8aa33f/go.mod h1:UfGCxUQW08kiwxyNBiHwXe+ePPuBmHVVS+BS51aU/Jg=
github.com/vultisig/mobile-tss-lib v0.0.0-20250316003201-2e7e570a4a74 h1:goqwk4nQ/NEVIb3OPP9SUx7/u9ZfsUIcd5fIN/e4DVU=
github.com/vultisig/mobile-tss-lib v0.0.0-20250316003201-2e7e570a4a74/go.mod h1:nOykk4nOy1L3yXtLSlYvVsgizBnCQ3tR2N5uwGPdvaM=
github.com/vultisig/recipes v0.0.0-20250729120802-9b1d07f8262a h1:KoAwytLj092KNgWHh0a5tcupsSm5HtentT0yUbDGWFQ=
github.com/vultisig/recipes v0.0.0-20250729120802-9b1d07f8262a/go.mod h1:Ot3lrUnnSw67Hep+MelclVPgNLDxJP01Ezixw/1RYRE=
github.com/vultisig/recipes v0.0.0-20250804144750-c21977a17e72 h1:Vypx8sZVTbF7GIaTU9VJt3rY35OdI36ZeWIT6GF09Sk=
github.com/vultisig/recipes v0.0.0-20250804144750-c21977a17e72/go.mod h1:Ot3lrUnnSw67Hep+MelclVPgNLDxJP01Ezixw/1RYRE=
github.com/vultisig/recipes v0.0.0-20250804165337-98ae4a2efa18 h1:zEPPC4TE+CJhVPFhTzFFCIHXpa91sMn30tFzYLGP1UE=
github.com/vultisig/recipes v0.0.0-20250804165337-98ae4a2efa18/go.mod h1:Ot3lrUnnSw67Hep+MelclVPgNLDxJP01Ezixw/1RYRE=
github.com/vultisig/recipes v0.0.0-20250804215735-744a9a61f45c h1:942aary32eEcYuXcUURUDUsKWLYgoTjxjDC5VtozdM0=
github.com/vultisig/recipes v0.0.0-20250804215735-744a9a61f45c/go.mod h1:Ot3lrUnnSw67Hep+MelclVPgNLDxJP01Ezixw/1RYRE=
github.com/vultisig/recipes v0.0.0-20250805093243-2060ffd4754e h1:RhIQVc28MzLWsE7Fn0KsltSr+00ESc1eKKNUHcLgFB4=
github.com/vultisig/recipes v0.0.0-20250805093243-2060ffd4754e/go.mod h1:Ot3lrUnnSw67Hep+MelclVPgNLDxJP01Ezixw/1RYRE=
github.com/vultisig/verifier v0.0.0-20250731092019-00d44a4b02b9 h1:j4duFCHur0x8vtAh3YHcwmRZKqMwcEkl/u7wjOBrMbc=
github.com/vultisig/verifier v0.0.0-20250731092019-00d44a4b02b9/go.mod h1:nFUize5jJAi5P7V0dloNUB+ykJZvgNe4S80h6uAA9SQ=
github.com/vultisig/vultiserver v0.0.0-20250715212748-4b23f9849e4b h1:Ed2DOWo8fA0KG6e36rzUmGpxcOQjmWTbxWyvUbI5by8=
Expand Down
50 changes: 1 addition & 49 deletions plugin/dca/dca.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,53 +772,5 @@ func (p *DCAPlugin) completePolicy(ctx context.Context, policy vtypes.PluginPoli
}

func (p *DCAPlugin) GetRecipeSpecification() (*rtypes.RecipeSchema, error) {
return &rtypes.RecipeSchema{
Version: 1, // Schema version
ScheduleVersion: 1, // Schedule specification version
PluginId: string(vtypes.PluginVultisigDCA_0000),
PluginName: "Dollar-Cost Averaging",
PluginVersion: 1, // Convert from "0.0.1" to int32
SupportedResources: []*rtypes.ResourcePattern{
{
ResourcePath: &rtypes.ResourcePath{
ChainId: "ethereum",
ProtocolId: "uniswap",
FunctionId: "swap",
Full: "ethereum.uniswap.swap",
},
ParameterCapabilities: []*rtypes.ParameterConstraintCapability{
{
ParameterName: "source_token",
SupportedTypes: []rtypes.ConstraintType{
rtypes.ConstraintType_CONSTRAINT_TYPE_FIXED,
rtypes.ConstraintType_CONSTRAINT_TYPE_WHITELIST,
},
Required: true,
},
{
ParameterName: "destination_token",
SupportedTypes: []rtypes.ConstraintType{
rtypes.ConstraintType_CONSTRAINT_TYPE_FIXED,
rtypes.ConstraintType_CONSTRAINT_TYPE_WHITELIST,
},
Required: true,
},
{
ParameterName: "amount",
SupportedTypes: []rtypes.ConstraintType{
rtypes.ConstraintType_CONSTRAINT_TYPE_FIXED,
rtypes.ConstraintType_CONSTRAINT_TYPE_MAX,
rtypes.ConstraintType_CONSTRAINT_TYPE_RANGE,
},
Required: true,
},
},
Required: true,
},
},
Requirements: &rtypes.PluginRequirements{
MinVultisigVersion: 1,
SupportedChains: []string{"ethereum"},
},
}, nil
return &rtypes.RecipeSchema{}, nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't make sense to apply new changes in DCA, it will be completely reworked

}
33 changes: 11 additions & 22 deletions plugin/fees/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ func (fp *FeePlugin) GetRecipeSpecification() (*rtypes.RecipeSchema, error) {
}

return &rtypes.RecipeSchema{
Version: 1, // Schema version
ScheduleVersion: 1, // Schedule specification version
PluginId: vtypes.PluginVultisigFees_feee.String(),
PluginName: "Fee Plugin",
PluginVersion: 1,
Version: 1, // Schema version
PluginId: vtypes.PluginVultisigFees_feee.String(),
PluginName: "Fee Plugin",
PluginVersion: 1,
SupportedResources: []*rtypes.ResourcePattern{
{
ResourcePath: &rtypes.ResourcePath{
Expand All @@ -46,27 +45,17 @@ func (fp *FeePlugin) GetRecipeSpecification() (*rtypes.RecipeSchema, error) {
FunctionId: "transfer",
Full: "ethereum.erc20.transfer",
},
Target: rtypes.TargetType_TARGET_TYPE_ADDRESS,
ParameterCapabilities: []*rtypes.ParameterConstraintCapability{
{
ParameterName: "recipient",
SupportedTypes: []rtypes.ConstraintType{
rtypes.ConstraintType_CONSTRAINT_TYPE_MAGIC_CONSTANT,
},
Required: true,
ParameterName: "recipient",
SupportedTypes: rtypes.ConstraintType_CONSTRAINT_TYPE_MAGIC_CONSTANT,
Required: true,
},
{
ParameterName: "amount",
SupportedTypes: []rtypes.ConstraintType{
rtypes.ConstraintType_CONSTRAINT_TYPE_MAX,
},
Required: true,
},
{
ParameterName: "token",
SupportedTypes: []rtypes.ConstraintType{
rtypes.ConstraintType_CONSTRAINT_TYPE_FIXED,
},
Required: true,
ParameterName: "amount",
SupportedTypes: rtypes.ConstraintType_CONSTRAINT_TYPE_MAX,
Required: true,
},
},
Required: true,
Expand Down
26 changes: 4 additions & 22 deletions plugin/fees/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"fmt"
"math/big"
"strconv"
"strings"

"github.com/google/uuid"
"github.com/vultisig/mobile-tss-lib/tss"
"github.com/vultisig/plugin/common"
"github.com/vultisig/recipes/chain"
rcommon "github.com/vultisig/recipes/common"
"github.com/vultisig/recipes/engine"
reth "github.com/vultisig/recipes/ethereum"
resolver "github.com/vultisig/recipes/resolver"
Expand Down Expand Up @@ -78,12 +77,6 @@ func (fp *FeePlugin) ProposeTransactions(policy vtypes.PluginPolicy) ([]vtypes.P
}
magicConstantRecipientValue = rtypes.MagicConstant(iv)
}
if constraint.ParameterName == "token" {
if constraint.Constraint.Type != rtypes.ConstraintType_CONSTRAINT_TYPE_FIXED {
return nil, fmt.Errorf("token constraint is not a fixed value")
}
token = constraint.Constraint.GetFixedValue()
}
}
default:
return nil, fmt.Errorf("unsupported rule: %v", rule.Id)
Expand Down Expand Up @@ -217,27 +210,16 @@ func (fp *FeePlugin) ValidateProposedTransactions(policy vtypes.PluginPolicy, tx
// Validate each proposed transaction
for _, tx := range txs {
for _, keysignMessage := range tx.Messages {
// Get the chain for the transaction
messageChain, err := chain.GetChain(strings.ToLower(keysignMessage.Chain.String()))
txBytes, err := base64.StdEncoding.DecodeString(keysignMessage.Message)
if err != nil {
return fmt.Errorf("failed to get chain: %w", err)
}

// Parse the transaction to validate its structure
decodedTx, err := messageChain.ParseTransaction(keysignMessage.Message)
if err != nil {
return fmt.Errorf("failed to parse transaction: %w", err)
return fmt.Errorf("failed to decode transaction: %w", err)
}

// Evaluate if the transaction is allowed by the policy
transactionAllowed, _, err := eng.Evaluate(recipe, messageChain, decodedTx)
_, err = eng.Evaluate(recipe, rcommon.Chain(keysignMessage.Chain), txBytes)
if err != nil {
return fmt.Errorf("failed to evaluate transaction: %w", err)
}

if !transactionAllowed {
return fmt.Errorf("transaction %s on %s not allowed by policy", keysignMessage.Hash, keysignMessage.Chain)
}
}
}

Expand Down
19 changes: 5 additions & 14 deletions plugin/payroll/policy.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package payroll

import (
"encoding/base64"
"fmt"
"strings"

"github.com/vultisig/recipes/chain"
rcommon "github.com/vultisig/recipes/common"
"github.com/vultisig/recipes/engine"
"github.com/vultisig/verifier/plugin"
vtypes "github.com/vultisig/verifier/types"
Expand All @@ -25,24 +25,15 @@ func (p *Plugin) ValidateProposedTransactions(policy vtypes.PluginPolicy, txs []

for _, tx := range txs {
for _, keysignMessage := range tx.Messages {
messageChain, err := chain.GetChain(strings.ToLower(keysignMessage.Chain.String()))
txBytes, err := base64.StdEncoding.DecodeString(keysignMessage.Message)
if err != nil {
return fmt.Errorf("failed to get chain: %w", err)
return fmt.Errorf("failed to decode transaction: %w", err)
}

decodedTx, err := messageChain.ParseTransaction(keysignMessage.Message)
if err != nil {
return fmt.Errorf("failed to parse transaction: %w", err)
}

transactionAllowed, _, err := eng.Evaluate(recipe, messageChain, decodedTx)
_, err = eng.Evaluate(recipe, rcommon.Chain(keysignMessage.Chain), txBytes)
if err != nil {
return fmt.Errorf("failed to evaluate transaction: %w", err)
}

if !transactionAllowed {
return fmt.Errorf("transaction %s on %s not allowed by policy", keysignMessage.Hash, keysignMessage.Chain)
}
}
}

Expand Down
Loading