# Interoperability in NFT protocols

SPL404, based on Solana and distributed ledger technology, has partnered with Certus One, the main validator of Solana, to create Wormhole. Wormhole is a two-way, decentralized ERC-20⇄SPL token bridge that connects Ethereum and Solana. Wormhole does not have its own blockchain network but relies on the consensus and final confirmation of the two chains it bridges. Wormhole allows existing projects, platforms, and communities to seamlessly move tokens [across](coco://sendMessage?ext=%7B%22s%24wiki_link%22%3A%22https%3A%2F%2Fm.baike.com%2Fwikiid%2F8668098429104876578%22%7D\&msg=across) chains while taking full advantage of Solana's high speed and low transaction costs.\
Wormhole is a collaborative development of Solana and Certus.One, and it is now available online.\
Wormhole is a two-way cross-chain bridge between Ethereum and Solana, which allows users and applications to convert ERC20 tokens into SPL tokens of Solana for use in enriching the application scenarios of DeFi and improving [performance](coco://sendMessage?ext=%7B%22s%24wiki_link%22%3A%22https%3A%2F%2Fm.baike.com%2Fwikiid%2F9115905601271209895%22%7D\&msg=performance).\
The "trustless" bridge of Solana enables Ethereum's DeFi traders and applications to convert assets between the two chains and enjoy Solana's high tps and low transaction costs. Since Wormhole is a two-way bridge, users can also choose to have value return to the Ethereum network. Developers can take full advantage of the advantages of both chains without having to rewrite their Ethereum contracts or focus on a single blockchain when using the Wormhole protocol. If users need to withdraw their assets back to Ethereum, they can do so through Wormhole.\
Solana's Wormhole is dedicated to helping Ethereum alleviate DeFi congestion. However, other projects, such as encrypted games and payment services, can also use the Wormhole protocol to serve themselves.\
There are many ways to cross chains, but only those that are highly compatible and complex can make it easier for users to use.

## Environment Setup

* Node 16.14.1 or later, npm 8.5.0 or later: [https://docs.npmjs.com/downloading-and-installing-node-js-and-npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
* forge 0.2.0 or later: [https://book.getfoundry.sh/getting-started/installation](https://book.getfoundry.sh/getting-started/installation)

### Testing Locally <a href="#testing-locally" id="testing-locally"></a>

Pull the code down from github and cd into the directory, then build and test it.

```git
//git clone https://github.com/wormhole-foundation/hello-wormhole.git
cd hello-wormhole
npm run build
forge test
```

Expected output is

```git
Running 1 test for test/HelloWormhole.t.sol:HelloWormholeTest
[PASS] testGreeting() (gas: 777229)
Test result: ok. 1 passed; 0 failed; finished in 3.98s
```

## Explanation of the HelloWormhole Cross-chain Contract <a href="#explanation-of-the-hellowormhole-cross-chain-contract" id="explanation-of-the-hellowormhole-cross-chain-contract"></a>

```solidity
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

contract HelloWorld {
    event GreetingReceived(string greeting, address sender);

    string[] public greetings;

    /**
     * @notice Returns the cost (in wei) of a greeting
     */
    function quoteGreeting() public view returns (uint256 cost) {
        return 0;
    }

    /**
     * @notice Updates the list of 'greetings'
     * and emits a 'GreetingReceived' event with 'greeting'
     */
    function sendGreeting(
        string memory greeting
    ) public payable {
        uint256 cost = quoteGreeting();
        require(msg.value == cost);
        emit GreetingReceived(greeting, msg.sender);
        greetings.push(greeting);
    }
}
```

\
