Skip to content

loomnetwork/loom-examples

Repository files navigation

Loom Examples

This repository holds a few example projects:

  • Universal signing demo
  • Deposit and withdraw ETH between Ethereum and Basechain
  • Deposit and withdraw ERC20 tokens between Ethereum and Basechain
  • Deposit and withdraw TRX between Tron and Basechain
  • Deposit and withdraw BNB tokens between Binance chain and Basechain
  • Deposit and withdraw BEP2 tokens between Binance chain and Basechain
  • Move tokens between Binance chain, Basechain, and Ethereum

Universal signing demo

Install

npm install

Deploy to Extdev

First, let's generate your Loom private key by running:

npm run gen:loom-key

Then, we can migrate the the SimpleStore smart contract:

npm run migrate:loom

Start the webserver

npm run start

Open http://localhost:8080/ in your favorite browser.

Deposit and withdraw ETH between Ethereum and Basechain

Install

npm install

Start the webserver

npm run start

Open http://localhost:8080/ in your favorite browser.

Deposit and withdraw ERC20 tokens between Ethereum and Basechain

Install

npm install

Generate Loom private key

npm run gen:loom-key

Generate Rinkeby private key

npm run gen:rinkeby-key

Deploy to Loom

npm run migrate:loom

Set Infura API KEY

export INFURA_API_KEY=YOUR INFURA API KEY

Deploy to Rinkeby

First, get yourself some Ethers to pay for the deployment. Head over to this page and follow the instructions.

Next, just run:

npm run migrate:rinkeby

This will give all tokens to the address that deployed the contract. So, you either import this account in Metamask or transfer the newly minted tokens to your account.

Map Contracts

npm run map:contracts

Start the webserver

npm run start

Open http://localhost:8080/ in your favorite browser.

Deposit and withdraw ERC721 tokens between Ethereum and Basechain

Install

npm install

Generate Loom private key

npm run gen:loom-key

Generate Rinkeby private key

npm run gen:rinkeby-key

Deploy to Loom

npm run migrate:loom

Set Infura API KEY

export INFURA_API_KEY=YOUR INFURA API KEY

Deploy to Rinkeby

First, get yourself some Ethers to pay for the deployment. Head over to this page and follow the instructions.

Next, just run:

npm run migrate:rinkeby

This will mint a token and give it to the address that deployed the contract. So, you either import this account into Metamask or transfer the newly minted token to your account.

Map Contracts

npm run map:contracts

Start the webserver

npm run start

Open http://localhost:8080/ in your favorite browser.

Deposit and withdraw TRX between Tron and Basechain

See the Deposit and Withdraw TRX page for more details

Deposit and withdraw BNB tokens between Binance chain and Basechain

See the Deposit and Withdraw BNB page for more details.

Deposit and withdraw BEP2 tokens between Binance chain and Basechain

See the Deposit and Withdraw BEP2 page for instructions on how to run this demo.

Move Tokens between Binance, Loom, and Ethereum

See the Move Tokens between Binance, Loom, and Ethereum page for instructions on how to run this demo.