Documentation
¶
Index ¶
- type AccountKeeper
- type InterClass
- type InterNftKeeper
- func (ik InterNftKeeper) Burn(ctx sdk.Context, classID string, tokenID string) error
- func (ik InterNftKeeper) CreateOrUpdateClass(ctx sdk.Context, classID, classURI, classData string) error
- func (ik InterNftKeeper) GetClass(ctx sdk.Context, classID string) (nfttransfer.Class, bool)
- func (ik InterNftKeeper) GetNFT(ctx sdk.Context, classID, tokenID string) (nfttransfer.NFT, bool)
- func (ik InterNftKeeper) GetOwner(ctx sdk.Context, classID string, tokenID string) sdk.AccAddress
- func (ik InterNftKeeper) HasClass(ctx sdk.Context, classID string) bool
- func (ik InterNftKeeper) IsConvertedNFT(ctx sdk.Context, classID, nftID string) bool
- func (ik InterNftKeeper) Logger(ctx sdk.Context) log.Logger
- func (ik InterNftKeeper) Mint(ctx sdk.Context, classID, tokenID, tokenURI, tokenData string, ...) error
- func (ik InterNftKeeper) Transfer(ctx sdk.Context, classID, tokenID, tokenData string, receiver sdk.AccAddress) error
- type InterToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
// Set an account in the store.
SetAccount(context.Context, sdk.AccountI)
GetModuleAddress(name string) sdk.AccAddress
}
AccountKeeper defines the contract required for account APIs.
type InterClass ¶
func (InterClass) GetData ¶
func (d InterClass) GetData() string
func (InterClass) GetID ¶
func (d InterClass) GetID() string
func (InterClass) GetURI ¶
func (d InterClass) GetURI() string
type InterNftKeeper ¶
type InterNftKeeper struct {
// contains filtered or unexported fields
}
InterNftKeeper defines the ICS721 Keeper
func NewInterNftKeeper ¶
func NewInterNftKeeper(cdc codec.Codec, k nftkeeper.Keeper, ak AccountKeeper, ) InterNftKeeper
NewInterNftKeeper creates a new ics721 Keeper instance
func (InterNftKeeper) Burn ¶
Burn implement the method of ICS721Keeper.Burn
Fault-tolerant on missing NFTs (matches x/erc721 and x/cw721 RefundPacketToken): if the NFT is already gone, skipping keeps the IBC refund path alive instead of rolling back the whole cache context.
A bound NFT is refused. nft-transfer reaches this method through the ICS721Keeper interface, so it does not pass through x/collection.RemoveNFT, which is where the conversion guard normally lives; without this check the ICS-721 path would destroy the native half of a converted NFT and leave the escrowed contract half with no on-chain record of its existence -- "undiscoverable and unrecoverable", in x/erc721's own words. The checker is injected by app/keepers (see SetConvertedNFTChecker).
This does NOT restrict ordinary ICS-721 traffic. Only the destroy branch calls Burn: nft-transfer picks escrow or destroy from IsAwayFromOrigin (nft-transfer keeper/relay.go:238-248), and the class a conversion produces is always "uptick-<contract>" (x/erc721 and x/cw721 both pin it in Register*), which never carries a "<port>/<channel>/" prefix -- so the outbound transfer of a converted NFT always escrows. A genuine voucher being returned to its origin chain also arrives here with no pair recorded, so it is released by the same check. (R1-C: ibc voucher classes are barred from pair registration, and legacy ibc-class pairs are settled at the v0.5.0 upgrade height; the earlier claim that "pairs are only ever written for uptick-<contract> classes" was false and is what let a convert-memo voucher pair lock its NFT out of the origin chain.)
The absence check is a plain HasNFT read on purpose. An earlier version wrapped it in a blanket recover(), which swallowed every panic — including the SDK gas meter's OutOfGas and store/runtime panics — and then reported the burn as successful with reason "nft_already_gone". That silently turned a failed transaction into a successful ICS-721 burn, so the recover() was removed: only a genuine HasNFT == false may skip, everything else must propagate.
func (InterNftKeeper) CreateOrUpdateClass ¶
func (ik InterNftKeeper) CreateOrUpdateClass(ctx sdk.Context, classID, classURI, classData string, ) error
CreateOrUpdateClass implement the method of ICS721Keeper.CreateOrUpdateClass
func (InterNftKeeper) GetClass ¶
func (ik InterNftKeeper) GetClass(ctx sdk.Context, classID string) (nfttransfer.Class, bool)
GetClass implement the method of ICS721Keeper.GetClass
func (InterNftKeeper) GetNFT ¶
func (ik InterNftKeeper) GetNFT(ctx sdk.Context, classID, tokenID string) (nfttransfer.NFT, bool)
GetNFT implement the method of ICS721Keeper.GetNFT
func (InterNftKeeper) GetOwner ¶
func (ik InterNftKeeper) GetOwner(ctx sdk.Context, classID string, tokenID string) sdk.AccAddress
GetOwner implement the method of ICS721Keeper.GetOwner
func (InterNftKeeper) HasClass ¶
func (ik InterNftKeeper) HasClass(ctx sdk.Context, classID string) bool
HasClass implement the method of ICS721Keeper.HasClass
func (InterNftKeeper) IsConvertedNFT ¶ added in v0.5.0
func (ik InterNftKeeper) IsConvertedNFT(ctx sdk.Context, classID, nftID string) bool
IsConvertedNFT reports whether the native NFT has a contract-side counterpart, i.e. whether destroying it would strand the escrowed contract half.
It delegates to the collection keeper's guard, which the application wires once x/erc721 and x/cw721 exist (collectionkeeper.SetConvertedNFTChecker). The copy of the collection keeper held here shares the guard's slot, so that later wiring reaches this adapter too -- see the field comment in interface.go and Keeper.convertedNFTs.
func (InterNftKeeper) Logger ¶
func (ik InterNftKeeper) Logger(ctx sdk.Context) log.Logger
Logger returns a module-specific logger.
func (InterNftKeeper) Mint ¶
func (ik InterNftKeeper) Mint(ctx sdk.Context, classID, tokenID, tokenURI, tokenData string, receiver sdk.AccAddress, ) error
Mint implement the method of ICS721Keeper.Mint
func (InterNftKeeper) Transfer ¶
func (ik InterNftKeeper) Transfer( ctx sdk.Context, classID, tokenID, tokenData string, receiver sdk.AccAddress, ) error
Transfer implement the method of ICS721Keeper.Transfer
type InterToken ¶
func (InterToken) GetClassID ¶
func (t InterToken) GetClassID() string
func (InterToken) GetData ¶
func (t InterToken) GetData() string
func (InterToken) GetID ¶
func (t InterToken) GetID() string
func (InterToken) GetURI ¶
func (t InterToken) GetURI() string