xdapp-book/projects/xmint
diop 0a51e176fd move core bridge address to constructor 2022-12-06 14:47:56 +00:00
..
chains move core bridge address to constructor 2022-12-06 14:47:56 +00:00
deployinfo adding gitkeep to keep deployinfo folder around 2022-08-14 19:28:54 -06:00
handlers buy token on sol <> evm working but evm sends 1/100 of the tokens back, unsure why 2022-09-26 03:41:00 -05:00
keypairs pushing to mvp 2022-08-23 13:06:01 -05:00
tests buy token on sol <> evm working but evm sends 1/100 of the tokens back, unsure why 2022-09-26 03:41:00 -05:00
.gitignore
README.md Add setup instructions for xmint (#19) 2022-10-13 10:27:06 -05:00
interfaces.ts
orchestrator.ts buy token on sol <> evm working but evm sends 1/100 of the tokens back, unsure why 2022-09-26 03:41:00 -05:00
package.json showing to cega 2022-09-21 17:41:51 -05:00
tsconfig.json
xdapp.config.json
yarn.lock showing to cega 2022-09-21 17:41:51 -05:00

README.md

Example Project: xMint

Summary

xMint is a sample project that uses Ultra Light Clients and Contract Controlled Transfers to allow users to to pay in their native currency to receive tokens from a foreign chain. It does this by bridging the native currency over to the foreign chain, then purchasing the foreign tokens, and bridging the foreign tokens back to their native chain wallet.

Behind this simple transaction is a set of complex Wormhole interactions.

Setup

Prerequisites:

  • wormhole-local-validator installed and running
  • anchor
  • foundry-rs
# starting in xmint root directory
yarn
cd chains/solana
yarn
anchor build
cd ../evm
forge install
cd ../..

cp keypairs/evm0.key.example keypairs/evm0.key
cp keypairs/evm1.key.example keypairs/evm1.key
cp keypairs/sol0.key.example keypairs/sol0.key

npx ts-node orchestrator.ts deploy evm0 
npx ts-node orchestrator.ts deploy evm1 
npx ts-node orchestrator.ts deploy sol0 

ts-node orchestrator.ts register-app evm0 evm1
ts-node orchestrator.ts register-app evm1 evm0
ts-node orchestrator.ts register-app evm0 sol0
ts-node orchestrator.ts register-app evm1 sol0
ts-node orchestrator.ts register-app sol0 evm0
ts-node orchestrator.ts register-app sol0 evm1

ts-node orchestrator.ts buy-token evm0 evm1 5

Contract Deploy

Register App

Calls

Buy Token

Sell Token

Balance