_setup() :
This function sets up the contract by decoding the parameters passed in and assigning them to the chainName variable. It also checks to make sure that the chainName variable has not already been initialized, and if it has, it reverts the transaction. (autogenerated documentation)
sendNFT(address,uint256,string,address) :
This function allows a user to send an NFT (Non-Fungible Token) from one chain to another. It first checks if the operator is the same as the address of the contract. If it is, it checks that the sender is the owner of the token, and then calls the _sendMintedToken function to send the token to the destination chain. If the operator is not the same as the address of the contract, it calls the IERC721 transferFrom function to transfer the token from the sender to the contract, and then calls the _sendNativeToken function to send the token to the destination chain. (autogenerated documentation)
_sendMintedToken(uint256,string,address) :
This function is used to send a token from one blockchain to another. It takes in three parameters: the token ID, the destination chain, and the destination address. It first burns the token on the original chain, then it encodes the original chain, the operator, the original token ID, and the destination address into a payload. It then calls the gasService to pay for the contract call, and finally calls the gateway contract with the payload. (autogenerated documentation)
_sendNativeToken(address,uint256,string,address) :
This function is used to send a native token from one chain to another. It takes in four parameters: the address of the operator, the token ID, the destination chain, and the destination address. It then encodes the chain name, operator address, token ID, and destination address into a payload. It then calls the gasService contract to pay for the contract call, and then calls the gateway contract with the payload. The gateway contract will then send the native token to the destination address on the destination chain. (autogenerated documentation)
_execute(string,string) :
This function is used to transfer a token from one chain to another. It takes in a calldata, source address, and payload as parameters. The payload contains the original chain name, the operator address, and the token ID. The function first checks if the original chain name is the same as the current chain name. If it is, it calls the IERC721 transferFrom function to transfer the token from the current address to the destination address. If the original chain name is different, it creates a new token ID by hashing the original chain name, operator address, and token ID. It then stores the original data in the original mapping and calls the _safeMint function to mint the token to the destination address. (autogenerated documentation)
contractId() :
This function returns a bytes32 value that is the result of the keccak256 hashing algorithm applied to the string 'example'. The keccak256 algorithm is a cryptographic hashing algorithm that takes an input of any length and produces a fixed-length output. This output is a unique identifier that can be used to identify the input data. In this case, the output is a bytes32 value that can be used to uniquely identify the string 'example'. (autogenerated documentation)