Skip to content

Commit

Permalink
update dynamic esdts
Browse files Browse the repository at this point in the history
  • Loading branch information
BeniaminDrasovean committed Nov 6, 2023
1 parent fd0a900 commit eaf054b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,17 @@ const MetaESDT = "MetaESDT"
// SemiFungibleESDT defines the string for the token type of semi fungible ESDT
const SemiFungibleESDT = "SemiFungibleESDT"

// Dynamic is the prefix used for dynamic ESDT tokens
const Dynamic = "Dynamic"

// DynamicNFTESDT defines the string for the token type of dynamic NFT ESDT
const DynamicNFTESDT = "DynamicNFTESDT"
const DynamicNFTESDT = Dynamic + NonFungibleESDT

// DynamicSFTESDT defines the string for the token type of dynamic SFT ESDT
const DynamicSFTESDT = "DynamicSFTESDT"
const DynamicSFTESDT = Dynamic + SemiFungibleESDT

// DynamicMetaESDT defines the string for the token type of dynamic meta ESDT
const DynamicMetaESDT = "DynamicMetaESDT"
const DynamicMetaESDT = Dynamic + MetaESDT

// MaxRoyalty defines 100% as uint32
const MaxRoyalty = uint32(10000)
Expand Down
5 changes: 5 additions & 0 deletions core/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,8 @@ func ConvertESDTTypeToUint32(esdtType string) (uint32, error) {
return math.MaxUint32, fmt.Errorf("invalid esdt type: %s", esdtType)
}
}

// IsDynamicESDT returns true if the esdt type is dynamic
func IsDynamicESDT(esdtType uint32) bool {
return esdtType == uint32(DynamicNFT) || esdtType == uint32(DynamicSFT) || esdtType == uint32(DynamicMeta)
}

0 comments on commit eaf054b

Please sign in to comment.