Documentation ¶
Index ¶
- Variables
- func ERC20ExternalNativeTokensAddress(nativeTokenID iotago.NativeTokenID, isTaken func(common.Address) bool) (common.Address, error)
- func ERC20NativeTokensAddress(foundrySN uint32) common.Address
- func ERC20NativeTokensFoundrySN(addr common.Address) (uint32, error)
- func ERC721NFTCollectionAddress(collectionID iotago.NFTID) common.Address
- type IRC27NFT
- type IRC27NFTMetadata
- type ISCAgentID
- type ISCAssets
- type ISCChainID
- type ISCDict
- type ISCDictItem
- type ISCExpiration
- type ISCNFT
- type ISCRequestID
- type ISCSendMetadata
- type ISCSendOptions
- type ISCTokenProperties
- type L1Address
- type NFTID
- type NativeToken
- type NativeTokenID
Constants ¶
This section is empty.
Variables ¶
var ( AddressPrefix = []byte{0x10, 0x74} Address = packMagicAddress(addressKindISCMagic, nil) )
var ( //go:embed ISCSandbox.abi SandboxABI string //go:embed ISCUtil.abi UtilABI string //go:embed ISCAccounts.abi AccountsABI string //go:embed ISCPrivileged.abi PrivilegedABI string )
var ( //go:embed ERC20BaseTokens.abi ERC20BaseTokensABI string ERC20BaseTokensRuntimeBytecode = common.FromHex(strings.TrimSpace(erc20BaseRuntimeBytecodeHex)) ERC20BaseTokensAddress = packMagicAddress(addressKindERC20BaseTokens, nil) )
var ( //go:embed ERC20NativeTokens.abi ERC20NativeTokensABI string ERC20NativeTokensRuntimeBytecode = common.FromHex(strings.TrimSpace(erc20NativeTokensRuntimeBytecodeHex)) )
var ( //go:embed ERC20ExternalNativeTokens.abi ERC20ExternalNativeTokensABI string ERC20ExternalNativeTokensRuntimeBytecode = common.FromHex(strings.TrimSpace(erc20ExternalNativeTokensRuntimeBytecodeHex)) )
Functions ¶
func ERC20ExternalNativeTokensAddress ¶ added in v1.0.3
func ERC20ExternalNativeTokensAddress( nativeTokenID iotago.NativeTokenID, isTaken func(common.Address) bool, ) (common.Address, error)
ERC20ExternalNativeTokensAddress creates an Ethereum address for an ERC20 contract for native tokens with an off-chain foundry. NOTE: since len(NativeTokenID) == 38 and len(Address) == 20, it is not possible to assign a unique address to every native token. This function tries to form the ERC20 address from the first 17 bytes of hash(nativeTokenID). In case of a collision, it reapplies the hash and checks for a collision again, repeating until it gives up.
func ERC20NativeTokensAddress ¶ added in v1.0.3
ERC20NativeTokensAddress returns the Ethereum address of the ERC20 contract for native tokens with an on-chain foundry.
func ERC20NativeTokensFoundrySN ¶ added in v1.0.3
Types ¶
type IRC27NFT ¶ added in v1.0.3
type IRC27NFT struct { Nft ISCNFT Metadata IRC27NFTMetadata }
IRC27NFT matches the struct definition in ISCTypes.sol
type IRC27NFTMetadata ¶ added in v1.0.3
type IRC27NFTMetadata struct { Standard string Version string MimeType string Uri string //nolint:revive // false positive Name string Description string }
IRC27NFTMetadata matches the struct definition in ISCTypes.sol
func WrapIRC27NFTMetadata ¶ added in v1.0.3
func WrapIRC27NFTMetadata(m *isc.IRC27NFTMetadata) IRC27NFTMetadata
type ISCAgentID ¶
type ISCAgentID struct {
Data []byte
}
ISCAgentID matches the struct definition in ISCTypes.sol
func WrapISCAgentID ¶
func WrapISCAgentID(a isc.AgentID) ISCAgentID
func (ISCAgentID) MustUnwrap ¶
func (a ISCAgentID) MustUnwrap() isc.AgentID
type ISCAssets ¶ added in v1.0.3
type ISCAssets struct { BaseTokens uint64 NativeTokens []NativeToken Nfts []NFTID }
ISCAssets matches the struct definition in ISCTypes.sol
func WrapISCAssets ¶ added in v1.0.3
type ISCChainID ¶
type ISCChainID [isc.ChainIDLength]byte
ISCChainID matches the type definition in ISCTypes.sol
func WrapISCChainID ¶
func WrapISCChainID(c isc.ChainID) (ret ISCChainID)
func (ISCChainID) MustUnwrap ¶
func (c ISCChainID) MustUnwrap() isc.ChainID
type ISCDict ¶
type ISCDict struct {
Items []ISCDictItem
}
ISCDict matches the struct definition in ISCTypes.sol
func WrapISCDict ¶
type ISCDictItem ¶
ISCDictItem matches the struct definition in ISCTypes.sol
type ISCExpiration ¶
func (*ISCExpiration) Unwrap ¶
func (i *ISCExpiration) Unwrap() *isc.Expiration
type ISCNFT ¶
type ISCNFT struct { ID NFTID Issuer L1Address Metadata []byte Owner ISCAgentID }
ISCNFT matches the struct definition in ISCTypes.sol
func WrapISCNFT ¶
func (ISCNFT) MustUnwrap ¶
type ISCRequestID ¶ added in v1.0.3
type ISCRequestID struct {
Data []byte
}
ISCRequestID matches the struct definition in ISCTypes.sol
func WrapISCRequestID ¶ added in v1.0.3
func WrapISCRequestID(rid isc.RequestID) ISCRequestID
func (ISCRequestID) MustUnwrap ¶ added in v1.0.3
func (rid ISCRequestID) MustUnwrap() isc.RequestID
type ISCSendMetadata ¶
type ISCSendMetadata struct { TargetContract uint32 Entrypoint uint32 Params ISCDict Allowance ISCAssets GasBudget uint64 }
func WrapISCSendMetadata ¶
func WrapISCSendMetadata(metadata isc.SendMetadata) ISCSendMetadata
func (ISCSendMetadata) Unwrap ¶
func (i ISCSendMetadata) Unwrap() *isc.SendMetadata
type ISCSendOptions ¶
type ISCSendOptions struct { Timelock int64 Expiration ISCExpiration }
func (*ISCSendOptions) Unwrap ¶
func (i *ISCSendOptions) Unwrap() isc.SendOptions
type ISCTokenProperties ¶ added in v0.3.4
type L1Address ¶
type L1Address struct {
Data []byte
}
L1Address matches the struct definition in ISCTypes.sol
func WrapL1Address ¶
func (L1Address) MustUnwrap ¶
type NFTID ¶
type NFTID [iotago.NFTIDLength]byte
NFTID matches the type definition in ISCTypes.sol
type NativeToken ¶
type NativeToken struct { ID NativeTokenID Amount *big.Int }
NativeToken matches the struct definition in ISCTypes.sol
func WrapNativeToken ¶
func WrapNativeToken(nativeToken *iotago.NativeToken) NativeToken
func (NativeToken) Unwrap ¶
func (nt NativeToken) Unwrap() *iotago.NativeToken
type NativeTokenID ¶
type NativeTokenID struct {
Data []byte
}
NativeTokenID matches the struct definition in ISCTypes.sol
func WrapNativeTokenID ¶
func WrapNativeTokenID(nativeTokenID iotago.NativeTokenID) NativeTokenID
func (NativeTokenID) MustUnwrap ¶ added in v1.0.3
func (a NativeTokenID) MustUnwrap() (ret iotago.NativeTokenID)
func (NativeTokenID) Unwrap ¶
func (a NativeTokenID) Unwrap() (ret iotago.NativeTokenID)