This repository is designed as a starting point for users and builders alike to explore the new
Creditcoin cross-chain features brought forwards in the new USC Testnet update. Learn how to use
the Creditcoin Decentralized Oracle through a series of guided tutorials where you get to set up and
interact with your own decentralized bridge!
Before attempting any of the tutorials, make sure the following are installed and available in your system:
After that install the required dependencies to run the examples, to do so simply run the following command in the root of this repo:
yarnYou will also need to set up the right version of foundry with foundryup:
foundryup --version v1.2.3 # Skip this command if you are using nix!
Finally, source the .env file to load your configuration globally for all examples:
source .envThis ensures that all tutorial commands can access your wallet private key and RPC URLs without needing to manually substitute them.
Each tutorial is built to be as self-contained as possible. However, we still recommend you go through them in the following order:
Below is brief overview of each tutorial's content.
Learn how to use the Creditcoin Decentralized Oracle from the perspective of an end user. Hello Bridge makes use of pre-existing smart contracts on the Sepolia and Creditcoin Testnet so as to minimize the amount of setup needed.
Learn how to setup your own trustless cross-chain bridging logic by deploying your own contracts. Custom Contracts Bridging teaches you the perspective of a DApp builder by showing you how to set up custom logic across each chain you are deploying to.
Streamline UX by automating away most transactions in the bridging process. Bridge Offchain Worker shows you how offchain workers can be used to simplify the user flow of your cross-chain DApp.
Building on top of what we learned with the Bridge Offchain Worker we take it a step further by implementing a loaning system using both a USC contract, a source chain helper and an offchain worker to seamlesly coordinate between the two, and of course making use of our Oracle proving capabilities to add the final touches of trust into the process.