types

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZeroInt    = uint64(0)
	DefaultInt = int64(-1)

	NbAccountAssetsPerAccount = 2
	NbAccountsPerTx           = 4
	NbGasAssetsPerTx          = 2 // at most two assets transferred to gas account

	NbRoots = 2 // account root, nft root

	PubDataSizePerTx = 6

	OfferSizePerAsset = 128

	ChainId = 1
)
View Source
const (
	TxTypeEmptyTx = iota
	TxTypeRegisterZns
	TxTypeDeposit
	TxTypeDepositNft
	TxTypeTransfer
	TxTypeWithdraw
	TxTypeCreateCollection
	TxTypeMintNft
	TxTypeTransferNft
	TxTypeAtomicMatch
	TxTypeCancelOffer
	TxTypeWithdrawNft
	TxTypeFullExit
	TxTypeFullExitNft
)
View Source
const (
	TxTypeBitsSize              = 8
	CollectionIdBitsSize        = 16
	OfferIdBitsSize             = 24
	FeeRateBitsSize             = 16
	AccountIndexBitsSize        = 32
	AssetIdBitsSize             = 16
	NftIndexBitsSize            = 40
	CreatorTreasuryRateBitsSize = 16
	StateAmountBitsSize         = 128
	PackedAmountBitsSize        = 40
	PackedFeeBitsSize           = 16
	AddressBitsSize             = 160
)
View Source
const (
	RateBase = 10000
)

Variables

View Source
var (
	EmptyAssetRoot, _ = new(big.Int).SetString("1852795521510493758870271888468603317521451107904460550484580901924342463446", 10)
)

Functions

func CheckEmptyAccountNode

func CheckEmptyAccountNode(api API, flag Variable, account AccountConstraints)

func CheckEmptyNftNode

func CheckEmptyNftNode(api API, flag Variable, nft NftConstraints)

func CheckNonEmptyAccountNode added in v0.0.7

func CheckNonEmptyAccountNode(api API, flag Variable, account AccountConstraints)

func EmptySignature

func EmptySignature() (sig *eddsa.Signature)

func IsVariableDifferent added in v0.0.7

func IsVariableDifferent(api API, isEnabled, i1, i2 Variable)

func IsVariableEqual

func IsVariableEqual(api API, isEnabled, i1, i2 Variable)

func IsVariableLess

func IsVariableLess(api API, isEnabled, i1, i2 Variable)

func IsVariableLessOrEqual

func IsVariableLessOrEqual(api API, isEnabled, i1, i2 Variable)

func Keccak256

func Keccak256(_ ecc.ID, inputs []*big.Int, outputs []*big.Int) error

func SetPubKeyWitness

func SetPubKeyWitness(pk *eddsa.PublicKey) (witness eddsaConstraints.PublicKey)

func SetSignatureWitness

func SetSignatureWitness(sig *oEddsa.Signature) (witness eddsa.Signature)

func VerifyEddsaSig

func VerifyEddsaSig(flag Variable, api API, hFunc MiMC, hashVal Variable, pk PublicKeyConstraints, sig eddsa.Signature) error

func VerifyMerkleProof

func VerifyMerkleProof(api API, isEnabled Variable, h MiMC, merkleRoot Variable, node Variable, proofSet, helper []Variable)

VerifyMerkleProof: takes a Merkle root, a proofSet, and a proofIndex and returns

true if the first element of the proof set is a leaf of data in the Merkle
root. False is returned if the proof set or Merkle root is nil, and if
'numLeaves' equals 0.

Types

type API

type API = frontend.API

type Account

type Account struct {
	AccountIndex    int64
	AccountNameHash []byte
	AccountPk       *eddsa.PublicKey
	Nonce           int64
	CollectionNonce int64
	AssetRoot       []byte
	AssetsInfo      [NbAccountAssetsPerAccount]*AccountAsset
}

func EmptyAccount

func EmptyAccount(accountIndex int64, assetRoot []byte) *Account

type AccountAsset

type AccountAsset struct {
	AssetId                  int64
	Balance                  *big.Int
	OfferCanceledOrFinalized *big.Int
}

func EmptyAccountAsset

func EmptyAccountAsset(assetId int64) *AccountAsset

type AccountAssetConstraints

type AccountAssetConstraints struct {
	AssetId                  Variable
	Balance                  Variable
	OfferCanceledOrFinalized Variable
}

func SetAccountAssetWitness

func SetAccountAssetWitness(asset *AccountAsset) (witness AccountAssetConstraints, err error)

type AccountConstraints

type AccountConstraints struct {
	AccountIndex    Variable
	AccountNameHash Variable
	AccountPk       eddsa.PublicKey
	Nonce           Variable
	CollectionNonce Variable
	AssetRoot       Variable
	// at most 4 assets changed in one transaction
	AssetsInfo [NbAccountAssetsPerAccount]AccountAssetConstraints
}

func SetAccountWitness

func SetAccountWitness(account *Account) (witness AccountConstraints, err error)

SetAccountWitness: set account witness

type AtomicMatchTx

type AtomicMatchTx struct {
	AccountIndex      int64
	BuyOffer          *OfferTx
	SellOffer         *OfferTx
	CreatorAmount     int64
	TreasuryAmount    int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount int64
}

type AtomicMatchTxConstraints

type AtomicMatchTxConstraints struct {
	AccountIndex      Variable
	BuyOffer          OfferTxConstraints
	SellOffer         OfferTxConstraints
	CreatorAmount     Variable
	TreasuryAmount    Variable
	GasAccountIndex   Variable
	GasFeeAssetId     Variable
	GasFeeAssetAmount Variable
}

func EmptyAtomicMatchTxWitness

func EmptyAtomicMatchTxWitness() (witness AtomicMatchTxConstraints)

func SetAtomicMatchTxWitness

func SetAtomicMatchTxWitness(tx *AtomicMatchTx) (witness AtomicMatchTxConstraints)

type CancelOfferTx

type CancelOfferTx struct {
	AccountIndex      int64
	OfferId           int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount int64
}

type CancelOfferTxConstraints

type CancelOfferTxConstraints struct {
	AccountIndex      Variable
	OfferId           Variable
	GasAccountIndex   Variable
	GasFeeAssetId     Variable
	GasFeeAssetAmount Variable
}

func EmptyCancelOfferTxWitness

func EmptyCancelOfferTxWitness() (witness CancelOfferTxConstraints)

func SetCancelOfferTxWitness

func SetCancelOfferTxWitness(tx *CancelOfferTx) (witness CancelOfferTxConstraints)

type CreateCollectionTx

type CreateCollectionTx struct {
	AccountIndex      int64
	CollectionId      int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount int64
	ExpiredAt         int64
	Nonce             int64
}

type CreateCollectionTxConstraints

type CreateCollectionTxConstraints struct {
	AccountIndex      Variable
	CollectionId      Variable
	GasAccountIndex   Variable
	GasFeeAssetId     Variable
	GasFeeAssetAmount Variable
	ExpiredAt         Variable
	Nonce             Variable
}

func EmptyCreateCollectionTxWitness

func EmptyCreateCollectionTxWitness() (witness CreateCollectionTxConstraints)

func SetCreateCollectionTxWitness

func SetCreateCollectionTxWitness(tx *CreateCollectionTx) (witness CreateCollectionTxConstraints)

type DepositNftTx

type DepositNftTx struct {
	AccountIndex        int64
	NftIndex            int64
	NftL1Address        string
	AccountNameHash     []byte
	NftContentHash      []byte
	NftL1TokenId        *big.Int
	CreatorAccountIndex int64
	CreatorTreasuryRate int64
	CollectionId        int64
}

type DepositNftTxConstraints

type DepositNftTxConstraints struct {
	AccountIndex        Variable
	AccountNameHash     Variable
	NftIndex            Variable
	NftContentHash      Variable
	NftL1Address        Variable
	NftL1TokenId        Variable
	CreatorAccountIndex Variable
	CreatorTreasuryRate Variable
	CollectionId        Variable
}

func EmptyDepositNftTxWitness

func EmptyDepositNftTxWitness() (witness DepositNftTxConstraints)

func SetDepositNftTxWitness

func SetDepositNftTxWitness(tx *DepositNftTx) (witness DepositNftTxConstraints)

type DepositTx

type DepositTx struct {
	AccountIndex    int64
	AccountNameHash []byte
	AssetId         int64
	AssetAmount     *big.Int
}

type DepositTxConstraints

type DepositTxConstraints struct {
	AccountIndex    Variable
	AccountNameHash Variable
	AssetId         Variable
	AssetAmount     Variable
}

func EmptyDepositTxWitness

func EmptyDepositTxWitness() (witness DepositTxConstraints)

func SetDepositTxWitness

func SetDepositTxWitness(tx *DepositTx) (witness DepositTxConstraints)

type FullExitNftTx

type FullExitNftTx struct {
	AccountIndex           int64
	AccountNameHash        []byte
	CreatorAccountIndex    int64
	CreatorAccountNameHash []byte
	CreatorTreasuryRate    int64
	NftIndex               int64
	CollectionId           int64
	NftContentHash         []byte
	NftL1Address           string
	NftL1TokenId           *big.Int
}

type FullExitNftTxConstraints

type FullExitNftTxConstraints struct {
	AccountIndex           Variable
	AccountNameHash        Variable
	CreatorAccountIndex    Variable
	CreatorAccountNameHash Variable
	CreatorTreasuryRate    Variable
	NftIndex               Variable
	CollectionId           Variable
	NftContentHash         Variable
	NftL1Address           Variable
	NftL1TokenId           Variable
}

func EmptyFullExitNftTxWitness

func EmptyFullExitNftTxWitness() (witness FullExitNftTxConstraints)

func SetFullExitNftTxWitness

func SetFullExitNftTxWitness(tx *FullExitNftTx) (witness FullExitNftTxConstraints)

type FullExitTx

type FullExitTx struct {
	AccountIndex    int64
	AccountNameHash []byte
	AssetId         int64
	AssetAmount     *big.Int
}

type FullExitTxConstraints

type FullExitTxConstraints struct {
	AccountIndex    Variable
	AccountNameHash Variable
	AssetId         Variable
	AssetAmount     Variable
}

func EmptyFullExitTxWitness

func EmptyFullExitTxWitness() (witness FullExitTxConstraints)

func SetFullExitTxWitness

func SetFullExitTxWitness(tx *FullExitTx) (witness FullExitTxConstraints)

type GasAccount added in v0.0.7

type GasAccount struct {
	AccountIndex    int64
	AccountNameHash []byte
	AccountPk       *eddsa.PublicKey
	Nonce           int64
	CollectionNonce int64
	AssetRoot       []byte
	AssetsInfo      []*AccountAsset
}

func EmptyGasAccount added in v0.0.7

func EmptyGasAccount(accountIndex int64, assetRoot []byte) *GasAccount

type MiMC

type MiMC = mimc.MiMC

type MintNftTx

type MintNftTx struct {
	CreatorAccountIndex int64
	ToAccountIndex      int64
	ToAccountNameHash   []byte
	NftIndex            int64
	NftContentHash      []byte
	CreatorTreasuryRate int64
	GasAccountIndex     int64
	GasFeeAssetId       int64
	GasFeeAssetAmount   int64
	CollectionId        int64
	ExpiredAt           int64
}

type MintNftTxConstraints

type MintNftTxConstraints struct {
	CreatorAccountIndex Variable
	ToAccountIndex      Variable
	ToAccountNameHash   Variable
	NftIndex            Variable
	NftContentHash      Variable
	CreatorTreasuryRate Variable
	GasAccountIndex     Variable
	GasFeeAssetId       Variable
	GasFeeAssetAmount   Variable
	CollectionId        Variable
	ExpiredAt           Variable
}

func EmptyMintNftTxWitness

func EmptyMintNftTxWitness() (witness MintNftTxConstraints)

func SetMintNftTxWitness

func SetMintNftTxWitness(tx *MintNftTx) (witness MintNftTxConstraints)

type Nft

type Nft struct {
	NftIndex            int64
	NftContentHash      []byte
	CreatorAccountIndex int64
	OwnerAccountIndex   int64
	NftL1Address        *big.Int
	NftL1TokenId        *big.Int
	CreatorTreasuryRate int64
	CollectionId        int64
}

func EmptyNft

func EmptyNft(nftIndex int64) *Nft

type NftConstraints

type NftConstraints struct {
	NftIndex            Variable
	NftContentHash      Variable
	CreatorAccountIndex Variable
	OwnerAccountIndex   Variable
	NftL1Address        Variable
	NftL1TokenId        Variable
	CreatorTreasuryRate Variable
	CollectionId        Variable
}

func SetNftWitness

func SetNftWitness(nft *Nft) (witness NftConstraints, err error)

SetNftWitness: set nft witness

type OfferTx

type OfferTx struct {
	Type         int64
	OfferId      int64
	AccountIndex int64
	NftIndex     int64
	AssetId      int64
	AssetAmount  int64
	ListedAt     int64
	ExpiredAt    int64
	TreasuryRate int64
	Sig          *oEddsa.Signature
}

type OfferTxConstraints

type OfferTxConstraints struct {
	Type         Variable
	OfferId      Variable
	AccountIndex Variable
	NftIndex     Variable
	AssetId      Variable
	AssetAmount  Variable
	ListedAt     Variable
	ExpiredAt    Variable
	TreasuryRate Variable
	Sig          eddsa.Signature
}

func EmptyOfferTxWitness

func EmptyOfferTxWitness() (witness OfferTxConstraints)

func SetOfferTxWitness

func SetOfferTxWitness(tx *OfferTx) (witness OfferTxConstraints)

type PublicKey

type PublicKey = eddsa.PublicKey

type PublicKeyConstraints

type PublicKeyConstraints = eddsaConstraints.PublicKey

func EmptyPublicKeyWitness

func EmptyPublicKeyWitness() (witness PublicKeyConstraints)

type RegisterZnsTx

type RegisterZnsTx struct {
	AccountIndex    int64
	AccountName     []byte
	AccountNameHash []byte
	PubKey          *eddsa.PublicKey
}

type RegisterZnsTxConstraints

type RegisterZnsTxConstraints struct {
	AccountIndex    Variable
	AccountName     Variable
	AccountNameHash Variable
	PubKey          PublicKeyConstraints
}

func EmptyRegisterZnsTxWitness

func EmptyRegisterZnsTxWitness() (witness RegisterZnsTxConstraints)

func SetRegisterZnsTxWitness

func SetRegisterZnsTxWitness(tx *RegisterZnsTx) (witness RegisterZnsTxConstraints)

type TransferNftTx

type TransferNftTx struct {
	FromAccountIndex  int64
	ToAccountIndex    int64
	ToAccountNameHash []byte
	NftIndex          int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount int64
	CallDataHash      []byte
}

type TransferNftTxConstraints

type TransferNftTxConstraints struct {
	FromAccountIndex  Variable
	ToAccountIndex    Variable
	ToAccountNameHash Variable
	NftIndex          Variable
	GasAccountIndex   Variable
	GasFeeAssetId     Variable
	GasFeeAssetAmount Variable
	CallDataHash      Variable
}

func EmptyTransferNftTxWitness

func EmptyTransferNftTxWitness() (witness TransferNftTxConstraints)

func SetTransferNftTxWitness

func SetTransferNftTxWitness(tx *TransferNftTx) (witness TransferNftTxConstraints)

type TransferTx

type TransferTx struct {
	FromAccountIndex  int64
	ToAccountIndex    int64
	ToAccountNameHash []byte
	AssetId           int64
	AssetAmount       int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount int64
	CallDataHash      []byte
}

type TransferTxConstraints

type TransferTxConstraints struct {
	FromAccountIndex  Variable
	ToAccountIndex    Variable
	ToAccountNameHash Variable
	AssetId           Variable
	AssetAmount       Variable
	GasAccountIndex   Variable
	GasFeeAssetId     Variable
	GasFeeAssetAmount Variable
	CallDataHash      Variable
}

func EmptyTransferTxWitness

func EmptyTransferTxWitness() (witness TransferTxConstraints)

func SetTransferTxWitness

func SetTransferTxWitness(tx *TransferTx) (witness TransferTxConstraints)

type Variable

type Variable = frontend.Variable

func CollectPubDataFromAtomicMatch

func CollectPubDataFromAtomicMatch(api API, txInfo AtomicMatchTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromCancelOffer

func CollectPubDataFromCancelOffer(api API, txInfo CancelOfferTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromCreateCollection

func CollectPubDataFromCreateCollection(api API, txInfo CreateCollectionTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromDeposit

func CollectPubDataFromDeposit(api API, txInfo DepositTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromDepositNft

func CollectPubDataFromDepositNft(api API, txInfo DepositNftTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromFullExit

func CollectPubDataFromFullExit(api API, txInfo FullExitTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromFullExitNft

func CollectPubDataFromFullExitNft(api API, txInfo FullExitNftTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromMintNft

func CollectPubDataFromMintNft(api API, txInfo MintNftTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromRegisterZNS

func CollectPubDataFromRegisterZNS(api API, txInfo RegisterZnsTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromTransfer

func CollectPubDataFromTransfer(api API, txInfo TransferTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromTransferNft

func CollectPubDataFromTransferNft(api API, txInfo TransferNftTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromWithdraw

func CollectPubDataFromWithdraw(api API, txInfo WithdrawTxConstraints) (pubData [PubDataSizePerTx]Variable)

func CollectPubDataFromWithdrawNft

func CollectPubDataFromWithdrawNft(api API, txInfo WithdrawNftTxConstraints) (pubData [PubDataSizePerTx]Variable)

func ComputeHashFromAtomicMatchTx

func ComputeHashFromAtomicMatchTx(api API, tx AtomicMatchTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromCancelOfferTx

func ComputeHashFromCancelOfferTx(api API, tx CancelOfferTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromCreateCollectionTx

func ComputeHashFromCreateCollectionTx(api API, tx CreateCollectionTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromMintNftTx

func ComputeHashFromMintNftTx(api API, tx MintNftTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromOfferTx

func ComputeHashFromOfferTx(api API, tx OfferTxConstraints, hFunc MiMC) (hashVal Variable)

func ComputeHashFromTransferNftTx

func ComputeHashFromTransferNftTx(api API, tx TransferNftTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromTransferTx

func ComputeHashFromTransferTx(api API, tx TransferTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromWithdrawNftTx

func ComputeHashFromWithdrawNftTx(api API, tx WithdrawNftTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func ComputeHashFromWithdrawTx

func ComputeHashFromWithdrawTx(api API, tx WithdrawTxConstraints, nonce Variable, expiredAt Variable, hFunc MiMC) (hashVal Variable)

func Max

func Max(api API, a, b Variable) Variable

func Min

func Min(api API, a, b Variable) Variable

func PackInt64Variables added in v0.0.7

func PackInt64Variables(api API, inputs ...Variable) Variable

func UnpackAmount

func UnpackAmount(api API, packedAmount Variable) Variable

func UnpackFee

func UnpackFee(api API, packedFee Variable) Variable

func UpdateMerkleProof

func UpdateMerkleProof(api API, h MiMC, node Variable, proofSet, helper []Variable) (root Variable)

func VerifyAtomicMatchTx

func VerifyAtomicMatchTx(
	api API, flag Variable,
	tx *AtomicMatchTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
	nftBefore NftConstraints,
	blockCreatedAt Variable,
	hFunc MiMC,
) (pubData [PubDataSizePerTx]Variable, err error)

func VerifyCancelOfferTx

func VerifyCancelOfferTx(
	api API, flag Variable,
	tx *CancelOfferTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyCreateCollectionTx

func VerifyCreateCollectionTx(
	api API, flag Variable,
	tx *CreateCollectionTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyDepositNftTx

func VerifyDepositNftTx(
	api API,
	flag Variable,
	tx DepositNftTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
	nftBefore NftConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyDepositTx

func VerifyDepositTx(
	api API, flag Variable,
	tx DepositTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyFullExitNftTx

func VerifyFullExitNftTx(
	api API, flag Variable,
	tx FullExitNftTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints, nftBefore NftConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyFullExitTx

func VerifyFullExitTx(
	api API, flag Variable,
	tx FullExitTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyMintNftTx

func VerifyMintNftTx(
	api API, flag Variable,
	tx *MintNftTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints, nftBefore NftConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyRegisterZNSTx

func VerifyRegisterZNSTx(
	api API, flag Variable,
	tx RegisterZnsTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyTransferNftTx

func VerifyTransferNftTx(
	api API,
	flag Variable,
	tx *TransferNftTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
	nftBefore NftConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyTransferTx

func VerifyTransferTx(
	api API, flag Variable,
	tx *TransferTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyWithdrawNftTx

func VerifyWithdrawNftTx(
	api API,
	flag Variable,
	tx *WithdrawNftTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
	nftBefore NftConstraints,
) (pubData [PubDataSizePerTx]Variable)

func VerifyWithdrawTx

func VerifyWithdrawTx(
	api API, flag Variable,
	tx *WithdrawTxConstraints,
	accountsBefore [NbAccountsPerTx]AccountConstraints,
) (pubData [PubDataSizePerTx]Variable)

type WithdrawNftTx

type WithdrawNftTx struct {
	AccountIndex           int64
	CreatorAccountIndex    int64
	CreatorAccountNameHash []byte
	CreatorTreasuryRate    int64
	NftIndex               int64
	NftContentHash         []byte
	NftL1Address           string
	NftL1TokenId           *big.Int
	ToAddress              string
	GasAccountIndex        int64
	GasFeeAssetId          int64
	GasFeeAssetAmount      int64
	CollectionId           int64
}

type WithdrawNftTxConstraints

type WithdrawNftTxConstraints struct {
	AccountIndex           Variable
	CreatorAccountIndex    Variable
	CreatorAccountNameHash Variable
	CreatorTreasuryRate    Variable
	NftIndex               Variable
	NftContentHash         Variable
	NftL1Address           Variable
	NftL1TokenId           Variable
	ToAddress              Variable
	GasAccountIndex        Variable
	GasFeeAssetId          Variable
	GasFeeAssetAmount      Variable
	CollectionId           Variable
}

func EmptyWithdrawNftTxWitness

func EmptyWithdrawNftTxWitness() (witness WithdrawNftTxConstraints)

func SetWithdrawNftTxWitness

func SetWithdrawNftTxWitness(tx *WithdrawNftTx) (witness WithdrawNftTxConstraints)

type WithdrawTx

type WithdrawTx struct {
	FromAccountIndex  int64
	AssetId           int64
	AssetAmount       *big.Int
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount int64
	ToAddress         *big.Int
}

type WithdrawTxConstraints

type WithdrawTxConstraints struct {
	FromAccountIndex  Variable
	AssetId           Variable
	AssetAmount       Variable
	GasAccountIndex   Variable
	GasFeeAssetId     Variable
	GasFeeAssetAmount Variable
	ToAddress         Variable
}

func EmptyWithdrawTxWitness

func EmptyWithdrawTxWitness() (witness WithdrawTxConstraints)

func SetWithdrawTxWitness

func SetWithdrawTxWitness(tx *WithdrawTx) (witness WithdrawTxConstraints)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL