Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multi-chain payment abi #896

Merged
merged 3 commits into from
Jan 17, 2025
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
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/vault/api v1.14.0
github.com/hashicorp/vault/api/auth/userpass v0.7.0
github.com/iden3/contracts-abi/multi-chain-payment/go/abi v0.0.0-20250116162607-8fec43acf817
github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0
github.com/iden3/contracts-abi/state/go/abi v1.0.2-0.20230911112726-4533c5701af1
github.com/iden3/driver-did-iden3 v0.0.7
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/iden3/contracts-abi/multi-chain-payment/go/abi v0.0.0-20250116162607-8fec43acf817 h1:xuYOzprI4R11ty8CpFAO8cmsDpLpMBkTaAo4Jb640Po=
github.com/iden3/contracts-abi/multi-chain-payment/go/abi v0.0.0-20250116162607-8fec43acf817/go.mod h1:T3jzISOZAzewRmzTxzGzj91V8MP+usTdPYbRE68hLyA=
github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0 h1:Fu1/tAINi9FzZ0nKoEVOGXWzL1l15tR1loJx5sQEQ8k=
github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0/go.mod h1:8fkd2xyUG/V7ovpvZRyD2LyK2zZ4ALbgf5vJGyhzKdg=
github.com/iden3/contracts-abi/rhs-storage/go/abi v0.0.0-20231006141557-7d13ef7e3c48 h1:/g4rru+OM5WAhVNXEpowKH+vWZLGjgpk5+O8Stu4QBo=
Expand Down
5 changes: 3 additions & 2 deletions internal/core/services/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/signer/core/apitypes"
"github.com/google/uuid"
abi "github.com/iden3/contracts-abi/multi-chain-payment/go/abi"
core "github.com/iden3/go-iden3-core/v2"
"github.com/iden3/go-iden3-core/v2/w3c"
comm "github.com/iden3/iden3comm/v2"
Expand Down Expand Up @@ -256,7 +257,7 @@ func (p *payment) VerifyPayment(ctx context.Context, issuerDID w3c.DID, nonce *b
return ports.BlockchainPaymentStatusPending, fmt.Errorf("failed to get ethereum client from resolvers settings for key <%s>", paymentReqItem.SigningKeyID)
}

instance, err := eth.NewPaymentContract(setting.PaymentRails, client.GetEthereumClient())
instance, err := abi.NewMCPayment(setting.PaymentRails, client.GetEthereumClient())
if err != nil {
return ports.BlockchainPaymentStatusPending, err
}
Expand All @@ -277,7 +278,7 @@ func (p *payment) VerifyPayment(ctx context.Context, issuerDID w3c.DID, nonce *b
func (p *payment) verifyPaymentOnBlockchain(
ctx context.Context,
client *eth.Client,
contract *eth.PaymentContract,
contract *abi.MCPayment,
signerAddress common.Address,
nonce *big.Int,
txID *string,
Expand Down
Loading
Loading