{"_id":"@aden79/xamppro","name":"@aden79/xamppro","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aden79/xamppro","version":"1.0.0","description":"Template project to start building IBC enabled Solidity contracts, with Hardhat and Foundry support","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/open-ibc/ibc-app-solidity-template.git"},"keywords":["IBC","Solidity"],"author":{"name":"Polymer Labs"},"license":"MIT","bugs":{"url":"https://github.com/open-ibc/ibc-app-solidity-template/issues"},"homepage":"https://github.com/open-ibc/ibc-app-solidity-template#readme","devDependencies":{"@nomicfoundation/hardhat-foundry":"^1.1.1","@nomicfoundation/hardhat-toolbox":"^4.0.0","hardhat":"^2.19.5"},"dependencies":{"@openzeppelin/contracts":"^4.7.6","axios":"^1.6.7","dotenv":"^16.4.1","hardhat-verify":"^1.0.0","mdnp":"^1.1.4","project-saya":"^1.0.0","xamppro":"^1.1.2"},"directories":{"lib":"lib"},"_id":"@aden79/xamppro@1.0.0","gitHead":"f369f9ed3931e8964254a32a999ee36b78a7585b","_nodeVersion":"20.12.2","_npmVersion":"10.7.0","dist":{"integrity":"sha512-Q4BvOHypq5cu8NiWdZAvriLq+aT7J0Lp/4WS4Dx98aBRXJeiBDYJLqjh903Nkbg171PEhfr6QM/bYhcTIBKfzA==","shasum":"e5f871e862698ad63f4256daf7233dd309a4b73d","tarball":"https://registry.npmjs.org/@aden79/xamppro/-/xamppro-1.0.0.tgz","fileCount":3935,"unpackedSize":75959039,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNO6mguiLnoXAoUmsdh2+djkyPNRj0p2fkFYQDydaxIAIhAMr84F+xFiFt/95Abu6x2pmu8UH+YI97vjqGcDxda4QJ"}]},"_npmUser":{"name":"aden79","email":"dedenles36@gmail.com"},"maintainers":[{"name":"aden79","email":"dedenles36@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xamppro_1.0.0_1714741469853_0.8556971936014721"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-03T13:04:29.738Z","1.0.0":"2024-05-03T13:04:30.489Z","modified":"2024-05-03T13:04:30.791Z"},"maintainers":[{"name":"aden79","email":"dedenles36@gmail.com"}],"description":"Template project to start building IBC enabled Solidity contracts, with Hardhat and Foundry support","homepage":"https://github.com/open-ibc/ibc-app-solidity-template#readme","keywords":["IBC","Solidity"],"repository":{"type":"git","url":"git+https://github.com/open-ibc/ibc-app-solidity-template.git"},"author":{"name":"Polymer Labs"},"bugs":{"url":"https://github.com/open-ibc/ibc-app-solidity-template/issues"},"license":"MIT","readme":"# ⛓️🔗⛓️ Template for IBC enabled Solidity contracts\n\nThis repo provides a starter project to build [IBC](https://github.com/cosmos/ibc) enabled Solidity contracts that connect rollups to one another Polymer Hub, through the [vIBC core contracts](https://github.com/open-ibc/vibc-core-smart-contracts).\n\nThe repository is a _GitHub template_ repository so you can click \"Use this template\" to create your own project repository without having the entire commit history of the template.\n\n![GitHub template](./img/gh_template.png)\n\n## 📚 Documentation\n\nThere's some basic information here in the README but a more comprehensive documentation can be found in [the official Polymer documentation](https://docs.polymerlabs.org/docs/category/build-ibc-dapps-1).\n\n## 📋 Prerequisites\n\nThe repo is **compatible with both Hardhat and Foundry** development environments.\n\n- Have [git](https://git-scm.com/downloads) installed\n- Have [node](https://nodejs.org) installed (v18+)\n- Have [Foundry](https://book.getfoundry.sh/getting-started/installation) installed (Hardhat will be installed when running `npm install`)\n- Have [just](https://just.systems/man/en/chapter_1.html) installed (recommended but not strictly necessary)\n\nYou'll need some API keys from third party's:\n- [Optimism Sepolia](https://optimism-sepolia.blockscout.com/account/api-key) and [Base Sepolia](https://base-sepolia.blockscout.com/account/api-key) Blockscout Explorer API keys\n- Have an [Alchemy API key](https://docs.alchemy.com/docs/alchemy-quickstart-guide) for OP and Base Sepolia\n\nSome basic knowledge of all of these tools is also required, although the details are abstracted away for basic usage.\n\n## 🧰 Install dependencies\n\nTo compile your contracts and start testing, make sure that you have all dependencies installed.\n\nFrom the root directory run:\n\n```bash\njust install\n```\n\nto install the [vIBC core smart contracts](https://github.com/open-ibc/vibc-core-smart-contracts) as a dependency.\n\nAdditionally Hardhat will be installed as a dev dependency with some useful plugins. Check `package.json` for an exhaustive list.\n\n## ⚙️ Set up your environment variables\n\nConvert the `.env.example` file into an `.env` file. This will ignore the file for future git commits as well as expose the environment variables. Add your private keys and update the other values if you want to customize (advanced usage feature).\n\n```bash\ncp .env.example .env\n```\n\nThis will enable you to sign transactions with your private key(s). If not added, the scripts from the justfile will fail.\n\n### Obtaining testnet ETH\n\nThe account associated with your private key must have both Base Sepolia and Optimism Sepolia ETH. To obtain the testnet ETH visit:\n\n- [Optimism Sepolia Faucet](https://www.alchemy.com/faucets/optimism-sepolia)\n- [Base Sepolia Faucet](https://www.alchemy.com/faucets/base-sepolia)\n\n## 🏃🏽🏃🏻‍♀️ Quickstart\n\nThe project comes with a built-in dummy application called x-counter. You can find the contracts in the `/contracts` directory as XCounterUC.sol and XCounter.sol (the former when using the universal channel, the latter when creating a custom IBC channel).\n\n### Custom IBC channel\n\nThe default setup (`.env`, `config.json`) are preconfigured to try to send packets over a custom channel.\n\nRun the following command to go through a full E2E sweep of the project:\n\n```bash\n# Usage: just do-it\njust do-it\n```\n\nIt does the following under the hood:\n```bash\n# Run the full E2E flow by setting the contracts, deploying them, creating a channel, and sending a packet\n# Usage: just do-it\ndo-it:\n    echo \"Running the full E2E flow...\"\n    just set-contracts optimism XCounter && just set-contracts base XCounter\n    just deploy optimism base false\n    just create-channel\n    just send-packet optimism false\n    echo \"You've done it!\"\n```\n\nIt makes sure you've got the correct contracts set, deploys new instances, creates a channel and sends a packet over the channel once created.\n\n> Note: by default the sim-client is used to improve latency. This is useful for iterative development and testing BUT also insecure as it involves no proofs. Make sure to move to the client **with proofs** by running another just command...\n\n```bash\n# Usage: just switch-client [universal=true]\njust switch-client false\n```\n\nCheck if the packet got through on the [Polymer IBC explorer](https://sepolia.polymer.zone/packets).\n\n### Universal channels\n\nSoon...\n\n<!-- TODO: add how to check for the packet on explorer or set up an event listener -->\n\n## 💻 Develop your custom application\n\nThe main work for you as a developer is to develop the contracts that make up your cross-chain logic.\n\nYou can use the contracts in the \"/contracts/base\" directory as base contracts for creating IBC enabled contracts that can either send packets over the universal channel or create their own channel to send packets over.\n\nA complete walkthrough on how to develop these contracts is provided in the [official Polymer documentation](https://docs.polymerlabs.org/docs/build/ibc-solidity/).\n\n## 🕹️ Interaction with the contracts\n\nWhen the contracts are ready, you can go ahead and interact with the contracts through scripts. There is a Justfile to for the most common commands, with the underlying scripts in the /scripts folder.\n\nThere's three types of default scripts in the project:\n\n- `_deploy.js` and `deploy-config.js` allow you to deploy your application contract\n- `_create-channel.js` and `create-channel-config.js` creates a channel\n- `send-packet.js` sends packets over an existing custom channel, and `send-universal-packet.js` is specifically for sending packets over a universal channel\n\nFor every script you'll find a field in the configuration file!!\n\n> **Note**: These are the default scripts provided. They provide the most generic interactions with the contracts to deploy, create channels and send packets. For more complicated use cases you will want to customize the scripts to your use case. See [advanced usage](#🦾-advanced-usage) for more info.\n\n### Deploy\n\nBefore deploying, make sure to update the config.json with your contract type to deploy for each of the chain you wish to deploy to.\n\nDo this by running:\n\n```bash\n# Usage: just set-contracts [chain] [contract_type]\njust set-contracts optimism MyContract\n```\n\nto deploy _MyContract_ artefact to the Optimism (Sepolia) chain.\n\nThen run:\n\n```bash\n# Usage: just deploy [source] [destination] [universal]\njust deploy optimism base true\n```\n\nfor an application that will use a universal channel, or:\n\n```bash\n# or\njust deploy optimism base false\n```\n\nfor an application that uses custom channels.\n\nThe script will take the output of the deployment and update the config file with all the relevant information.\n\nBefore moving on, you'll want to check if the variables in your .env and config files line up with what is stored in the actual deployed contracts... especially when you're actively playing around with different configuration files and contracts.\n\nTo do a sanity check, run:\n```bash\n# Usage: just sanity-check [universal=true]\njust sanity-check false\n```\nPick false for custom channels and true (or leave empty) for universal channels.\n\n### Create a channel\n\nIf you're **using universal channels, channel creation is not required**. Your contract will send and receive packet data from the Universal channel handler contract which already has a universal channel to send packets over. You can directly proceed to sending (universal) packets in that case.\n\nTo create a custom channel, run:\n\n```bash\njust create-channel\n```\n\nThis creates a channel between base and optimism. Note that the **ORDER MATTERS**; if you picked optimism as the source chain (first argument) above, by default it will create the channel from optimism and vice versa.\n\nThe script will take the output of the channel creation and update the config file with all the relevant information.\n\nCheck out the [channel tab in the explorer](https://explorer.prod.testnet.polymer.zone/channels) to find out if the correct channel-id's related to your contracts were updated in the config.\n\n### Send packets\n\nFinally Run:\n\n```bash\n# Usage: just send-packet [source] [universal]\njust send-packet optimism true\n```\n\nto send a packet over a **universal channel**. You can pick either optimism or base to send the packet from.\n\nOr run:\n\n```bash\njust send-packet optimism false\n```\n\nto send a packet over a **custom channel**. You can pick either optimism or base to send the packet from.\n\n## Verify, don't trust\n\n> Note: by default the sim-client is used to improve latency. This is useful for iterative development and testing BUT also insecure as it involves no proofs. Make sure to move to the client **with proofs** by running another just command...\n\n```bash\n# Usage: just switch-client [universal=true]\njust switch-client false\n```\n\nThis will use the op-stack client with proofs, making sure that the relayer is proving what is being submitted every step along the way, ensuring there's no trust assumption on the relayer.\n\n## 🦾 Advanced usage\n\nFor advanced users, there's multiple custimizations to follow. These includes configuring the config.json manually and/or running the scripts without using just.\n\nFor example, the last action to send a packet on a universal channel could be executed with this command:\n\n```bash\nnpx hardhat run scripts/send-universal-packet.js --network base\n```\n\nTo send a universal packet from the contract specified in the config.sendUniversalPacket field in the config.\n\n## 🤝 Contributing\n\nWe welcome and encourage contributions from our community! Here’s how you can contribute.\n\nTake a look at the open issues. If there's an issue that has the _help wanted_ label or _good first issue_, those are up for grabs. Assign yourself to the issue so people know you're working on it.\n\nAlternatively you can open an issue for a new idea or piece of feedback.\n\nWhen you want to contribute code, please follow these steps:\n\n1. **Fork the Repository:** Start by forking this repository.\n2. **Apply the improvements:** Want to optimize something or add support for additional developer tooling? Add your changes!\n3. **Create a Pull Request:** Once you're ready and have tested your added code, submit a PR to the repo and we'll review as soon as possible.\n\n## 💡 Questions or Suggestions?\n\nFeel free to open an issue for questions, suggestions, or discussions related to this repository. For further discussion as well as a showcase of some community projects, check out the [Polymer developer forum](https://forum.polymerlabs.org).\n\nThank you for being a part of our community!\n","readmeFilename":"README.md"}